Debian Codegraph @

examples/sfilist.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 sfilist.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 gisf sfload "sf_GMbank.sf2"
19 sfilist gisf ;lists all instruments of Soundfont
20
21 instr 1
22
23 inum = p4
24 ivel = p5
25 kamp linsegr 1, 1, 1, .1, 0
26 kamp = kamp/250000 ;scale amplitude, small value due to 0dbfs = 1
27 kfreq = 1 ;do not change freq from sf
28 a1, a2 sfinstr3 ivel, inum, kamp*ivel, kfreq, p6, gisf ;p6 chooses instrument, make amp velocity dependent
29 outs a1, a2
30
31 endin
32
33 </CsInstruments>
34 <CsScore>
35
36 i1 0 1 60 127 100 ;Halo Pad
37 i1 + 1 62 < .
38 i1 + 1 65 < .
39 i1 + 1 69 10 .
40
41 i1 5 1 60 127 1 ;Piano 2
42 i1 + 1 62 < .
43 i1 + 1 65 < .
44 i1 + 1 69 10 .
45
46 e
47 </CsScore>
48 </CsoundSynthesizer>