Debian Codegraph @

examples/zar.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in No messages
5 -odac -iadc -d ;;;RT audio I/O
6 ; For Non-realtime ouput leave only the line below:
7 ; -o zar.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 ; Initialize the global variables.
12 sr = 44100
13 kr = 4410
14 ksmps = 10
15 nchnls = 1
16
17 ; Initialize the ZAK space.
18 ; Create 1 a-rate variable and 1 k-rate variable.
19 zakinit 1, 1
20
21 ; Instrument #1 -- a simple waveform.
22 instr 1
23 ; Generate a simple sine waveform.
24 asin oscil 20000, 440, 1
25
26 ; Send the sine waveform to za variable #1.
27 zaw asin, 1
28 endin
29
30 ; Instrument #2 -- generates audio output.
31 instr 2
32 ; Read za variable #1.
33 a1 zar 1
34
35 ; Generate audio output.
36 out a1
37
38 ; Clear the za variables, get them ready for
39 ; another pass.
40 zacl 0, 1
41 endin
42
43
44 </CsInstruments>
45 <CsScore>
46
47 ; Table #1, a sine wave.
48 f 1 0 16384 10 1
49
50 ; Play Instrument #1 for one second.
51 i 1 0 1
52 ; Play Instrument #2 for one second.
53 i 2 0 1
54 e
55
56
57 </CsScore>
58 </CsoundSynthesizer>