[Csnd] Impulse response question

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).

Oeyvind, perhaps you know?

Thanks,
Dave

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

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 :slight_smile:

Thanks Rory. That’s a great video, I actually found it before posting. :slight_smile:

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.

  • Dave

Hi Dave,
Here you can find a procedure to generate an impulse and a procedure to indagate impulse response of a filter. Maybe it is not you are looking for, it was created to evaluate IR of filters sample by sample.
https://www.researchgate.net/publication/386420091_Opening_mind_by_opening_architecture_analysis_strategies

Ciao!
Giuseppe

Hi Dave,

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

SynVerb.csd (39.2 KB)

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.

best

Wow, that’s a wealth of great info. Thanks Giuseppe, Iain, and Victor!

Thought I’d experiment like in the video and made two CSD’s:

  1. 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.)
  2. 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.

gen_IR_example.zip (1.24 KB)

Thanks, Steven! Very cool.

based on steven's work i did an example for csoundqt some years ago:

Nice!