Debian Codegraph @

src/Examples/FLOSS Manual Examples/03 Csound Language/03F12_event_i_vs_event.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -nm0
4 </CsOptions>
5 <CsInstruments>
6 sr=44100
7 ksmps = 32
8
9 ;set counters for the instances of Called_i and Called_k
10 giInstCi init 1
11 giInstCk init 1
12
13 instr Call_i
14 ;call another instrument at i-rate
15 event_i "i", "Called_i", 0, 1
16 endin
17
18 instr Call_k
19 ;call another instrument at k-rate
20 event "i", "Called_k", 0, 1
21 endin
22
23 instr Called_i
24 ;report that instrument starts and which instance
25 prints "Instance #%d of Called_i is starting!\n", giInstCi
26 ;increment number of instance for next instance
27 giInstCi += 1
28 endin
29
30 instr Called_k
31 ;report that instrument starts and which instance
32 prints " Instance #%d of Called_k is starting!\n", giInstCk
33 ;increment number of instance for next instance
34 giInstCk += 1
35 endin
36
37 </CsInstruments>
38 <CsScore>
39 ;run "Call_i" for one second
40 i "Call_i" 0 1
41 ;run "Call_k" for 1/100 seconds
42 i "Call_k" 0 0.01
43 </CsScore>
44 </CsoundSynthesizer>
45 ;example by joachim heintz