Debian Codegraph @

examples/zarg.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 zarg.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, with an amplitude
24 ; between 0 and 1.
25 asin oscil 1, 440, 1
26
27 ; Send the sine waveform to za variable #1.
28 zaw asin, 1
29 endin
30
31 ; Instrument #2 -- generates audio output.
32 instr 2
33 ; Read za variable #1, multiply its amplitude by 20,000.
34 a1 zarg 1, 20000
35
36 ; Generate audio output.
37 out a1
38
39 ; Clear the za variables, get them ready for
40 ; another pass.
41 zacl 0, 1
42 endin
43
44
45 </CsInstruments>
46 <CsScore>
47
48 ; Table #1, a sine wave.
49 f 1 0 16384 10 1
50
51 ; Play Instrument #1 for one second.
52 i 1 0 1
53 ; Play Instrument #2 for one second.
54 i 2 0 1
55 e
56
57
58 </CsScore>
59 </CsoundSynthesizer>