| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac -m0 --limiter=.99 ;;;realtime audio out, with limiter protection |
| 5 |
; For Non-realtime ouput leave only the line below: |
| 6 |
; -o cvanal.wav -W ;;; for file output any platform |
| 7 |
</CsOptions> |
| 8 |
<CsInstruments> |
| 9 |
|
| 10 |
sr = 44100 |
| 11 |
ksmps = 32 |
| 12 |
nchnls = 2 |
| 13 |
0dbfs = 1 |
| 14 |
|
| 15 |
; by Menno Knevel 2021 |
| 16 |
|
| 17 |
gilen filelen "rv_stereo.wav" ; get length of impulse soundfile |
| 18 |
|
| 19 |
; analyze sound file and output result to 3 convolve files |
| 20 |
ires1 system_i 1,{{ cvanal rv_stereo.wav rv_stereo1.con }} ; default settings |
| 21 |
ires2 system_i 1,{{ cvanal -d.15 rv_stereo.wav rv_stereo2.con }} ; use only first portion |
| 22 |
ires3 system_i 1,{{ cvanal -b.25 -d.001 rv_stereo.wav rv_stereo3.con }} ; take very short portion from the end |
| 23 |
|
| 24 |
|
| 25 |
instr 1 ; untreated signal |
| 26 |
asig diskin2 "drumsMlp.wav", 1 |
| 27 |
prints "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n" |
| 28 |
outs asig, asig |
| 29 |
endin |
| 30 |
|
| 31 |
instr 2 |
| 32 |
|
| 33 |
prints "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n" |
| 34 |
prints "--**used duration of impulse file = %5.3f seconds (total =%5.2f)**--\\n", p5, gilen |
| 35 |
|
| 36 |
adry diskin2 "drumsMlp.wav" ; input (dry) audio |
| 37 |
awet1, awet2 convolve adry*.8, p4 ; stereo convolved (wet) audio |
| 38 |
awet1 *= p6 ; scale amplitude of impulse sound, Left |
| 39 |
awet2 *= p6 ; & Right channel |
| 40 |
adrydel delay adry, p5 ; delay dry signal to align it with convolved signal |
| 41 |
outs (adrydel+awet1)*.8,(adrydel+awet2)*.8 ; mix wet & dry signals |
| 42 |
endin |
| 43 |
|
| 44 |
</CsInstruments> |
| 45 |
<CsScore> |
| 46 |
|
| 47 |
i1 1 2 ; untreated signal |
| 48 |
|
| 49 |
i2 4 3 "rv_stereo1.con" 0.39 .01 ; use total impulse |
| 50 |
i2 8 3 "rv_stereo2.con" 0.15 .01 ; first portion of impulse |
| 51 |
i2 12 3 "rv_stereo3.con" 0.001 1 ; very short portion of impulse, starting from 0.25 sec, & scale amp |
| 52 |
e |
| 53 |
</CsScore> |
| 54 |
</CsoundSynthesizer> |