Has anyone written code to create an impulse response (IR) in Csound? I’m interested in synthetic or procedurally-generated IRs versus IRs based on actual physical spaces. This could be a very interesting capability in conjunction with liveconv especially if it could be done in real time (or close to realtime).
The liveconv opcode example in the manual records a live impulse response and uses that. You could easily generate one and use it instead. https://csound.com/docs/manual/liveconv.html
Back when I was teaching students Csound I would show them this video https://www.youtube.com/watch?v=Englz96gnqM
and then get them to generate IRs with Csound. If I was doing it today I would get them to build a realtime IR generator/processor using function tables and liveconv
Thanks Rory. That’s a great video, I actually found it before posting.
The liveconv example uses slices of an existing audio file, and doesn’t process them with an amplitude envelope and filter the way that the video shows. This is definitely an interesting use case, and of course the source audio can be captured live. But what I’m musing about is actually creating a “proper” IR from scratch in code. It seems to me that all the steps shown in the video could be done within Csound. I may try that.
Here’s a Cabbage instrument that I’ve been working on that synthesises impulse responses using noise, scattered clicks, sine chirps and filters, parameters of which can be shaped across the IR’s duration using envelopes. The synthesised IR is auditioned using ftconv, or you can export it as a wav. Hint: you’ll need to raise ‘Input Gain’ (and use headphones) to get started using your laptop microphone. It defaults to zero to prevent disastrous feedback.
Regards,
Iain
Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here
Besides using tvconv for live convolution, I’ve also used GEN53 to create impulse responses from
arbitrary amplitude responses and also use decaying Gaussian IRs directly to simulate diffuse reverb.
Thought I’d experiment like in the video and made two CSD’s:
gen_IR.csd - generates an IR using pink noise that is enveloped and filtered. (Experimented with multiple pink noise sources and some mixing between the output stereo channels.)
example.csd - uses pconvolve with some delay compensation together with a note generator and instrument that has various randomizations in it.
Just need to run gen_IR.csd first to produce IR.wav, then can run example.csd with that.
The reverb sounds a little artificial (a little more noticeable when the generated IR was shorter) but I thought it worked well enough for this example. Figured I’d add this here in case it was useful for anyone.