diff --git a/modules/juce_dsp/processors/juce_IIRFilter.h b/modules/juce_dsp/processors/juce_IIRFilter.h index 1c2ca8b7ff..82203dc49f 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 daadd09c79..55b3189087 100644 --- a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h +++ b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h @@ -60,7 +60,7 @@ Filter::Filter (Coefficients::NumericTyp } template -void Filter::reset() +void Filter::reset (SampleType resetToValue) { auto newOrder = coefficients->getFilterOrder(); @@ -72,7 +72,7 @@ void Filter::reset() } for (size_t i = 0; i < order; ++i) - state[i] = SampleType {0}; + state[i] = resetToValue; } template