Debian Codegraph @

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

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -o dac
4 </CsOptions>
5 <CsInstruments>
6 nchnls = 2
7 sr = 44100
8 ksmps = 32
9 0dbfs = 1
10
11 gipos ftgen 0,0,128,10,1,1,1,1,1,1 ;Initial Position Shape: impulse-like
12 gimass ftgen 0,0,128,-5,0.0001,128,.01 ;Masses: exponential 0.0001 to 0.01
13 gistiff ftgen 0,0,128,-7,0,64,100,64,0 ;Stiffness; triangle range 0 to 100
14 gidamp ftgen 0,0,128,-7,1,128,1 ;Damping; constant value 1
15 givel ftgen 0,0,128,-7,0,128,0 ;Initial Velocity; constant value 0
16 gisin ftgen 0,0,8192,10,1 ;Sine wave for buzz opcode
17
18 instr 1
19 iamp = .2
20 kfrq = 110
21 aBuzz buzz iamp, kfrq, 32, gisin
22 aBuzz linen aBuzz, .1, p3, 1
23 out aBuzz, aBuzz
24 endin
25 instr 2
26 iamp = .4
27 kfrq = 110
28 a0 scantable 0, 0, gipos, gimass, gistiff, gidamp, givel
29 ifftsize = 128
30 ioverlap = ifftsize / 4
31 iwinsize = ifftsize
32 iwinshape = 1; von-Hann window
33 aBuzz buzz iamp, kfrq, 32, gisin
34 fBuzz pvsanal aBuzz, ifftsize, ioverlap, iwinsize, iwinshape ;fft
35 fMask pvsmaska fBuzz, gipos, 1
36 aOut pvsynth fMask; resynthesize
37 aOut linen aOut, .1, p3, 1
38 out aOut, aOut
39 endin
40 </CsInstruments>
41 <CsScore>
42 i 1 0 3
43 i 2 4 20
44 </CsScore>
45 </CsoundSynthesizer>
46 ;Example by Christopher Saunders and joachim heintz