Debian Codegraph @

examples/zkw.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 zkw.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 ; Linearly vary a k-rate signal from 100 to 1,000.
24 kline line 100, p3, 1000
25
26 ; Add the linear signal to zk variable #1.
27 zkw kline, 1
28 endin
29
30 ; Instrument #2 -- generates audio output.
31 instr 2
32 ; Read zk variable #1.
33 kfreq zkr 1
34
35 ; Use the value of zk variable #1 to vary
36 ; the frequency of a sine waveform.
37 a1 oscil 20000, kfreq, 1
38
39 ; Generate the audio output.
40 out a1
41
42 ; Clear the zk variables, get them ready for
43 ; another pass.
44 zkcl 0, 1
45 endin
46
47
48 </CsInstruments>
49 <CsScore>
50
51 ; Table #1, a sine wave.
52 f 1 0 16384 10 1
53
54 ; Play Instrument #1 for two seconds.
55 i 1 0 2
56 ; Play Instrument #2 for two seconds.
57 i 2 0 2
58 e
59
60
61 </CsScore>
62 </CsoundSynthesizer>