Debian Codegraph @

examples/exitnow.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ; For Non-realtime ouput leave only the line below:
6 ; -o exitnow.wav -W ;;; for file output any platform
7 </CsOptions>
8 <CsInstruments>
9
10 sr = 44100
11 ksmps = 32
12 nchnls = 2
13 0dbfs = 1
14
15 ; plays a sine wav, forces a stop after 2 seconds
16 instr 1
17 ; generate a line from 0 to 1 over 2 seconds
18 kStop line 0, 2, 1
19
20 ; launch instrument 2 once kStop signal is greater than 1
21 if(kStop>=1) then
22 schedulek 2, 0, 1
23 endif
24
25 ; print kStop signal every .1 seconds
26 printk .1, kStop
27
28 ; make some noise
29 aSig oscil 1, 440
30 outs aSig, aSig
31 endin
32
33 ; forces an instant exit of csound
34 instr 2
35 exitnow
36 endin
37
38 </CsInstruments>
39 <CsScore>
40 ; play oscil instrument infinitely
41 i 1 0 z
42 </CsScore>
43 </CsoundSynthesizer>