#!/usr/bin/env python import csnd6 import os def increment(counter): counter += 1 return counter def counterprint(counter): print 'counter = %d%s' % (counter, os.linesep) counter = 0 counterprint(counter) csdorc = ''' sr = 44100 ksmps = 16 nchnls = 2 instr 1 print p1 pyruni "message = 400000000" pyruni "print message" print p2 endin ''' csdsco = ''' f0 10 10 1 i1 0 5 ''' cpps = csnd6.CppSound() cpps.setCommand('csound -m0d') cpps.setOrchestra(csdorc) cpps.setScore(csdsco) cpps.compile() cpps.exportForPerformance() counterprint(counter) print "........................ Perf Thread" counter = increment(counter) counterprint(counter) perf = csnd6.CsoundPerformanceThread(cpps) perf.Play() counter = increment(counter) counterprint(counter)