summaryrefslogtreecommitdiff
path: root/libs/plugins
diff options
context:
space:
mode:
authorJohannes Mueller <github@johannes-mueller.org>2017-08-04 14:05:16 +0200
committerRobin Gareus <robin@gareus.org>2018-06-20 21:06:16 +0200
commit87ea757a5de4b966ed2026f4ee9b04e6d80adcbb (patch)
tree2163e3c4ba296da6d11fc184598c363a0500cc55 /libs/plugins
parent3e124704b07e35827f46457d8a0640d67a2c052e (diff)
Improve level vizualisation in a-comp
* LPF in the signal visialization * Lower minimum values
Diffstat (limited to 'libs/plugins')
-rw-r--r--libs/plugins/a-comp.lv2/a-comp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libs/plugins/a-comp.lv2/a-comp.c b/libs/plugins/a-comp.lv2/a-comp.c
index cabbd8cbde..f495e7f2a0 100644
--- a/libs/plugins/a-comp.lv2/a-comp.c
+++ b/libs/plugins/a-comp.lv2/a-comp.c
@@ -249,7 +249,7 @@ activate(LV2_Handle instance)
AComp* acomp = (AComp*)instance;
*(acomp->gainr) = 0.0f;
- *(acomp->outlevel) = -45.0f;
+ *(acomp->outlevel) = -70.0f;
}
static void
@@ -372,7 +372,7 @@ run_mono(LV2_Handle instance, uint32_t n_samples)
makeup_gain += tau * (makeup_target - makeup_gain) + 1e-12;
}
- *(acomp->outlevel) = (max < 0.0056f) ? -45.f : to_dB(max);
+ *(acomp->outlevel) = (max < 0.0056f) ? -70.f : to_dB(max);
acomp->makeup_gain = makeup_gain;
#ifdef LV2_EXTENDED
@@ -396,8 +396,9 @@ run_mono(LV2_Handle instance, uint32_t n_samples)
fabsf (acomp->v_state_x - state_x) >= .1f ) {
// >= 0.1dB difference
acomp->need_expose = true;
- acomp->v_lvl_in = v_lvl_in;
- acomp->v_lvl_out = v_lvl_out;
+ const float relax_coef = exp(-5.f*n_samples/srate);
+ acomp->v_lvl_in = fmaxf (v_lvl_in, relax_coef*acomp->v_lvl_in + (1.f-relax_coef)*v_lvl_in);
+ acomp->v_lvl_out = fmaxf (v_lvl_out, relax_coef*acomp->v_lvl_out + (1.f-relax_coef)*v_lvl_out);
acomp->v_state_x = state_x;
}
if (acomp->need_expose && acomp->queue_draw) {
@@ -535,7 +536,7 @@ run_stereo(LV2_Handle instance, uint32_t n_samples)
makeup_gain += tau * (makeup_target - makeup_gain) + 1e-12;
}
- *(acomp->outlevel) = (max < 0.0056f) ? -45.f : to_dB(max);
+ *(acomp->outlevel) = (max < 0.0056f) ? -70.f : to_dB(max);
acomp->makeup_gain = makeup_gain;
#ifdef LV2_EXTENDED
@@ -559,8 +560,9 @@ run_stereo(LV2_Handle instance, uint32_t n_samples)
fabsf (acomp->v_state_x - state_x) >= .1f ) {
// >= 0.1dB difference
acomp->need_expose = true;
- acomp->v_lvl_in = v_lvl_in;
- acomp->v_lvl_out = v_lvl_out;
+ const float relax_coef = exp(-5.f*n_samples/srate);
+ acomp->v_lvl_in = fmaxf (v_lvl_in, relax_coef*acomp->v_lvl_in + (1.f-relax_coef)*v_lvl_in);
+ acomp->v_lvl_out = fmaxf (v_lvl_out, relax_coef*acomp->v_lvl_out + (1.f-relax_coef)*v_lvl_out);
acomp->v_state_x = state_x;
}
if (acomp->need_expose && acomp->queue_draw) {