Debian Codegraph @

src/Examples/FLOSS Manual Examples/04 Sound Synthesis/04G03_MS_variable_constant.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 32
8 nchnls = 2
9 0dbfs = 1
10
11 instr MassSpring
12 ;set ksmps=1 in this instrument
13 setksmps 1
14 ;initial values
15 a0 init 0
16 a1 init 0.05
17 kc randomi .001, .05, 8, 3
18 ;calculation of the next value
19 a2 = a1+(a1-a0) - kc*a1
20 outs a0, a0
21 ;actualize values for the next step
22 a0 = a1
23 a1 = a2
24 endin
25 </CsInstruments>
26 <CsScore>
27 i "MassSpring" 0 10
28 </CsScore>
29 </CsoundSynthesizer>
30 ;example by joachim heintz