Hi,
I have a plugin that uses the convolution engine to process incoming audio. I need to update the IR quite frequently, e.g, 4x per second.
To avoid artefacts I was going to have an active and standby convolution engine and crossfade between them, but looking at the convolution engine code it seems it does that already – hooray!
However, if I update the IR I still notice various artefacts (pops, clicks, the usual). I’m wondering if it’s possibly due to the audio thread being blocked by the switching o the impulse response. Is that likely the case? or could there be a different issue?
And is there a better way to achieve my goals? ![]()
Here’s how I’m updating the IR:
void DrawverbAudioProcessor::updateConvolutionIR(const std::vector<float>& finalIRLeft,
const std::vector<float>& finalIRRight)
{
int maxLength = std::max(static_cast<int>(finalIRLeft.size()), static_cast<int>(finalIRRight.size()));
juce::AudioBuffer<float> irBuffer;
irBuffer.setSize(2, maxLength);
irBuffer.clear();
irBuffer.copyFrom(0, 0, finalIRLeft.data(), static_cast<int>(finalIRLeft.size()));
irBuffer.copyFrom(1, 0, finalIRRight.data(), static_cast<int>(finalIRRight.size()));
convolutionEngine.loadImpulseResponse(std::move(irBuffer),
getSampleRate(),
juce::dsp::Convolution::Stereo::yes,
juce::dsp::Convolution::Trim::yes,
juce::dsp::Convolution::Normalise::no);
}
Thanks for any help.
