diff --git a/Audio/src/DSP.cpp b/Audio/src/DSP.cpp index 7c6381a39..34004100f 100644 --- a/Audio/src/DSP.cpp +++ b/Audio/src/DSP.cpp @@ -305,6 +305,11 @@ void RetriggerDSP::Process(float* out, uint32 numSamples) int32 pcmStartSample = (double)lastTimingPoint * ((double)audioBase->GetSampleRate() / 1000.0); int32 baseStartRepeat = (double)lastTimingPoint * ((double)audio->GetSampleRate() / 1000.0); + // Offset between the start of the effect hold and the nearest subdivision of this retrigger's updatePeriod. + int32 startResetOffset = (m_resetDuration > 0) ? + startSample - (startSample / (int)m_resetDuration) * m_resetDuration : + 0; + for(uint32 i = 0; i < numSamples; i++) { if(nowSample + i < startSample) @@ -316,7 +321,7 @@ void RetriggerDSP::Process(float* out, uint32 numSamples) if (m_resetDuration > 0) { startOffset = (nowSample + i - baseStartRepeat) / (int)m_resetDuration; - startOffset = startOffset * m_resetDuration * rateMult; + startOffset = (startOffset * m_resetDuration + startResetOffset) * rateMult; } else {