When using dsp::IIR::Filter<>
with SIMDRegister<float>
as SampleType, calling the reset()
method results in a very much different and also fatal behavior than using float
as SampleType.
/** Resets the filter's processing pipeline, ready to start a new stream of data.
Note that this clears the processing state, but the type of filter and
its coefficients aren't changed.
*/
void reset() { reset (SampleType {}); }
When using float
: SampleType{}
will return 0.0f, however with SIMDRegister<float>
it returns just random values:
(juce::dsp::SIMDRegister<float>) $0 = {
value = (2.75261417E+19, 0.0000000000000000000000000000000000000000459163468, 0.0000000000000000000000000000000000000203168547, 0.00000000000000000000000000000000000000000000140129846)
}
So the internal state would possibly set to very high values (2.75261417E+19).
Simple workaround would be just calling reset(SIMDRegister<float>(0.0f));
However, I guess fixing that would be better and more save (especially as the documentation says it clears the processing state). Maybe something like that?
void reset() { reset (SampleType {0.0}); }