0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 19:23:51 +01:00

limit the gain

This commit is contained in:
2025-07-08 23:13:50 +02:00
parent d60128df75
commit d78e82122a

View File

@@ -51,6 +51,7 @@ float bs412_compress(BS412Compressor* mpx, float sample) {
mpx->gain = mpx->gain * mpx->attack + (1.0f - mpx->attack) * gain_target;
else
mpx->gain = mpx->gain * mpx->release + (1.0f - mpx->release) * gain_target;
mpx->gain = fminf(1.0f, mpx->gain);
return fminf(sample*mpx->gain, dbr_to_deviation(mpx->target*1.1f));
}