Debian Codegraph @

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

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 441
8 nchnls = 2
9 0dbfs = 1
10
11 giSine ftgen 0, 0, 256, 10, 1; sine wave
12 seed 0; each time different seed
13
14 instr 1
15 ktiminstk timeinstk ;time in control-cycles
16 kcount init 1
17 if ktiminstk == kcount * kr then; once per second table values manipulation:
18 kndx = 0
19 loop:
20 krand random -.1, .1;random factor for deviations
21 kval table kndx, giSine; read old value
22 knewval = kval + (kval * krand); calculate new value
23 tablew knewval, kndx, giSine; write new value
24 loop_lt kndx, 1, 256, loop; loop construction
25 kcount = kcount + 1; increase counter
26 endif
27 asig poscil .2, 400, giSine
28 outs asig, asig
29 endin
30
31 </CsInstruments>
32 <CsScore>
33 i 1 0 10
34 </CsScore>
35 </CsoundSynthesizer>
36 ;example by joachim heintz