[SCM] calf/master: multiband compressor with 36dB filters

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:40:41 UTC 2013


The following commit has been merged in the master branch:
commit 34b59f61feca683a3a40087d79e92b4b1023430d
Author: Markus Schmidt <schmidt at boomshop.net>
Date:   Thu Dec 1 11:38:08 2011 +0100

    multiband compressor with 36dB filters

diff --git a/gui/gui-multibandcompressor.xml b/gui/gui-multibandcompressor.xml
index 4cc95bb..e7dc6b8 100644
--- a/gui/gui-multibandcompressor.xml
+++ b/gui/gui-multibandcompressor.xml
@@ -17,57 +17,65 @@
             <led param="clip_inR" expand="0" fill="0" />
             <label text="0dB" expand="0" fill="0" />
         </vbox>
-        <table rows="3" cols="2" attach-x="4" attach-y="0" spacing="0" border="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
-            <knob param="freq0" attach-x="0" attach-y="0" border="0" expand="0" fill="0" expand-x="0" fill-x="0" />
-            <vbox attach-x="1" attach-y="0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
-                <label param="freq0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
-                <value param="freq0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
-            </vbox>
-            <hbox  attach-x="0" attach-y="1" border="0" fill-x="0">
-                <knob param="sep0" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-                <label param="sep0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-            </hbox>
-            <value param="sep0" attach-x="1" attach-y="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
-            <hbox  attach-x="0" attach-y="2" border="0" fill-x="0">
-                <knob param="q0" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-                <label param="q0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-            </hbox>
-            <value param="q0" attach-x="1" attach-y="2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
-        </table>
-        <table rows="3" cols="2" attach-x="5" attach-y="0" spacing="0" border="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
-            <knob param="freq1" attach-x="0" attach-y="0" border="0" expand="0" fill="0" expand-x="0" fill-x="0" />
-            <vbox attach-x="1" attach-y="0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
-                <label param="freq1" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
-                <value param="freq1" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
-            </vbox>
-            <hbox  attach-x="0" attach-y="1" border="0" fill-x="0">
-                <knob param="sep1" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-                <label param="sep1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+        <vbox attach-x="4" attach-y="0">
+            <hbox>
+                <table rows="3" cols="2" attach-x="4" attach-y="0" spacing="0" border="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
+                    <knob param="freq0" attach-x="0" attach-y="0" border="0" expand="0" fill="0" expand-x="0" fill-x="0" />
+                    <vbox attach-x="1" attach-y="0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
+                        <label param="freq0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
+                        <value param="freq0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
+                    </vbox>
+                    <hbox  attach-x="0" attach-y="1" border="0" fill-x="0">
+                        <knob param="sep0" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                        <label param="sep0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                    </hbox>
+                    <value param="sep0" attach-x="1" attach-y="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
+                    <hbox  attach-x="0" attach-y="2" border="0" fill-x="0">
+                        <knob param="q0" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                        <label param="q0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                    </hbox>
+                    <value param="q0" attach-x="1" attach-y="2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
+                </table>
+                <table rows="3" cols="2" attach-x="5" attach-y="0" spacing="0" border="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
+                    <knob param="freq1" attach-x="0" attach-y="0" border="0" expand="0" fill="0" expand-x="0" fill-x="0" />
+                    <vbox attach-x="1" attach-y="0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
+                        <label param="freq1" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
+                        <value param="freq1" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
+                    </vbox>
+                    <hbox  attach-x="0" attach-y="1" border="0" fill-x="0">
+                        <knob param="sep1" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                        <label param="sep1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                    </hbox>
+                    <value param="sep1" attach-x="1" attach-y="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
+                    <hbox  attach-x="0" attach-y="2" border="0" fill-x="0">
+                        <knob param="q1" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                        <label param="q1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                    </hbox>
+                    <value param="q1" attach-x="1" attach-y="2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
+                </table>
+                <table rows="3" cols="2" attach-x="6" attach-y="0" spacing="0" border="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
+                    <knob param="freq2" attach-x="0" attach-y="0" border="0" expand="0" fill="0" expand-x="0" fill-x="0" />
+                    <vbox attach-x="1" attach-y="0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
+                        <label param="freq2" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
+                        <value param="freq2" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
+                    </vbox>
+                    <hbox  attach-x="0" attach-y="1" border="0" fill-x="0">
+                        <knob param="sep2" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                        <label param="sep2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                    </hbox>
+                    <value param="sep2" attach-x="1" attach-y="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
+                    <hbox  attach-x="0" attach-y="2" border="0" fill-x="0">
+                        <knob param="q2" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                        <label param="q2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+                    </hbox>
+                    <value param="q2" attach-x="1" attach-y="2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
+                </table>
             </hbox>
-            <value param="sep1" attach-x="1" attach-y="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
-            <hbox  attach-x="0" attach-y="2" border="0" fill-x="0">
-                <knob param="q1" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-                <label param="q1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
+            <hbox>
+                <label param="mode" />
+                <combo param="mode" />
             </hbox>
-            <value param="q1" attach-x="1" attach-y="2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
-        </table>
-        <table rows="3" cols="2" attach-x="6" attach-y="0" spacing="0" border="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
-            <knob param="freq2" attach-x="0" attach-y="0" border="0" expand="0" fill="0" expand-x="0" fill-x="0" />
-            <vbox attach-x="1" attach-y="0" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0">
-                <label param="freq2" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
-                <value param="freq2" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" align-x="0.0" />
-            </vbox>
-            <hbox  attach-x="0" attach-y="1" border="0" fill-x="0">
-                <knob param="sep2" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-                <label param="sep2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-            </hbox>
-            <value param="sep2" attach-x="1" attach-y="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
-            <hbox  attach-x="0" attach-y="2" border="0" fill-x="0">
-                <knob param="q2" type="1" size="1" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-                <label param="q2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" />
-            </hbox>
-            <value param="q2" attach-x="1" attach-y="2" border="0" expand="0" fill="0" expand-y="0" fill-y="0" expand-x="0" fill-x="0" width="2" align-x="0.0" />
-        </table>
+        </vbox>
         <vbox shrink-x="1" expand-x="1" fill-x="1" expand="0" fill="0" attach-x="7" attach-y="0" pad-y="24">
             <label param="meter_outL" />
             <vumeter param="meter_outL" position="2" mode="0" hold="1.5" falloff="2.5" shrink-y="0" />
diff --git a/src/calf/metadata.h b/src/calf/metadata.h
index 0c496a3..adcb154 100644
--- a/src/calf/metadata.h
+++ b/src/calf/metadata.h
@@ -184,6 +184,7 @@ struct multibandcompressor_metadata: public plugin_metadata<multibandcompressor_
            param_freq0, param_freq1, param_freq2,
            param_sep0, param_sep1, param_sep2,
            param_q0, param_q1, param_q2,
+           param_mode,
            param_threshold0, param_ratio0, param_attack0, param_release0, param_makeup0, param_knee0,
            param_detection0, param_compression0, param_output0, param_bypass0, param_solo0,
            param_threshold1, param_ratio1, param_attack1, param_release1, param_makeup1, param_knee1,
diff --git a/src/calf/modules_comp.h b/src/calf/modules_comp.h
index 15ba09e..06763b0 100644
--- a/src/calf/modules_comp.h
+++ b/src/calf/modules_comp.h
@@ -170,8 +170,9 @@ private:
     uint32_t clip_inL, clip_inR, clip_outL, clip_outR;
     float meter_inL, meter_inR, meter_outL, meter_outR;
     gain_reduction_audio_module strip[strips];
-    dsp::biquad_d2<float> lpL0, lpR0, lpL1, lpR1, lpL2, lpR2, hpL0, hpR0, hpL1, hpR1, hpL2, hpR2;
+    dsp::biquad_d2<float> lpL[3][3], lpR[3][3], hpL[3][3], hpR[3][3];
     float freq_old[strips - 1], sep_old[strips - 1], q_old[strips - 1];
+    int mode, mode_old;
 public:
     uint32_t srate;
     bool is_active;
diff --git a/src/metadata.cpp b/src/metadata.cpp
index ae0ec72..7da140e 100644
--- a/src/metadata.cpp
+++ b/src/metadata.cpp
@@ -297,6 +297,7 @@ CALF_PLUGIN_INFO(sidechaincompressor) = { 0x8517, "Sidechaincompressor", "Calf S
 CALF_PORT_NAMES(multibandcompressor) = {"In L", "In R", "Out L", "Out R"};
 
 const char *multibandcompressor_detection_names[] = { "RMS", "Peak" };
+const char *multibandcompressor_filter_choices[] = { "12dB", "36dB"};
 
 CALF_PORT_PROPS(multibandcompressor) = {
     { 0,           0,           1,     0,  PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
@@ -319,10 +320,11 @@ CALF_PORT_PROPS(multibandcompressor) = {
     { -0.17,      -0.5,         0.5,   0,  PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep1", "S2" },
     { -0.17,      -0.5,         0.5,   0,  PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep2", "S3" },
     
-    { 0.895025,    0.25,        4,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q0", "Q1" },
-    { 0.895025,    0.25,        4,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q1", "Q2" },
-    { 0.895025,    0.25,        4,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q2", "Q3" },
+    { 0.7762471166286917,    0.25,        4,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q0", "Q1" },
+    { 0.7762471166286917,    0.25,        4,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q1", "Q2" },
+    { 0.7762471166286917,    0.25,        4,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q2", "Q3" },
     
+    { 1,      0,  1,    0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_filter_choices, "mode", "Filter Mode" },
     
     { 0.25,      0.000976563, 1,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold0", "Threshold 1" },
     { 2,           1,           20,    21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio0", "Ratio 1" },
diff --git a/src/modules_comp.cpp b/src/modules_comp.cpp
index de6e14b..7d15b2b 100644
--- a/src/modules_comp.cpp
+++ b/src/modules_comp.cpp
@@ -84,30 +84,58 @@ void multibandcompressor_audio_module::params_changed()
             *params[param_solo1] > 0.f ||
             *params[param_solo2] > 0.f ||
             *params[param_solo3] > 0.f) ? false : true;
+    int i;
+    int j1;
+    switch(mode) {
+        case 0:
+            j1 = 0;
+            break;
+        case 1:
+            j1 = 2;
+            break;
+    }
     // set the params of all filters
-    if(*params[param_freq0] != freq_old[0] or *params[param_sep0] != sep_old[0] or *params[param_q0] != q_old[0]) {
-        lpL0.set_lp_rbj((float)(*params[param_freq0] * (1 - *params[param_sep0])), *params[param_q0], (float)srate);
-        lpR0.copy_coeffs(lpL0);
-        hpL0.set_hp_rbj((float)(*params[param_freq0] * (1 + *params[param_sep0])), *params[param_q0], (float)srate);
-        hpR0.copy_coeffs(hpL0);
+    if(*params[param_freq0] != freq_old[0] or *params[param_sep0] != sep_old[0] or *params[param_q0] != q_old[0] or *params[param_mode] != mode_old) {
+        lpL[0][0].set_lp_rbj((float)(*params[param_freq0] * (1 - *params[param_sep0])), *params[param_q0], (float)srate);
+        hpL[0][0].set_hp_rbj((float)(*params[param_freq0] * (1 + *params[param_sep0])), *params[param_q0], (float)srate);
+        lpR[0][0].copy_coeffs(lpL[0][0]);
+        hpR[0][0].copy_coeffs(hpL[0][0]);
+        for(i = 1; i <= j1; i++) {
+            lpL[0][i].copy_coeffs(lpL[0][0]);
+            hpL[0][i].copy_coeffs(hpL[0][0]);
+            lpR[0][i].copy_coeffs(lpL[0][0]);
+            hpR[0][i].copy_coeffs(hpL[0][0]);
+        }
         freq_old[0] = *params[param_freq0];
         sep_old[0]  = *params[param_sep0];
         q_old[0]    = *params[param_q0];
     }
-    if(*params[param_freq1] != freq_old[1] or *params[param_sep1] != sep_old[1] or *params[param_q1] != q_old[1]) {
-        lpL1.set_lp_rbj((float)(*params[param_freq1] * (1 - *params[param_sep1])), *params[param_q1], (float)srate);
-        lpR1.copy_coeffs(lpL1);
-        hpL1.set_hp_rbj((float)(*params[param_freq1] * (1 + *params[param_sep1])), *params[param_q1], (float)srate);
-        hpR1.copy_coeffs(hpL1);
+    if(*params[param_freq1] != freq_old[1] or *params[param_sep1] != sep_old[1] or *params[param_q1] != q_old[1] or *params[param_mode] != mode_old) {
+        lpL[1][0].set_lp_rbj((float)(*params[param_freq1] * (1 - *params[param_sep1])), *params[param_q1], (float)srate);
+        hpL[1][0].set_hp_rbj((float)(*params[param_freq1] * (1 + *params[param_sep1])), *params[param_q1], (float)srate);
+        lpR[1][0].copy_coeffs(lpL[1][0]);
+        hpR[1][0].copy_coeffs(hpL[1][0]);
+        for(i = 1; i <= j1; i++) {
+            lpL[1][i].copy_coeffs(lpL[1][0]);
+            hpL[1][i].copy_coeffs(hpL[1][0]);
+            lpR[1][i].copy_coeffs(lpL[1][0]);
+            hpR[1][i].copy_coeffs(hpL[1][0]);
+        }
         freq_old[1] = *params[param_freq1];
         sep_old[1]  = *params[param_sep1];
         q_old[1]    = *params[param_q1];
     }
-    if(*params[param_freq2] != freq_old[2] or *params[param_sep2] != sep_old[2] or *params[param_q2] != q_old[2]) {
-        lpL2.set_lp_rbj((float)(*params[param_freq2] * (1 - *params[param_sep2])), *params[param_q2], (float)srate);
-        lpR2.copy_coeffs(lpL2);
-        hpL2.set_hp_rbj((float)(*params[param_freq2] * (1 + *params[param_sep2])), *params[param_q2], (float)srate);
-        hpR2.copy_coeffs(hpL2);
+    if(*params[param_freq2] != freq_old[2] or *params[param_sep2] != sep_old[2] or *params[param_q2] != q_old[2] or *params[param_mode] != mode_old) {
+        lpL[2][0].set_lp_rbj((float)(*params[param_freq2] * (1 - *params[param_sep2])), *params[param_q2], (float)srate);
+        hpL[2][0].set_hp_rbj((float)(*params[param_freq2] * (1 + *params[param_sep2])), *params[param_q2], (float)srate);
+        lpR[2][0].copy_coeffs(lpL[2][0]);
+        hpR[2][0].copy_coeffs(hpL[2][0]);
+        for(i = 1; i <= j1; i++) {
+            lpL[2][i].copy_coeffs(lpL[2][0]);
+            hpL[2][i].copy_coeffs(hpL[2][0]);
+            lpR[2][i].copy_coeffs(lpL[2][0]);
+            hpR[2][i].copy_coeffs(hpL[2][0]);
+        }
         freq_old[2] = *params[param_freq2];
         sep_old[2]  = *params[param_sep2];
         q_old[2]    = *params[param_q2];
@@ -184,6 +212,7 @@ uint32_t multibandcompressor_audio_module::process(uint32_t offset, uint32_t num
             // out vars
             float outL = 0.f;
             float outR = 0.f;
+            int j1;
             for (int i = 0; i < strips; i ++) {
                 // cycle trough strips
                 if (solo[i] || no_solo) {
@@ -191,40 +220,28 @@ uint32_t multibandcompressor_audio_module::process(uint32_t offset, uint32_t num
                     float left  = inL;
                     float right = inR;
                     // send trough filters
-                    switch (i) {
+                    switch(mode) {
                         case 0:
-                            left  = lpL0.process(left);
-                            right = lpR0.process(right);
-                            lpL0.sanitize();
-                            lpR0.sanitize();
+                            j1 = 0;
                             break;
                         case 1:
-                            left  = lpL1.process(left);
-                            right = lpR1.process(right);
-                            left  = hpL0.process(left);
-                            right = hpR0.process(right);
-                            lpL1.sanitize();
-                            lpR1.sanitize();
-                            hpL0.sanitize();
-                            hpR0.sanitize();
-                            break;
-                        case 2:
-                            left  = lpL2.process(left);
-                            right = lpR2.process(right);
-                            left  = hpL1.process(left);
-                            right = hpR1.process(right);
-                            lpL2.sanitize();
-                            lpR2.sanitize();
-                            hpL1.sanitize();
-                            hpR1.sanitize();
-                            break;
-                        case 3:
-                            left  = hpL2.process(left);
-                            right = hpR2.process(right);
-                            hpL2.sanitize();
-                            hpR2.sanitize();
+                            j1 = 2;
                             break;
                     }
+                    for (int j = 0; j <= j1; j++){
+                        if(i + 1 < strips) {
+                            left  = lpL[i][j].process(left);
+                            right = lpR[i][j].process(right);
+                            lpL[i][j].sanitize();
+                            lpR[i][j].sanitize();
+                        }
+                        if(i - 1 >= 0) {
+                            left  = hpL[i - 1][j].process(left);
+                            right = hpR[i - 1][j].process(right);
+                            hpL[i - 1][j].sanitize();
+                            hpR[i - 1][j].sanitize();
+                        }
+                    }
                     // process gain reduction
                     strip[i].process(left, right);
                     // sum up output
@@ -240,8 +257,16 @@ uint32_t multibandcompressor_audio_module::process(uint32_t offset, uint32_t num
             
             // even out filters gain reduction
             // 3dB - levelled manually (based on default sep and q settings)
-            outL *= 1.414213562;
-            outR *= 1.414213562;
+            switch(mode) {
+                case 0:
+                    outL *= 1.414213562;
+                    outR *= 1.414213562;
+                    break;
+                case 1:
+                    outL *= 0.88;
+                    outR *= 0.88;
+                    break;
+            }
             
             // out level
             outL *= *params[param_level_out];

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list