Hi everybody,
I am using designIIRLowpassHighOrderButterworthMethod and designIIRHighpassHighOrderButterworthMethod filters.
using filterDuplicator = juce::dsp::ProcessorDuplicator<juce::dsp::IIR::Filter<float>, juce::dsp::IIR::Coefficients<float>>;
using filterChain = juce::dsp::ProcessorChain<filterDuplicator, filterDuplicator>;
// Low cutoff filter is a High Pass Filter
filterChain lowCutoffFilter;
// High cutoff filter is a Low Pass Filter
filterChain highCutoffFilter;
and here are my update funstions:
**void** FilterPlugin ::updateLowCutoffFilter ( **float** cutoffFrequency)
{
ReferenceCountedArray<juce::dsp::IIR::Coefficients< **float** >> lowCutoffFilterCoeffArray =
juce::dsp::FilterDesign< **float** >::designIIRHighpassHighOrderButterworthMethod (cutoffFrequency, spec.sampleRate, 3);
*lowCutoffFilter.get<0>().state = *lowCutoffFilterCoeffArray.getObjectPointerUnchecked (0);
*lowCutoffFilter.get<1>().state = *lowCutoffFilterCoeffArray.getObjectPointerUnchecked (1);
lowCutoffFilter.prepare (spec);
lowCutoffFilter.reset();
}
/** Update high cutoff filter center frequency
**@param** cutOffFrequency frequency at 3dB
*/
**void** FilterPlugin::updateHighCutoffFilter ( **float** cutoffFrequency)
{
ReferenceCountedArray<juce::dsp::IIR::Coefficients< **float** >> highCutoffFilterCoeffArray =
juce::dsp::FilterDesign< **float** >::designIIRLowpassHighOrderButterworthMethod (cutoffFrequency, spec.sampleRate, 3);
*highCutoffFilter.get<0>().state = *highCutoffFilterCoeffArray.getObjectPointerUnchecked (0);
*highCutoffFilter.get<1>().state = *highCutoffFilterCoeffArray.getObjectPointerUnchecked (1);
highCutoffFilter.prepare (spec);
highCutoffFilter.reset();
}
I am updating the filters in parameterChanged method but i have a small but annoying issue.
When i try to rotate the knobs and change the cutoff frequencies, it creates bumps and damage the sound.
https://drive.google.com/drive/folders/1r_jqnLmDU0VjZiukxnwhDWvMaRkfM9he?usp=sharing
I put a video that shows that it does when i try to rotate the knobs. Is there any body else had the same issue here?