Add setSampleRate to BasicFilters and update LOMM allpass sample rate (#7048)
This commit is contained in:
@@ -328,6 +328,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void setSampleRate(const sample_rate_t sampleRate)
|
||||
{
|
||||
m_sampleRate = sampleRate;
|
||||
m_sampleRatio = 1.f / m_sampleRate;
|
||||
if (m_subFilter != nullptr)
|
||||
{
|
||||
m_subFilter->setSampleRate(m_sampleRate);
|
||||
}
|
||||
}
|
||||
|
||||
inline sample_t update( sample_t _in0, ch_cnt_t _chnl )
|
||||
{
|
||||
sample_t out;
|
||||
|
||||
@@ -81,6 +81,7 @@ void LOMMEffect::changeSampleRate()
|
||||
m_lp2.setSampleRate(m_sampleRate);
|
||||
m_hp1.setSampleRate(m_sampleRate);
|
||||
m_hp2.setSampleRate(m_sampleRate);
|
||||
m_ap.setSampleRate(m_sampleRate);
|
||||
|
||||
m_coeffPrecalc = -2.2f / (m_sampleRate * 0.001f);
|
||||
m_needsUpdate = true;
|
||||
@@ -98,16 +99,6 @@ void LOMMEffect::changeSampleRate()
|
||||
}
|
||||
}
|
||||
|
||||
void LOMMEffect::clearFilterHistories()
|
||||
{
|
||||
m_lp1.clearHistory();
|
||||
m_lp2.clearHistory();
|
||||
m_hp1.clearHistory();
|
||||
m_hp2.clearHistory();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool LOMMEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames)
|
||||
{
|
||||
|
||||
@@ -52,8 +52,6 @@ public:
|
||||
return &m_lommControls;
|
||||
}
|
||||
|
||||
void clearFilterHistories();
|
||||
|
||||
inline float msToCoeff(float ms)
|
||||
{
|
||||
return (ms == 0) ? 0 : exp(m_coeffPrecalc / ms);
|
||||
|
||||
Reference in New Issue
Block a user