| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-odac ; activates real time sound output |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
sr = 44100 |
| 7 |
ksmps = 32 |
| 8 |
nchnls = 1 |
| 9 |
0dbfs = 1 |
| 10 |
|
| 11 |
instr 1 |
| 12 |
prints "atone%n" ; indicate filter type in console |
| 13 |
aSig vco2 0.2, 150 ; input signal is a sawtooth waveform |
| 14 |
kcf expon 20, p3, 20000 ; define envelope for cutoff frequency |
| 15 |
aSig atone aSig, kcf ; filter audio signal |
| 16 |
out aSig ; filtered audio sent to output |
| 17 |
endin |
| 18 |
|
| 19 |
instr 2 |
| 20 |
prints "buthp%n" ; indicate filter type in console |
| 21 |
aSig vco2 0.2, 150 ; input signal is a sawtooth waveform |
| 22 |
kcf expon 20, p3, 20000 ; define envelope for cutoff frequency |
| 23 |
aSig buthp aSig, kcf ; filter audio signal |
| 24 |
out aSig ; filtered audio sent to output |
| 25 |
endin |
| 26 |
|
| 27 |
instr 3 |
| 28 |
prints "bqrez(mode:1)%n" ; indicate filter type in console |
| 29 |
aSig vco2 0.03, 150 ; input signal is a sawtooth waveform |
| 30 |
kcf expon 20, p3, 20000 ; define envelope for cutoff frequency |
| 31 |
aSig bqrez aSig, kcf, 30, 1 ; filter audio signal |
| 32 |
out aSig ; filtered audio sent to output |
| 33 |
endin |
| 34 |
|
| 35 |
</CsInstruments> |
| 36 |
<CsScore> |
| 37 |
; 3 notes to demonstrate each filter in turn |
| 38 |
i 1 0 3 ; atone |
| 39 |
i 2 5 3 ; buthp |
| 40 |
i 3 10 3 ; bqrez(mode 1) |
| 41 |
</CsScore> |
| 42 |
</CsoundSynthesizer> |
| 43 |
;example by Iain McCurdy |