Debian Codegraph @

examples/gen20.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o gen20.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15
16 instr 1
17
18 insnd = 10 ;"marimba.aif"
19 ibasfrq = 44100 / ftlen(insnd) ;use original sample rate of insnd file
20
21 kamp expseg .001, p3/2, .7, p3/2, .8 ;envelope
22 kpitch line ibasfrq, p3, ibasfrq * .8
23 kdens line 600, p3, 10
24 kaoff line 0, p3, .1
25 kpoff line 0, p3, ibasfrq * .5
26 kgdur line .04, p3, .001 ;shorten duration of grain during note
27 imaxgdur = .5
28 igfn = p4 ;different windows
29 asigL grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, igfn, imaxgdur, 0.0
30 asigR grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, igfn, imaxgdur, 0.0
31 outs asigL, asigR
32
33 endin
34 </CsInstruments>
35 <CsScore>
36 f1 0 512 20 2 ;Hanning window
37 f2 0 512 20 6 1 ;Gaussian window
38 f10 0 16384 1 "marimba.aif" 0 0 0
39
40 i1 0 5 1 ;use Hanning window
41 i1 + 5 2 ;use Gaussian window
42 e
43 </CsScore>
44 </CsoundSynthesizer>