Debian Codegraph @

examples/poisson.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in
5 -n
6 ; For Non-realtime ouput leave only the line below:
7 ; -o poisson.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 441 ;ksmps set deliberately high to have few k-periods per second
13 nchnls = 1
14
15 instr 1
16 ; Generates a random number in a poisson distribution.
17 ; klambda = 1
18 i1 poisson 1
19 print i1
20 endin
21
22 instr 2
23 kres poisson p4
24 printk (ksmps/sr),kres ;prints every k-period
25 endin
26
27 </CsInstruments>
28 <CsScore>
29 i 1 0 1
30
31 i 2 1 0.2 0.5
32 i 2 2 0.2 4 ;average 4 events per k-period
33 i 2 3 0.2 20 ;average 20 events per k-period
34 e
35 </CsScore>
36 </CsoundSynthesizer>