The only thing you need to change in the script is the file path to your impulse response. Also, the dry/wet mix can be controlled using c4u's param 1.
I have also documented all the code so you can see how it works but feel free to ask if you have any questions. It also shows how CPU efficient Csound is as this convolution reverb uses less than 5% CPU on my system!
[c]
;Martin Eastwood, 2011
;Using CSound to do convolution reverb in Usine
;Note we are using two instruments here
;- instr1 gets the input and makes it global
;- instr2 is the actual convolution reverb
;the reason for this is that we could then potentially have any number of
;instruments feeding their data to the globals and then run it all through
;just one reverb - kind of like having one reverb on your master bus. Therefore using
;less CPU than having a reverb per csound instrument!
;To keep the example simple the reverb sums the signal to mono rather than running in stereo
<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr = 44100 ;Csound's samplerate, should be set to match Usine's
ksmps = 1024 ;sets the number of samples in a control period. CSound's Equivalent to Usine's BLOC size
nchnls = 2 ;Number of audio channels in/out of CSound. At the moment Usine only reads channels one and/or two so set to either 1 or 2 for mono/stereo
0dbfs = 1 ;Maximum amplitude of data output by CSound. Data is automatically scaled by Usine
;set this macro to the location of your impulse response. Make sure you keep the #" "# around the file path
#define impulse #"C:\l960brite_stage&hall.wav"#
ga1 init 0 ; preallocate global audio variable
ga2 init 0 ; preallocate global audio variable
instr 1 ; Instrument 1 begins here
ga1 inch 1 ; get audio in from Csound's first input and make global
ga2 inch 2 ; get audio in from Csound's second input and make global
endin
instr 2 ; Instrument 2 begins here
kdrywet chnget "param1" ;get dry/wet param
ipartitionsize = 4096 ; convolution partition size
ilatency = (ksmps < ipartitionsize ? ipartitionsize + ksmps : ipartitionsize)/sr ; claculate latency of pconvolve opcode
arev1, arev2 pconvolve (ga1+ga2)*0.5, $impulse, 4096 ;do the convolution
adry1 delay ga1, ilatency ;delay dry signal by latency of the convolution to keep in sync
adry2 delay ga2, ilatency ;delay dry signal by latency of the convolution to keep in sync
amix1 = (adry1 * (1. - kdrywet)) + ((arev1 * kdrywet)*0.15) ;mix dry / wet signals
amix2 = (adry2 * (1. - kdrywet)) + ((arev2 * kdrywet)*0.15) ;mix dry / wet signals
outs amix1, amix2 ; send to CSound's outputs
ga1 = 0 ; zero globals for safety
ga2 = 0 ; zero globals for safety
endin
</CsInstruments>
<CsScore>
;ins strt dur
i1 0 40000
i2 0 40000
e ; indicates the end of the score
</CsScore>
</CsoundSynthesizer>
[/c]
