How can I replace the IR without transients and other artifacts in the realtime?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I use IPlugConvoEngine as an example for the convolution engine.
How can I replace the IR (SetImpulse() method) without transients and other artifacts in the audio stream when the plugin is running?
For example, in some convolvers, such as the Fruity Convolver, changes are not accompanied by crackling or clicking sounds.
Does anyone have any ideas about this or better open source examples? I will be glad to finally close this difficult topic.

Post

For a smooth IR change you need (temporarily) two convolvers. Initially, you feed convolver 1 with your audio and convolver 2 with zeros, and sum their outputs. Now load IR 2 into convolver 2 and crossfade the audio input to convolver 2. After that is completed, wait one IR length for the output of convolver 1 to fade out, then you can optionally switch off convolver 1 to save CPU.

Post

martinvicanek wrote: Fri Dec 29, 2023 8:03 am For a smooth IR change you need (temporarily) two convolvers. Initially, you feed convolver 1 with your audio and convolver 2 with zeros, and sum their outputs. Now load IR 2 into convolver 2 and crossfade the audio input to convolver 2. After that is completed, wait one IR length for the output of convolver 1 to fade out, then you can optionally switch off convolver 1 to save CPU.
This method might not be ideal in terms of responsiveness if the IRs are long, because if we had (say) 15 second reverb tails we'd need to wait 15 seconds before we have a free convolver to upload the new IR into... or run a lot more convolutions in parallel.

What I'd rather suggest is have (logically) two convolvers. Normally just one runs. When you upload new IR, run both in parallel and crossfade the outputs over something like .. idk.. 100ms or so? Once the original IR is faded out, you can reset it and stop processing or upload yet another IR for another crossfade. This will let you do changes with a much better response time while still avoiding most of the artifacts just fine. It's not quite as smooth as fading inputs, because it cuts the old tail short (fades it out), but ... might even be preferable for someone trying to tweak IRs or whatever, because you get better feedback.

Now.. I said "logically" two convolvers... because if you're doing FFT convolution you don't necessarily need the whole thing duplicated since you only need to FFT the input once, do both convolutions in the frequency domain and then FFT both back to time-domain for a cross-fade. If you're doing non-uniform partitioning, then it's also useful to remember that it takes a while before the new IR is going to produce any output from the longer FFTs and you can take advantages of this to skip the long IFFTs for the new one and just fade out the old one... so you probably only need to duplicate the FFT effort for a few shorter blocks.

Post Reply

Return to “DSP and Plugin Development”