Also consider channel pressure, key pressure and pitchwheel modulators when calculating lower attenuation boundary.

This commit is contained in:
Marcus Weseloh 2017-09-23 13:27:13 +02:00
parent 50b6e9462e
commit 9766acc41a
1 changed files with 8 additions and 1 deletions

View File

@ -1568,7 +1568,14 @@ fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice)
/* Modulator has attenuation as target and can change over time? */
if ((mod->dest == GEN_ATTENUATION)
&& ((mod->flags1 & FLUID_MOD_CC) || (mod->flags2 & FLUID_MOD_CC))) {
&& ((mod->flags1 & FLUID_MOD_CC)
|| (mod->flags2 & FLUID_MOD_CC)
|| (mod->src1 == FLUID_MOD_CHANNELPRESSURE)
|| (mod->src1 == FLUID_MOD_KEYPRESSURE)
|| (mod->src1 == FLUID_MOD_PITCHWHEEL)
|| (mod->src2 == FLUID_MOD_CHANNELPRESSURE)
|| (mod->src2 == FLUID_MOD_KEYPRESSURE)
|| (mod->src2 == FLUID_MOD_PITCHWHEEL))) {
fluid_real_t current_val = fluid_mod_get_value(mod, voice->channel, voice);
fluid_real_t v = fabs(mod->amount);