Debian Codegraph @

examples/loop_-group.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -n
4 </CsOptions>
5 <CsInstruments>
6 ;example by joachim heintz
7 sr = 44100
8 ksmps = 32
9 nchnls = 2
10 0dbfs = 1
11
12 instr 1 ;loop_lt: counts from 1 upwards and checks if < 10
13 icount = 1
14 loop:
15 print icount
16 loop_lt icount, 1, 10, loop
17 prints "Instr 1 terminated!%n"
18 endin
19
20 instr 2 ;loop_le: counts from 1 upwards and checks if <= 10
21 icount = 1
22 loop:
23 print icount
24 loop_le icount, 1, 10, loop
25 prints "Instr 2 terminated!%n"
26 endin
27
28 instr 3 ;loop_gt: counts from 10 downwards and checks if > 0
29 icount = 10
30 loop:
31 print icount
32 loop_gt icount, 1, 0, loop
33 prints "Instr 3 terminated!%n"
34 endin
35
36 instr 4 ;loop_ge: counts from 10 downwards and checks if >= 0
37 icount = 10
38 loop:
39 print icount
40 loop_ge icount, 1, 0, loop
41 prints "Instr 4 terminated!%n"
42 endin
43
44 </CsInstruments>
45 <CsScore>
46 i 1 0 0
47 i 2 0 0
48 i 3 0 0
49 i 4 0 0
50 </CsScore>
51 </CsoundSynthesizer>