Debian Codegraph @

examples/checkbox.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in
5 -odac -iadc ;;;RT audio I/O
6 ; For Non-realtime ouput leave only the line below:
7 ; -o checkbox.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 10
13 nchnls = 2
14
15 instr 1
16 kq init 0
17 ; Get the value from the checkbox.
18 k1 checkbox 1
19
20 ; If the checkbox is selected then k2=440, otherwise k2=880.
21 k2 = (k1 == 0 ? 440 : 880)
22
23 a1 oscil 10000, k2, 1
24 outs a1, a1
25 kq button 1
26 schedkwhen kq, 0, 1, 2, 0, 0
27 endin
28
29 instr 2
30 exitnow
31 endin
32
33 </CsInstruments>
34 <CsScore>
35
36 ; sine wave.
37 f 1 0 32768 10 1
38
39 i 1 0 1000
40 e
41
42 </CsScore>
43 </CsoundSynthesizer>
44