diff --git a/modules/juce_dsp/processors/juce_IIRFilter.h b/modules/juce_dsp/processors/juce_IIRFilter.h index 49f6fd63c9..23bffa8144 100644 --- a/modules/juce_dsp/processors/juce_IIRFilter.h +++ b/modules/juce_dsp/processors/juce_IIRFilter.h @@ -86,7 +86,13 @@ namespace IIR Note that this clears the processing state, but the type of filter and its coefficients aren't changed. */ - void reset(); + void reset() { reset (SampleType {0}); } + + /** Resets the filter's processing pipeline to a specific value. + + See @reset + */ + void reset (SampleType resetToValue); //============================================================================== /** Called before processing starts. */ diff --git a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h index a4939483ee..e7e620e80a 100644 --- a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h +++ b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h @@ -61,7 +61,7 @@ Filter::Filter (Coefficients::NumericTyp } template -void Filter::reset() +void Filter::reset (SampleType resetToValue) { auto newOrder = coefficients->getFilterOrder(); @@ -73,7 +73,7 @@ void Filter::reset() } for (size_t i = 0; i < order; ++i) - state[i] = SampleType {0}; + state[i] = resetToValue; } template