| 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 envlpx.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
nchnls = 2 |
| 14 |
0dbfs = 1 |
| 15 |
|
| 16 |
|
| 17 |
instr 1 |
| 18 |
|
| 19 |
irise = 0.2 |
| 20 |
idec = 0.5 |
| 21 |
idur = p3 - idec |
| 22 |
|
| 23 |
ifn = 1 |
| 24 |
iatss = p5 |
| 25 |
iatdec = 0.01 |
| 26 |
|
| 27 |
kenv envlpx .6, irise, idur, idec, ifn, iatss, iatdec |
| 28 |
kcps = cpspch(p4) |
| 29 |
asig vco2 kenv, kcps |
| 30 |
;apply envlpx to the filter cut-off frequency |
| 31 |
asig moogvcf asig, kcps + (kenv * 8 * kcps) , .5 ;the higher the pitch, the higher the filter cut-off frequency |
| 32 |
outs asig, asig |
| 33 |
|
| 34 |
endin |
| 35 |
</CsInstruments> |
| 36 |
<CsScore> |
| 37 |
; a linear rising envelope |
| 38 |
f 1 0 129 -7 0 128 1 |
| 39 |
|
| 40 |
i 1 0 2 7.00 .1 |
| 41 |
i 1 + 2 7.02 1 |
| 42 |
i 1 + 2 7.03 2 |
| 43 |
i 1 + 2 7.05 3 |
| 44 |
e |
| 45 |
</CsScore> |
| 46 |
</CsoundSynthesizer> |