From 46aa204eb8e7d322ab16a6bb41e9abafa27cd38e Mon Sep 17 00:00:00 2001 From: Johannes Mueller Date: Mon, 7 Aug 2017 14:02:33 +0200 Subject: [PATCH] Limit gain reduction of a-expander to 160 dB in order to ... improve release behavior. This slows down the release after events like single snare hits as, the gain reduction only releases to 160 dB rather than to inf. --- libs/plugins/a-exp.lv2/a-exp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/plugins/a-exp.lv2/a-exp.c b/libs/plugins/a-exp.lv2/a-exp.c index d3a29a689c..0b11f2ae48 100644 --- a/libs/plugins/a-exp.lv2/a-exp.c +++ b/libs/plugins/a-exp.lv2/a-exp.c @@ -372,6 +372,10 @@ run_mono(LV2_Handle instance, uint32_t n_samples) current_gainr = Lxg - Lyg; + if (current_gainr > 160.f) { + current_gainr = 160.f; + } + if (current_gainr > old_gainr) { current_gainr = release_coeff*old_gainr + (1.f-release_coeff)*current_gainr; } else if (current_gainr < old_gainr) { @@ -541,6 +545,10 @@ run_stereo(LV2_Handle instance, uint32_t n_samples) current_gainr = Lxg - Lyg; + if (current_gainr > 160.f) { + current_gainr = 160.f; + } + if (current_gainr > old_gainr) { current_gainr = release_coeff*old_gainr + (1.f-release_coeff)*current_gainr; } else if (current_gainr < old_gainr) {