| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in |
| 5 |
-odac --limiter=.95 ;;;realtime audio out |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o svfilter.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 |
instr 1 |
| 17 |
|
| 18 |
idur = p3 |
| 19 |
ifreq = p4 |
| 20 |
iamp = p5 |
| 21 |
ilowamp = p6 ; determines amount of lowpass output in signal |
| 22 |
ihighamp = p7 ; determines amount of highpass output in signal |
| 23 |
ibandamp = p8 ; determines amount of bandpass output in signal |
| 24 |
iq = p9 ; value of q |
| 25 |
|
| 26 |
iharms = (sr*.4) / ifreq |
| 27 |
|
| 28 |
asig gbuzz .4, ifreq, iharms, 1, .9, 1 ; Sawtooth-like waveform |
| 29 |
kfreq linseg 1, idur * 0.5, 4000, idur * 0.5, 1 ; Envelope to control filter cutoff |
| 30 |
|
| 31 |
alow, ahigh, aband svfilter asig, kfreq, iq |
| 32 |
|
| 33 |
aout1 = alow * ilowamp |
| 34 |
aout2 = ahigh * ihighamp |
| 35 |
aout3 = aband * ibandamp |
| 36 |
asum = aout1 + aout2 + aout3 |
| 37 |
kenv linseg 0, .1, iamp, idur -.2, iamp, .1, 0 ; Simple amplitude envelope |
| 38 |
outs asum * kenv, asum * kenv |
| 39 |
|
| 40 |
endin |
| 41 |
|
| 42 |
</CsInstruments> |
| 43 |
<CsScore> |
| 44 |
f1 0 8192 9 1 1 .25 |
| 45 |
|
| 46 |
i1 0 5 100 .1 1 0 0 5 ; lowpass sweep |
| 47 |
i1 5 5 200 .1 1 0 0 30 ; lowpass sweep, octave higher, higher q |
| 48 |
i1 10 5 100 .1 0 1 0 5 ; highpass sweep |
| 49 |
i1 15 5 200 .1 0 1 0 30 ; highpass sweep, octave higher, higher q |
| 50 |
i1 20 5 100 .1 0 0 1 5 ; bandpass sweep |
| 51 |
i1 25 5 200 .1 0 0 1 30 ; bandpass sweep, octave higher, higher q |
| 52 |
i1 30 5 200 .2 .4 .6 0 ; notch sweep - notch formed by combining highpass and lowpass outputs |
| 53 |
e |
| 54 |
</CsScore> |
| 55 |
</CsoundSynthesizer> |