Debian Codegraph @

examples/sfplay3m.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 sfplay3m.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 ; By Menno Knevel - 2020
12
13 sr = 44100
14 ksmps = 32
15 nchnls = 2
16 0dbfs = 1
17
18
19 gisf sfload "07AcousticGuitar.sf2"
20 sfplist gisf
21 sfpassign 0, gisf ; assign the preset to number 00
22
23 instr 1
24
25 inum = p4
26 ivel = p5
27 kamp linsegr 1, 1, 1, .1, 0
28 kamp = kamp/900000 * ivel ;scale amplitude and make velocity dependent
29 kfreq = 1 ;do not change freq from sf
30 aout sfplay3m ivel, inum, kamp, p6, 0, 1 ;preset index = 0, set flag to frequency instead of midi pitch
31 outs aout, aout
32
33 endin
34
35 </CsInstruments>
36 <CsScore>
37
38 i1 0 1 60 127 400 ; take the samples from key 60 and set new frequency
39 i1 + 1 60 90 <
40 i1 + 1 60 60 <
41 i1 + 1 60 10 200
42
43 e
44 </CsScore>
45 </CsoundSynthesizer>