Debian Codegraph @

examples/randomi.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 randomi.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 ; Initialize the global variables.
12 sr = 44100
13 kr = 4410
14 ksmps = 10
15 nchnls = 1
16
17 seed 0
18
19 ; Instrument #1.
20 instr 1
21 ; Choose a random frequency between 220 and 440.
22 ; Generate new random numbers at 10 Hz.
23 kmin init 220
24 kmax init 440
25 kcps init 10
26 imode = p4
27 ifstval = p5
28
29 printf_i "\nMode: %d\n", 1, imode
30 k1 randomi kmin, kmax, kcps, imode, ifstval
31 printks "k1 = %f\n", 0.1, k1
32 endin
33
34 </CsInstruments>
35 <CsScore>
36
37 ; Play Instrument #1 for one second.
38 ; each time with a different mode.
39 i 1 0 1
40 i 1 1 1 1
41 i 1 2 1 2 330
42 i 1 3 1 3
43 e
44
45 </CsScore>
46 </CsoundSynthesizer>
47