Skip to content

Commit

Permalink
Clip signal at +/-4.0f
Browse files Browse the repository at this point in the history
Currently we shut out defunct signal values like inf/nan but we apart
from that we allow signals of any size. This will let large but short
shot noise through that can trigger especially reverb to dangerously
large sound levels even though they would pass largely unnoticed
without a feedback loop.
After testing for inf/nan we clamp the sound to +/-4.0f .
  • Loading branch information
zonkmachine committed Nov 21, 2017
1 parent 60d483c commit 178e342
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/MixHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ bool sanitize( sampleFrame * src, int frames )
src[f][c] = 0.0f;
found = true;
}
else
{
src[f][c] = qBound( -4.0f, src[f][c], 4.0f );
}
}
}
return found;
Expand Down

0 comments on commit 178e342

Please sign in to comment.