Debian Codegraph @

examples/sfpreset.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 RT audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o sfpreset.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 gisf1 sfload "sf_GMbank.sf2"
19 sfplist gisf1 ;list presets of first soundfont
20 gisf2 sfload "07AcousticGuitar.sf2"
21 sfplist gisf2 ;list presets of second soundfont
22 gir sfpreset 51, 0, gisf1, 0 ;assign Synth Strings2 (#51)to index 0
23 giv sfpreset 0, 0, gisf2, 1 ;assign AcousticGuitar (#0) to index 1
24 print gir
25 print giv
26
27 instr 1
28
29 inum = p4
30 ivel = p5
31 kamp linsegr 1, 1, 1, .1, 0
32 kamp = kamp/600000 ;scale amplitude, small value due to 0dbfs = 1
33 kfreq = 1 ;do not change freq
34 a1,a2 sfplay3 ivel, inum, kamp*ivel, kfreq, p6
35 outs a1, a2
36 endin
37
38 </CsInstruments>
39 <CsScore>
40
41 i1 0 1 60 127 0 ;= Synth Strings I from first soundfont
42 i1 + 1 62 < .
43 i1 + 1 65 < .
44 i1 + 1 69 10 .
45
46 i1 5 1 60 127 1 ;= AcousticGuitar from second soundfont
47 i1 + 1 62 < .
48 i1 + 1 65 < .
49 i1 + 1 69 10 .
50 e
51 </CsScore>
52 </CsoundSynthesizer>