13
0

Fix a-EQ when parameter changes are very slow

If the parameters change too slowly the filter may never get updated. Indeed,
in spite of v_f0, v_g or v_bw being updated, set_params may never be called,
thus v_filter never updated.
This commit is contained in:
Nil Geisweiller 2017-06-04 21:34:48 +03:00 committed by Robin Gareus
parent 2c41df9474
commit a07ca8fa3e

View File

@ -393,23 +393,17 @@ run(LV2_Handle instance, uint32_t n_samples)
if (!is_eq(aeq->v_f0[i], *aeq->f0[i], 0.1)) {
aeq->v_f0[i] += tau * (*aeq->f0[i] - aeq->v_f0[i]);
changed = true;
} else {
aeq->v_f0[i] = *aeq->f0[i];
}
if (*aeq->filtog[i] <= 0 || *aeq->enable <= 0) {
if (!is_eq(aeq->v_g[i], 0.f, 0.05)) {
aeq->v_g[i] += tau * (0.0 - aeq->v_g[i]);
changed = true;
} else {
aeq->v_g[i] = 0.0;
}
} else {
if (!is_eq(aeq->v_g[i], *aeq->g[i], 0.05)) {
aeq->v_g[i] += tau * (*aeq->g[i] - aeq->v_g[i]);
changed = true;
} else {
aeq->v_g[i] = *aeq->g[i];
}
}
@ -417,8 +411,6 @@ run(LV2_Handle instance, uint32_t n_samples)
if (!is_eq(aeq->v_bw[i], *aeq->bw[i], 0.001)) {
aeq->v_bw[i] += tau * (*aeq->bw[i] - aeq->v_bw[i]);
changed = true;
} else {
aeq->v_bw[i] = *aeq->bw[i];
}
}