A basic code on how to add the IIR Filter?

Hi @fabi74,
it is quite straight forward.

Version a)
Create a filter instance for each channel / signal. To set the filter up use the static methods in IIRCoefficients, e.g.:

filter = new IIRFilter (IIRCoefficients::makeHighPass (sampleRate, 1000, 1.0)); // in prepareToPlay

filter->processSamples (buffer.getWritePointer (i), buffer.getNumSamples());    // in processBlock

Caveat: have a separate instance for each channel, otherwise the state of the filter doesn’t match the signal and you get distortions when swapping the channel / each block.

Version b)
Use an IIRFilterAudioSource, should be straight forward as well

HTH

2 Likes