[SCM] calf/master: + Compressor: Added crude support for 0 ms attack/release (0.05 ms = 0 ms)
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:38:03 UTC 2013
The following commit has been merged in the master branch:
commit 40d1edf3f398009519184edd84a6027513d33c77
Author: Thor Harald Johansen <thj at thj.no>
Date: Fri Oct 31 23:51:41 2008 +0100
+ Compressor: Added crude support for 0 ms attack/release (0.05 ms = 0 ms)
diff --git a/src/calf/modules_dev.h b/src/calf/modules_dev.h
index ade45f1..f2c4405 100644
--- a/src/calf/modules_dev.h
+++ b/src/calf/modules_dev.h
@@ -45,8 +45,10 @@ public:
numsamples += offset;
float threshold = *params[param_threshold];
float ratio = *params[param_ratio];
- float attack_coeff = 1.f / (*params[param_attack] * srate / 4000.f);
- float release_coeff = 1.f / (*params[param_release] * srate / 4000.f);
+ float attack = *params[param_attack];
+ float attack_coeff = attack == 0.05 ? 1 : std::min(1.f, 1.f / (attack * srate / 4000.f));
+ float release = *params[param_release];
+ float release_coeff = release == 0.05 ? 1 : std::min(1.f, 1.f / (release * srate / 4000.f));
float makeup = *params[param_makeup];
float knee = *params[param_knee];
diff --git a/src/modules.cpp b/src/modules.cpp
index 0b40b21..0a950a5 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -178,8 +178,8 @@ synth::ladspa_plugin_info multichorus_audio_module::plugin_info = { 0x8501, "Mul
parameter_properties compressor_audio_module::param_props[] = {
{ 1, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold", "Threshold" },
{ 1, 1, 100, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio", "Ratio" },
- { 10, 1, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack", "Attack" },
- { 100, 1, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release", "Release" },
+ { 10, 0.05, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack", "Attack" },
+ { 100, 0.05, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release", "Release" },
{ 1, 1, 12, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup", "Makeup Gain" },
{ 1, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee", "Knee" },
{ 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, NULL, "compression", "Compression" }
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list