[SCM] calf/master: + Compressor: Made some adjustments to Attack/Release ranges.
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:38:05 UTC 2013
The following commit has been merged in the master branch:
commit 094abee01733f974a9ab0d7019fb925eb142a7a6
Author: Thor Harald Johansen <thj at thj.no>
Date: Sat Nov 1 00:42:09 2008 +0100
+ Compressor: Made some adjustments to Attack/Release ranges.
diff --git a/src/calf/modules_dev.h b/src/calf/modules_dev.h
index f2c4405..996c7b6 100644
--- a/src/calf/modules_dev.h
+++ b/src/calf/modules_dev.h
@@ -46,9 +46,9 @@ public:
float threshold = *params[param_threshold];
float ratio = *params[param_ratio];
float attack = *params[param_attack];
- float attack_coeff = attack == 0.05 ? 1 : std::min(1.f, 1.f / (attack * srate / 4000.f));
+ float attack_coeff = 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 release_coeff = std::min(1.f, 1.f / (release * srate / 4000.f));
float makeup = *params[param_makeup];
float knee = *params[param_knee];
@@ -60,13 +60,19 @@ public:
float asample = std::max(fabs(ins[0][offset]), fabs(ins[1][offset]));
for(int channel = 0; channel < in_count; channel++) {
if(asample > 0 && (asample > threshold || knee < 1)) {
- target = asample - threshold;
- target /= ratio;
- target += threshold;
+ if(IS_FAKE_INFINITY(ratio)) {
+ target = threshold;
+ } else {
+ target = asample - threshold;
+ target /= ratio;
+ target += threshold;
+ }
+
if(knee < 1) {
float t = std::min(1.f, std::max(0.f, asample / threshold - knee) / (1.f - knee));
target = (target - asample) * t + asample;
}
+
target /= asample;
} else {
target = 1.f;
diff --git a/src/modules.cpp b/src/modules.cpp
index 0a950a5..1508ee0 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -177,9 +177,9 @@ 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, 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, 100, 129, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio", "Ratio" },
+ { 15, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack", "Attack" },
+ { 200, 0.01, 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