Skip to content

Commit

Permalink
Clamp gating values
Browse files Browse the repository at this point in the history
  • Loading branch information
ASleepyCat committed May 13, 2021
1 parent c5c4bc8 commit fa3955c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Audio/src/DSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit fa3955c

Please sign in to comment.