| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-nm0 |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
|
| 7 |
giTable ftgen 0, 0, -20, -2, 0; empty function table with 20 points |
| 8 |
seed 0; each time different seed |
| 9 |
|
| 10 |
instr 1 ; writes in the table |
| 11 |
icount = 0 |
| 12 |
loop: |
| 13 |
ival random 0, 10.999 ;random value |
| 14 |
; --- write in giTable at first, second, third ... position |
| 15 |
tableiw int(ival), icount, giTable |
| 16 |
loop_lt icount, 1, 20, loop; loop construction |
| 17 |
endin |
| 18 |
|
| 19 |
instr 2; reads from the table |
| 20 |
icount = 0 |
| 21 |
loop: |
| 22 |
; --- read from giTable at first, second, third ... position |
| 23 |
ival tablei icount, giTable |
| 24 |
print ival; prints the content |
| 25 |
loop_lt icount, 1, 20, loop; loop construction |
| 26 |
endin |
| 27 |
|
| 28 |
</CsInstruments> |
| 29 |
<CsScore> |
| 30 |
i 1 0 0 |
| 31 |
i 2 0 0 |
| 32 |
</CsScore> |
| 33 |
</CsoundSynthesizer> |
| 34 |
;example by joachim heintz |