This commit is contained in:
AlexandreRouma
2023-02-15 15:39:34 +01:00
parent 7cfc30ee6e
commit d5a9538d0c
2 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,9 @@ namespace dsp::loop {
amp = (inAmp > amp) ? ((amp * _invAttack) + (inAmp * _attack)) : ((amp * _invDecay) + (inAmp * _decay));
gain = std::min<float>(_setPoint / amp, _maxGain);
}
else {
gain = 1.0f;
}
// If clipping is detected look ahead and correct
if (inAmp*gain > _maxOutputAmp) {