File: pyrun.csd

package info (click to toggle)
csound-plugins 1.0.2~dfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,960 kB
  • sloc: cpp: 16,586; ansic: 7,522; python: 458; sh: 94; makefile: 25
file content (31 lines) | stat: -rw-r--r-- 647 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<CsoundSynthesizer>
<CsOptions>
 -odac
</CsOptions>
<CsInstruments>
sr=44100
kr=4410
ksmps=10
nchnls=1

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 0.01
</CsScore>
</CsoundSynthesizer>