Fix LOMM crossovers (#7026)

This commit is contained in:
Lost Robot
2023-12-22 13:58:02 -08:00
committed by GitHub
parent f3d3a1421e
commit 3aefe7b3d3
2 changed files with 10 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ LOMMEffect::LOMMEffect(Model* parent, const Descriptor::SubPluginFeatures::Key*
m_lp2(m_sampleRate),
m_hp1(m_sampleRate),
m_hp2(m_sampleRate),
m_ap(m_sampleRate),
m_needsUpdate(true),
m_coeffPrecalc(-0.05),
m_crestTimeConst(0.999),
@@ -67,6 +68,8 @@ LOMMEffect::LOMMEffect(Model* parent, const Descriptor::SubPluginFeatures::Key*
m_yL[1][0] = m_yL[1][1] = LOMM_MIN_FLOOR;
m_yL[2][0] = m_yL[2][1] = LOMM_MIN_FLOOR;
m_ap.setFilterType(BasicFilters<2>::FilterType::AllPass);
connect(Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, SLOT(changeSampleRate()));
emit changeSampleRate();
}
@@ -117,6 +120,7 @@ bool LOMMEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames)
{
m_lp1.setLowpass(m_lommControls.m_split1Model.value());
m_hp1.setHighpass(m_lommControls.m_split1Model.value());
m_ap.calcFilterCoeffs(m_lommControls.m_split1Model.value(), 0.70710678118);
}
if (m_needsUpdate || m_lommControls.m_split2Model.isValueChanged())
{
@@ -224,9 +228,11 @@ bool LOMMEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames)
float crestFactorValTemp = ((m_crestFactorVal[i] - LOMM_AUTO_TIME_ADJUST) * autoTime) + LOMM_AUTO_TIME_ADJUST;
// Crossover filters
bands[0][i] = m_hp1.update(s[i], i);
bands[1][i] = m_hp2.update(m_lp1.update(s[i], i), i);
bands[2][i] = m_lp2.update(s[i], i);
bands[1][i] = m_hp2.update(s[i], i);
bands[0][i] = m_hp1.update(bands[1][i], i);
bands[1][i] = m_lp1.update(bands[1][i], i);
bands[2][i] = m_ap.update(bands[2][i], i);
if (!split1Enabled)
{

View File

@@ -73,6 +73,8 @@ private:
StereoLinkwitzRiley m_hp1;
StereoLinkwitzRiley m_hp2;
BasicFilters<2> m_ap;
bool m_needsUpdate;
float m_coeffPrecalc;