| 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 nlfilt.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 ;unfiltered noise |
| 17 |
|
| 18 |
asig rand .7 |
| 19 |
outs asig, asig |
| 20 |
|
| 21 |
endin |
| 22 |
|
| 23 |
instr 2 ;filtered noise |
| 24 |
|
| 25 |
ka = p4 |
| 26 |
kb = p5 |
| 27 |
kd = p6 |
| 28 |
kC = p7 |
| 29 |
kL = p8 |
| 30 |
asig rand .3 |
| 31 |
afilt nlfilt2 asig, ka, kb, kd, kC, kL |
| 32 |
outs afilt, afilt |
| 33 |
endin |
| 34 |
</CsInstruments> |
| 35 |
<CsScore> |
| 36 |
|
| 37 |
i 1 0 2 ; unfiltered |
| 38 |
|
| 39 |
; a b d C L |
| 40 |
i 2 2 2 0 0 0.8 0.5 20 ; non-linear effect |
| 41 |
i 2 + 2 .4 0.2 0.7 0.11 200 ; low=pass with non-linear |
| 42 |
i 2 + 2 0.35 -0.3 0.95 0.1 200 ; high-pass with non-linear |
| 43 |
i 2 + 2 0.7 -0.2 0.9 0.2 20 ; high-pass with non-linear |
| 44 |
|
| 45 |
e |
| 46 |
</CsScore> |
| 47 |
</CsoundSynthesizer> |