Skip to content

Commit

Permalink
fix high resonance collapsing to mono
Browse files Browse the repository at this point in the history
  • Loading branch information
m-m-adams committed Nov 9, 2023
1 parent c95ef24 commit 7e1d2fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/deluge/dsp/filter/hpladder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 1 addition & 3 deletions src/deluge/dsp/filter/hpladder.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class HpLadderFilter : public Filter<HpLadderFilter> {
BasicFilterComponent hpfHPF1;
BasicFilterComponent hpfLPF1;
BasicFilterComponent hpfHPF3;

uint32_t hpfLastWorkingValue;
void reset() {
hpfHPF1.reset();
hpfLPF1.reset();
Expand All @@ -50,8 +50,6 @@ class HpLadderFilter : public Filter<HpLadderFilter> {
};
[[gnu::always_inline]] inline q31_t doHPF(q31_t input, HPLadderState& state);

//config
uint32_t hpfLastWorkingValue;
bool hpfDoingAntialiasingNow;
int32_t hpfDivideByTotalMoveabilityLastTime;
int32_t hpfDivideByProcessedResonanceLastTime;
Expand Down

0 comments on commit 7e1d2fb

Please sign in to comment.