I´m working on a plugin that implements an EQ by convolution (using Juce::dsp::Convolution) with an IR library of a hardware EQ.
The EQ has several stages (Hi, Mid, Low, Filters etc) and I´m currently working on implementing these consecutive stages.
My first approach was to select the appropriate IR per filter stage according to the GUI values, then convolve the IRs with each other to get my master IR. Then, in the main proccesing function I convolve the audio buffer with the master IR.
This almost works (I have it working perfectly for a single filter stage, and for multiple stages with some inconsistency in switching IRs), but due to the thread safe design of the Convolution class, the IRs are not updated immediately in the filter stages, which leads to problems.
When I turn a knob in the GUI, I load the corresponding IR, and then call my own recalculateIR function that contains code like this:
prepareIRconvObj->loadImpulseResponse(HPF->getIRStreamData(), HPF->getIRSourceDataSize(), false, false, IRlength);
But calling the process function directly after loading the IR does not guarantee that the IR has already been updated accordingly. And then this IR update function is only called the next time when I touch the next parameter.
Could anyone please help me with an idea for a control flow, for first convolving several IRs with each other and then convolving the result with audio?