Limit gain reduction of a-expander to 160 dB in order to ...
authorJohannes Mueller <github@johannes-mueller.org>
Mon, 7 Aug 2017 12:02:33 +0000 (14:02 +0200)
committerJohannes Mueller <github@johannes-mueller.org>
Sat, 12 May 2018 17:49:18 +0000 (19:49 +0200)
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

index d3a29a689c4972aba4a6c12260dbbe93fdc77761..0b11f2ae489107e3d07cd6ac86f89677c10cb23c 100644 (file)
@@ -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) {