File: embeddedCtcsound.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 (38 lines) | stat: -rw-r--r-- 715 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
32
33
34
35
36
37
38
<CsoundSynthesizer>
<CsOptions>
  -odac
</CsOptions>
<CsInstruments>

sr     = 48000
ksmps  = 100
nchnls = 2

pyinit ;Start python interpreter

pyruni {{
import ctcsound
import sys

# Get an opaque pointer to the running Csound instance
# and print Python version number
p = _CSOUND_
print("\\n  --> Python version number: {}\\n".format(sys.version_info[0]))
# Create an object called cs from the ctcsound.Csound class
# using the opaque pointer to the Csound instance
cs = ctcsound.Csound(pointer_=p)
}}

instr 1
  ; Use the cs python object
  pyruni {{
print("\\n  --> Sample Rate: {}, Control Rate: {}\\n".format(cs.sr(), cs.kr()))
  }}
endin

</CsInstruments>
<CsScore>
i1 0 1
</CsScore>
</CsoundSynthesizer>