Debian Codegraph @

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

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac
4 </CsOptions>
5 <CsInstruments>
6
7 sr = 44100
8 ksmps = 32 ;try 64 or other values
9 nchnls = 2
10 0dbfs = 1
11
12 instr 1 ;without explicit init
13 i1 = p4
14 if i1 == 0 then
15 a1 poscil 0.5, 500
16 endif
17 if i1 == 1 then
18 a2 poscil 0.5, 600
19 endif
20 outs a1, a2
21 endin
22
23 instr 2 ;with explicit init
24 i1 = p4
25 if i1 == 0 then
26 a1 poscil 0.5, 500
27 a2 init 0
28 endif
29 if i1 == 1 then
30 a2 poscil 0.5, 600
31 a1 init 0
32 endif
33 outs a1, a2
34 endin
35
36 </CsInstruments>
37 <CsScore>
38 i 1 0 .5 0
39 i . 1 . 0
40 i . 2 . 1
41 i . 3 . 1
42 i . 4 . 0
43 i . 5 . 0
44 i . 6 . 1
45 i . 7 . 1
46 b 9
47 i 2 0 .5 0
48 i . 1 . 0
49 i . 2 . 1
50 i . 3 . 1
51 i . 4 . 0
52 i . 5 . 0
53 i . 6 . 1
54 i . 7 . 1
55 </CsScore>
56 </CsoundSynthesizer>
57 ;example by oeyvind brandtsegg and joachim heintz