[SCM] calf/master: + Filter: make dB gain independent of filter order

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:38:30 UTC 2013


The following commit has been merged in the master branch:
commit 387980eed69ede3ab1997987c117d8278c136650
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Sun Nov 16 20:22:54 2008 +0000

    + Filter: make dB gain independent of filter order

diff --git a/src/calf/modules.h b/src/calf/modules.h
index 8781d42..7a99863 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -262,11 +262,11 @@ public:
         int mode = (int)*params[par_mode];
         // printf("freq = %f q = %f mode = %d\n", freq, q, mode);
         if (mode < 3) {
-            left[0].set_lp_rbj(freq, q, srate);
             order = mode + 1;
+            left[0].set_lp_rbj(freq, pow(q, 1.0 / order), srate);
         } else {
-            left[0].set_hp_rbj(freq, q, srate);
             order = mode - 2;
+            left[0].set_hp_rbj(freq, pow(q, 1.0 / order), srate);
         }
         // XXXKF this is highly inefficient and should be replaced as soon as I have fast f2i in primitives.h
         int inertia = dsp::fastf2i_drm(*params[par_inertia]);
diff --git a/src/modules.cpp b/src/modules.cpp
index 065a080..5335363 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -87,16 +87,16 @@ CALF_PORT_NAMES(filter) = {"In L", "In R", "Out L", "Out R"};
 
 const char *filter_choices[] = {
     "12dB/oct Lowpass",
-    "24dB/oct Lowpass (2xRes)",
-    "36dB/oct Lowpass (3xRes)",
+    "24dB/oct Lowpass",
+    "36dB/oct Lowpass",
     "12dB/oct Highpass",
-    "24dB/oct Highpass (2xRes)",
-    "36dB/oct Highpass (3xRes)",
+    "24dB/oct Highpass",
+    "36dB/oct Highpass",
 };
 
 CALF_PORT_PROPS(filter) = {
     { 2000,      10,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq", "Frequency" },
-    { 0.707,  0.707,   20,    0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "res", "Resonance" },
+    { 0.707,  0.707,   32,    0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "res", "Resonance" },
     { 0,          0,    5,    1, PF_ENUM | PF_CTL_COMBO, filter_choices, "mode", "Mode" },
     { 20,         5,  100,    20, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "inertia", "Inertia"},
 };

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list