Debian Codegraph @

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

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac -m128
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 32
8 nchnls = 2
9 0dbfs = 1
10 seed 0
11
12 instr Play
13 ifreq1 random 600, 1000; starting frequency
14 idiff random 100, 300; difference to final frequency
15 ifreq2 = ifreq1 - idiff; final frequency
16 kFreq expseg ifreq1, p3, ifreq2; glissando
17 iMaxdb random -18, -6; peak randomly between -12 and 0 dB
18 kAmp transeg ampdb(iMaxdb), p3, -10, 0; envelope
19 aTone poscil kAmp, kFreq
20 out aTone, aTone
21 if p4 > 0 then
22 schedule("Play",random:i(.3,1.5),random:i(1,5), p4-1)
23 endif
24 endin
25
26 </CsInstruments>
27 <CsScore>
28 i "Play" 0 3 20
29 </CsScore>
30 </CsoundSynthesizer>
31 ;example by joachim heintz