13
0

Improve level vizualisation in a-comp

* LPF in the signal visialization

* Lower minimum values
This commit is contained in:
Johannes Mueller 2017-08-04 14:05:16 +02:00 committed by Robin Gareus
parent 3e124704b0
commit 87ea757a5d

View File

@ -249,7 +249,7 @@ activate(LV2_Handle instance)
AComp* acomp = (AComp*)instance; AComp* acomp = (AComp*)instance;
*(acomp->gainr) = 0.0f; *(acomp->gainr) = 0.0f;
*(acomp->outlevel) = -45.0f; *(acomp->outlevel) = -70.0f;
} }
static void static void
@ -372,7 +372,7 @@ run_mono(LV2_Handle instance, uint32_t n_samples)
makeup_gain += tau * (makeup_target - makeup_gain) + 1e-12; 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; acomp->makeup_gain = makeup_gain;
#ifdef LV2_EXTENDED #ifdef LV2_EXTENDED
@ -396,8 +396,9 @@ run_mono(LV2_Handle instance, uint32_t n_samples)
fabsf (acomp->v_state_x - state_x) >= .1f ) { fabsf (acomp->v_state_x - state_x) >= .1f ) {
// >= 0.1dB difference // >= 0.1dB difference
acomp->need_expose = true; acomp->need_expose = true;
acomp->v_lvl_in = v_lvl_in; const float relax_coef = exp(-5.f*n_samples/srate);
acomp->v_lvl_out = v_lvl_out; 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; acomp->v_state_x = state_x;
} }
if (acomp->need_expose && acomp->queue_draw) { 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; 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; acomp->makeup_gain = makeup_gain;
#ifdef LV2_EXTENDED #ifdef LV2_EXTENDED
@ -559,8 +560,9 @@ run_stereo(LV2_Handle instance, uint32_t n_samples)
fabsf (acomp->v_state_x - state_x) >= .1f ) { fabsf (acomp->v_state_x - state_x) >= .1f ) {
// >= 0.1dB difference // >= 0.1dB difference
acomp->need_expose = true; acomp->need_expose = true;
acomp->v_lvl_in = v_lvl_in; const float relax_coef = exp(-5.f*n_samples/srate);
acomp->v_lvl_out = v_lvl_out; 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; acomp->v_state_x = state_x;
} }
if (acomp->need_expose && acomp->queue_draw) { if (acomp->need_expose && acomp->queue_draw) {