Debian Codegraph @

src/Examples/FLOSS Manual Examples/03 Csound Language/03C08_Loop_opcodes_i.csd

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