mirror of
https://github.com/AxioDL/amuse.git
synced 2025-12-08 21:17:49 +00:00
Support for effect sample-rate changes
This commit is contained in:
@@ -10,8 +10,6 @@ namespace amuse
|
||||
template <typename T>
|
||||
EffectDelayImp<T>::EffectDelayImp(uint32_t initDelay, uint32_t initFeedback,
|
||||
uint32_t initOutput, double sampleRate)
|
||||
: m_sampsPerMs(std::ceil(sampleRate / 1000.0)),
|
||||
m_blockSamples(m_sampsPerMs * 5)
|
||||
{
|
||||
initDelay = clamp(10u, initDelay, 5000u);
|
||||
initFeedback = clamp(0u, initFeedback, 100u);
|
||||
@@ -24,6 +22,15 @@ EffectDelayImp<T>::EffectDelayImp(uint32_t initDelay, uint32_t initFeedback,
|
||||
x54_output[i] = initOutput;
|
||||
}
|
||||
|
||||
_setup(sampleRate);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void EffectDelayImp<T>::_setup(double sampleRate)
|
||||
{
|
||||
m_sampsPerMs = std::ceil(sampleRate / 1000.0);
|
||||
m_blockSamples = m_sampsPerMs * 5;
|
||||
|
||||
_update();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user