Debian Codegraph @

examples/sfinstr3.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 sfinstr3.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 gi24 ftgen 1, 0, 32, -2, 24, 2, 261.626, 60, 1, 1.0293022, 1.059463, 1.0905076, 1.1224619, 1.1553525, 1.1892069, \
19 1.2240532, 1.2599207, 1.2968391, 1.33483924, 1.3739531, 1.414213, 1.4556525, 1.4983063, 1.54221, 1.5874001, \
20 1.6339145, 1.6817917, 1.73107, 1.7817962, 1.8340067, 1.8877471, 1.9430623, 2 ;table for microtuning, a 24 tone equal temperament
21
22 giSF sfload "sf_GMbank.sf2"
23 sfilist giSF
24
25 instr 1
26
27 ikey = p4
28 ivel = p5
29 aenv linsegr 1, 1, 1, 1, 0 ;envelope
30 icps cpstuni ikey, 1 ;24 tones per octave
31 iamp = 0.0002 ;scale amplitude
32 iamp = iamp * ivel * 1/128 ;make velocity-dependent, small value due to 0dbfs = 1
33 aL, aR sfinstr3 ivel, ikey, iamp, icps, 180, giSF, 1 ;= Slap Bass 3
34 aL = aL * aenv
35 aR = aR * aenv
36 outs aL, aR
37
38 endin
39 </CsInstruments>
40 <CsScore>
41
42 i1 0 1 60 100 1 ;using ftable 1
43 i1 + 1 62 < .
44 i1 + 1 65 < .
45 i1 + 1 69 20 .
46
47 i1 5 1 60 100 1 ;using ftable 1
48 i1 + 1 61 < .
49 i1 + 1 62 < .
50 i1 + 1 63 20 .
51
52 e
53 </CsScore>
54 </CsoundSynthesizer>