From bdc8537f3f134865010687e70ff8a94139be4dd3 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 11 Jan 2023 15:21:18 +0100 Subject: [PATCH] Add explicit .max(f32::EPSILON) back in SC `util::db_to_gain_fast()` doesn't snap to 0, but for low enough values it will still become 0 eventually. --- plugins/spectral_compressor/src/compressor_bank.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/spectral_compressor/src/compressor_bank.rs b/plugins/spectral_compressor/src/compressor_bank.rs index ef728157..ff762a3d 100644 --- a/plugins/spectral_compressor/src/compressor_bank.rs +++ b/plugins/spectral_compressor/src/compressor_bank.rs @@ -881,9 +881,9 @@ impl CompressorBank { // This threshold must never reach zero as it's used in divisions to get a gain ratio // above the threshold - *threshold = util::db_to_gain_fast(threshold_db); - *knee_start = util::db_to_gain_fast(knee_start_db); - *knee_end = util::db_to_gain_fast(knee_end_db); + *threshold = util::db_to_gain_fast(threshold_db).max(f32::EPSILON); + *knee_start = util::db_to_gain_fast(knee_start_db).max(f32::EPSILON); + *knee_end = util::db_to_gain_fast(knee_end_db).max(f32::EPSILON); } }