使用 CSound 我试图“动态地”改变声音字体播放的音符的音量,即就像你在演奏小号时吹得越来越强,同时演奏同一个音符。我相信这将通过呼吸控制器来完成。CSound 文档中的以下代码显示了如何将控制器应用于声音字体,但是我正在努力了解如何实现动态音量变化。看看我正在使用的声音字体,呼吸控制是 CC#02。
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac -+rtmidi=virtual -M0 ;;;realtime audio out and realtime midi in
;-iadc ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
;-o fluidCCi.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
giengine fluidEngine
; soundfont path to manual/examples
isfnum fluidLoad "19Trumpet.sf2", giengine, 1
fluidProgramSelect giengine, 1, isfnum, 0, 56
instr 1
mididefault 60, p3
midinoteonkey p4, p5
ikey init p4
ivel init p5
fluidCCi giengine, 1, 93, 127 ;**=> change to CC #2 for breath control.**
**=>How to instruct instrument to play same note from a certain volume to another volume?**
fluidNote giengine, 1, ikey, ivel
endin
instr 99
imvol init 7
asigl, asigr fluidOut giengine
outs asigl*imvol, asigr*imvol
endin
</CsInstruments>
<CsScore>
i 1 0 5 60 100 ; **=> how to pass instructions to play the same note from volume 70 to volume 100 for instance?**
i 99 0 60 ;
e
</CsScore>
</CsoundSynthesizer>