1<CsoundSynthesizer>
2<CsOptions>
3; Select audio/midi flags here according to platform
4-odac    ;;;realtime audio out
5;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
6; For Non-realtime ouput leave only the line below:
7; -o printk2.wav -W ;;; for file output any platform
8</CsOptions>
9<CsInstruments>
10
11sr = 44100
12ksmps = 32
13nchnls = 2
140dbfs  = 1
15
16instr 1
17
18kval    randomh 0, 1.2, 20		;choose between 0 and 1.2
19if kval >0 && kval<=.5 then		;3 possible outcomes
20	kval = 1
21elseif kval >.5 && kval<=1 then
22	kval =2
23elseif kval >1 then
24	kval =3
25endif
26
27printk2 kval				;print value when it changes
28asig    poscil .7, 440*kval, 1
29        outs asig, asig
30
31endin
32</CsInstruments>
33<CsScore>
34f1 0 16384 10 1
35
36i 1 0 5
37e
38</CsScore>
39</CsoundSynthesizer>
40