From fa3955c7ad9a0ca612a6af08477d98b037b7f4af Mon Sep 17 00:00:00 2001 From: ASleepyCat Date: Thu, 13 May 2021 22:35:59 +1000 Subject: [PATCH] Clamp gating values --- Audio/src/DSP.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Audio/src/DSP.cpp b/Audio/src/DSP.cpp index b4913e182..02ed79688 100644 --- a/Audio/src/DSP.cpp +++ b/Audio/src/DSP.cpp @@ -217,6 +217,7 @@ void GateDSP::SetLength(double length) } void GateDSP::SetGating(float gating) { + gating = Math::Clamp(gating, 0.f, 1.f); float flength = (float)m_length; m_gating = gating; m_halfway = (uint32)(flength * gating); @@ -335,6 +336,7 @@ void RetriggerDSP::SetResetDuration(uint32 resetDuration) } void RetriggerDSP::SetGating(float gating) { + gating = Math::Clamp(gating, 0.f, 1.f); m_gating = gating; m_gateLength = (uint32)((float)m_length * gating); }