| 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 sfplaym.wav -W ;;; for file output any platform |
| 8 |
|
| 9 |
; By Menno Knevel - 2020 |
| 10 |
|
| 11 |
</CsOptions> |
| 12 |
<CsInstruments> |
| 13 |
|
| 14 |
sr = 44100 |
| 15 |
ksmps = 32 |
| 16 |
nchnls = 2 |
| 17 |
0dbfs = 1 |
| 18 |
|
| 19 |
|
| 20 |
gisf sfload "07AcousticGuitar.sf2" |
| 21 |
sfplist gisf |
| 22 |
sfpassign 100, gisf ;in this case, the number 100 is assigned to the preset |
| 23 |
|
| 24 |
instr 1 |
| 25 |
|
| 26 |
inum = p4 |
| 27 |
ivel = p5 |
| 28 |
kamp linsegr 1, 1, 1, .1, 0 |
| 29 |
kamp = kamp * .000001 ;scale amplitude- small value due to 0dbfs = 0 |
| 30 |
a1 sfplaym ivel, inum, kamp * ivel, p6, 100, 1 ; flag = 1 so frequencies is used intead of midi pitch |
| 31 |
outs a1, a1 |
| 32 |
|
| 33 |
endin |
| 34 |
|
| 35 |
</CsInstruments> |
| 36 |
<CsScore> |
| 37 |
|
| 38 |
i1 0 1 60 127 100 ; use sample of this key and set new frequency |
| 39 |
i1 + 1 62 < < |
| 40 |
i1 + 1 65 < < |
| 41 |
i1 + 1 69 10 70 |
| 42 |
|
| 43 |
e |
| 44 |
</CsScore> |
| 45 |
</CsoundSynthesizer> |