Debian Codegraph @

src/Examples/FLOSS Manual Examples/05 Sound Modification/05G01_simple_grain.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 Grain
12 //input parameters
13 Sound = "fox.wav"
14 iStart = p4 ;position in sec to read the sound
15 iSpeed = p5
16 iVolume = -3 ;dB
17 iPan = .5 ;0=left, 1=right
18 //perform
19 aSound = diskin:a(Sound,iSpeed,iStart,1)
20 aOut = linen:a(aSound,p3/2,p3,p3/2)
21 aL, aR pan2 aOut*ampdb(iVolume), iPan
22 out(aL,aR)
23 endin
24
25 </CsInstruments>
26 <CsScore>
27 ; start speed
28 i "Grain" 0 .05 .05 1
29 i . 1 . .2 .
30 i . 2 . .42 .
31 i . 3 . .78 .
32 i . 4 . 1.2 .
33 i . 6 . .2 1
34 i . 7 . . 2
35 i . 8 . . 0.5
36 i . 9 . . 10
37 i . 10 . .25 -1
38 </CsScore>
39 </CsoundSynthesizer>
40 ;example by joachim heintz