diff --git a/src/deluge/dsp/filter/hpladder.cpp b/src/deluge/dsp/filter/hpladder.cpp index d8426c59e2..a71623e82f 100644 --- a/src/deluge/dsp/filter/hpladder.cpp +++ b/src/deluge/dsp/filter/hpladder.cpp @@ -100,10 +100,10 @@ void HpLadderFilter::doFilterStereo(q31_t* startSample, q31_t* endSample) { // Only saturate / anti-alias if lots of resonance if (hpfProcessedResonance > 900000000) { // 890551738 - a = getTanHAntialiased(a, &hpfLastWorkingValue, 1); + a = getTanHAntialiased(a, &state.hpfLastWorkingValue, 1); } else { - hpfLastWorkingValue = (uint32_t)lshiftAndSaturate<2>(a) + 2147483648u; + state.hpfLastWorkingValue = (uint32_t)lshiftAndSaturate<2>(a) + 2147483648u; if (hpfProcessedResonance > 750000000) { // 400551738 a = getTanHUnknown(a, 2); } diff --git a/src/deluge/dsp/filter/hpladder.h b/src/deluge/dsp/filter/hpladder.h index 1512e38c67..e97ed31065 100644 --- a/src/deluge/dsp/filter/hpladder.h +++ b/src/deluge/dsp/filter/hpladder.h @@ -41,7 +41,7 @@ class HpLadderFilter : public Filter { BasicFilterComponent hpfHPF1; BasicFilterComponent hpfLPF1; BasicFilterComponent hpfHPF3; - + uint32_t hpfLastWorkingValue; void reset() { hpfHPF1.reset(); hpfLPF1.reset(); @@ -50,8 +50,6 @@ class HpLadderFilter : public Filter { }; [[gnu::always_inline]] inline q31_t doHPF(q31_t input, HPLadderState& state); - //config - uint32_t hpfLastWorkingValue; bool hpfDoingAntialiasingNow; int32_t hpfDivideByTotalMoveabilityLastTime; int32_t hpfDivideByProcessedResonanceLastTime;