Open tjingboem opened 3 years ago
Also: complete existing examples for every python opcode already on manaul page
first attempt for pyruni
<CsoundSynthesizer>
<CsOptions>
--nosound
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
;If you are not running CsoundAC you need the following line
;to initialize the python interpreter
pyinit
pyruni "import random"
instr 1
; This message is stored in the main namespace
; and is the same for every instance
pyruni "message = 'a global random number: %f' % random.random()"
pyrun "print(message)"
; This message is stored in the private namespace
; and is different for different instances
pylruni "message = 'a private random number: %f' % random.random()"
pylrun "print(message)"
endin
</CsInstruments>
<CsScore>
i1 0 .1
e
</CsScore>
</CsoundSynthesizer>
produces lots of
a global random number: 0.869267
a private random number: 0.870727
a global random number: 0.869267
a private random number: 0.870727
...........
This one is from the Floss Manuals
;Example by Andrés Cabrera