[SCM] calf/master: + Compressor: simple deesser mode (without lots of control)

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:39:16 UTC 2013


The following commit has been merged in the master branch:
commit e97ad7a7aa0df12aadd43ec37fdb9da71a081c83
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Sun Feb 1 19:15:11 2009 +0000

    + Compressor: simple deesser mode (without lots of control)

diff --git a/gui/gui-compressor.xml b/gui/gui-compressor.xml
index 4806de6..ef6f477 100644
--- a/gui/gui-compressor.xml
+++ b/gui/gui-compressor.xml
@@ -14,7 +14,7 @@
         </vbox>
     	<vbox expand="0">
              <label param="aweighting"/>
-             <align><toggle param="aweighting"/></align>
+             <combo param="aweighting"/>
         </vbox>
     </hbox>
     <if cond="directlink">
diff --git a/src/calf/metadata.h b/src/calf/metadata.h
index c4575b5..16104ce 100644
--- a/src/calf/metadata.h
+++ b/src/calf/metadata.h
@@ -107,7 +107,8 @@ struct monosynth_metadata: public plugin_metadata<monosynth_metadata>
 struct compressor_metadata: public plugin_metadata<compressor_metadata>
 {
     enum { in_count = 2, out_count = 2, support_midi = false, require_midi = false, rt_capable = true };
-    enum { param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_aweighting, param_compression, param_peak, param_clip, param_bypass, param_count };
+    enum { param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_aweighting, param_compression, param_peak, param_clip, param_bypass, // param_freq, param_bw, 
+        param_count };
     PLUGIN_NAME_ID_LABEL("compressor", "compressor", "Compressor")
 };
 
diff --git a/src/calf/modules.h b/src/calf/modules.h
index 3366196..7e3ea04 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -793,6 +793,7 @@ private:
     int last_generation;
     uint32_t clip;
     aweighter awL, awR;
+    biquad_d2<float> bpL, bpR;
 public:
     float *ins[in_count];
     float *outs[out_count];
diff --git a/src/modules.cpp b/src/modules.cpp
index 9cf0299..430dde6 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -210,6 +210,7 @@ CALF_PORT_NAMES(compressor) = {"In L", "In R", "Out L", "Out R"};
 
 const char *compressor_detection_names[] = { "RMS", "Peak" };
 const char *compressor_stereo_link_names[] = { "Average", "Maximum" };
+const char *compressor_weighting_names[] = { "Normal", "A-weighted", "Deesser (low)", "Deesser (med)", "Deesser (high)" };
 
 CALF_PORT_PROPS(compressor) = {
     { 0.125,      0.000976563, 1,    0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold", "Threshold" },
@@ -220,11 +221,13 @@ CALF_PORT_PROPS(compressor) = {
     { 2.828427125,      1,  8,   0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee", "Knee" },
     { 0,      0,  1,   0, PF_ENUM | PF_CTL_COMBO, compressor_detection_names, "detection", "Detection" },
     { 0,      0,  1,   0, PF_ENUM | PF_CTL_COMBO, compressor_stereo_link_names, "stereo_link", "Stereo Link" },
-    { 0,      0,  1,   0, PF_BOOL | PF_CTL_TOGGLE, NULL, "aweighting", "A-weighting" },
+    { 0,      0,  4,   0, PF_ENUM | PF_CTL_COMBO, compressor_weighting_names, "aweighting", "Weighting" },
     { 0, 0.03125, 1,    0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression", "Compression" },
     { 0,      0,  1,    0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "peak", "Peak Output" },
     { 0,      0,  1,    0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip", "0dB" },
-    { 0,      0,  1,    0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" }
+    { 0,      0,  1,    0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
+    // { 2000,      10,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "deess_freq", "Frequency" },
+    // { 0.707,  0.707,   32,    0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "deess_res", "Q" },
 };
 
 CALF_PLUGIN_INFO(compressor) = { 0x8502, "Compressor", "Calf Compressor", "Thor Harald Johansen", calf_plugins::calf_copyright_info, "CompressorPlugin" };
diff --git a/src/modules_dsp.cpp b/src/modules_dsp.cpp
index 5ee5bfa..a2344bb 100644
--- a/src/modules_dsp.cpp
+++ b/src/modules_dsp.cpp
@@ -527,7 +527,7 @@ uint32_t compressor_audio_module::process(uint32_t offset, uint32_t numsamples,
 
     bool rms = *params[param_detection] == 0;
     bool average = *params[param_stereo_link] == 0;
-    bool aweighting = *params[param_aweighting] > 0.5f;
+    int aweighting = fastf2i_drm(*params[param_aweighting]);
     float linThreshold = *params[param_threshold];
     ratio = *params[param_ratio];
     float attack = *params[param_attack];
@@ -546,6 +546,14 @@ uint32_t compressor_audio_module::process(uint32_t offset, uint32_t numsamples,
     kneeStart = log(linKneeStart);
     kneeStop = log(linKneeStop);
     compressedKneeStop = (kneeStop - threshold) / ratio + threshold;
+    
+    if (aweighting >= 2)
+    {
+        bpL.set_highshelf_rbj(5000, 0.707, 8 + 7 * (aweighting - 2), srate);
+        bpR.copy_coeffs(bpL);
+        bpL.sanitize();
+        bpR.sanitize();
+    }
 
     numsamples += offset;
     
@@ -559,10 +567,14 @@ uint32_t compressor_audio_module::process(uint32_t offset, uint32_t numsamples,
         float left = ins[0][offset];
         float right = ins[1][offset];
         
-        if(aweighting) {
+        if(aweighting == 1) {
             left = awL.process(left);
             right = awR.process(right);
         }
+        else if(aweighting >= 2) {
+            left = bpL.process(left);
+            right = bpR.process(right);
+        }
         
         float absample = average ? (fabs(left) + fabs(right)) * 0.5f : std::max(fabs(left), fabs(right));
         if(rms) absample *= absample;

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list