Debian Codegraph @

examples/lag.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 </CsOptions>
4 <CsInstruments>
5
6 sr = 44100
7 ksmps = 128
8 nchnls = 2
9 0dbfs = 1.0
10
11 instr 1
12 ; smooth a krate signal
13 kx = floor(line(0, p3, 10))
14 kx2 = lag(kx, 0.1)
15 printk2 kx2
16 endin
17
18 instr 2
19 ; smooth an audio signal
20 kmidi = floor(line(60, p3, 72)/2)*2
21 afreq = upsamp(mtof(kmidi))
22 afreqsmooth = lag(afreq, 1)
23 a1 = oscili(1, afreq)
24 a2 = oscili(1, afreqsmooth)
25 outch 1, a1
26 outch 2, a2
27 endin
28
29 </CsInstruments>
30 <CsScore>
31 i 1 0 5
32 i 2 0 10
33
34 </CsScore>
35 </CsoundSynthesizer>