Debian Codegraph @

examples/rnd-advanced.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in
5 -odac -iadc ;;;RT audio I/O
6 ; For Non-realtime ouput leave only the line below:
7 ; -o rnd.wav -W ;;; for file output any platform
8
9 ; By Stefano Cucchi 2020
10
11 </CsOptions>
12 <CsInstruments>
13
14
15 sr = 44100
16 ksmps = 32
17 nchnls = 2
18 0dbfs = 1
19
20 instr 1
21 ; Generate a random number from 0 to 5
22 irand1 = rnd(5)
23 ; Generate a random number from 0 to 13
24 irand2 = rnd(13)
25
26 print irand1
27 print irand2
28
29 a1, a2 crossfm 200, 250, irand1, irand2, 1, 1, 1
30 kdeclick linseg 0, 0.2, 0.5, p3-0.4, 0.5, 0.2, 0
31
32 outch 1, a1*kdeclick
33 outch 2, a2*kdeclick
34
35 endin
36
37 </CsInstruments>
38 <CsScore>
39
40 f 1 0 4096 10 1 0 1 0 0.5 0 0.2
41
42 i 1 0 1
43 i 1 + 1
44 i 1 + 1
45 i 1 + 1
46
47
48 e
49
50 </CsScore>
51 </CsoundSynthesizer>