Import modulator source src1 correctly.

- When primary source input (src1) is set to General Controller
  'No Controller', output will be forced to 0.0 at synthesis time
  (see fluid_mod_get_value()).
  That means that the minimum value of the modulator will be always 0.0.
  We need to force amount value to 0 to ensure a correct evaluation of the
  minimum value later (see fluid_voice_get_lower_boundary_for_attenuation()).
This commit is contained in:
jjceresa 2018-12-21 12:13:28 +01:00
parent b659fd82a5
commit e8dd6ae389

View file

@ -1354,7 +1354,20 @@ fluid_zone_mod_import_sfont(fluid_mod_t **mod, SFZone *sfzone)
* Deactivate the modulator by setting the amount to 0. */ * Deactivate the modulator by setting the amount to 0. */
mod_dest->amount = 0; mod_dest->amount = 0;
} }
/* *** Dest *** */
/* Note: When primary source input (src1) is set to General Controller 'No Controller',
output will be forced to 0.0 at synthesis time (see fluid_mod_get_value()).
That means that the minimum value of the modulator will be always 0.0.
We need to force amount value to 0 to ensure a correct evaluation of the minimum
value later (see fluid_voice_get_lower_boundary_for_attenuation()).
*/
if(((mod_dest->flags1 & FLUID_MOD_CC) == FLUID_MOD_GC) &&
(mod_dest->src1 == FLUID_MOD_NONE))
{
mod_dest->amount = 0;
}
/* *** Dest *** */
mod_dest->dest = mod_src->dest; /* index of controlled generator */ mod_dest->dest = mod_src->dest; /* index of controlled generator */
/* *** Amount source *** */ /* *** Amount source *** */
@ -1367,7 +1380,8 @@ fluid_zone_mod_import_sfont(fluid_mod_t **mod, SFZone *sfzone)
/* Note: When secondary source input (src2) is set to General Controller 'No Controller', /* Note: When secondary source input (src2) is set to General Controller 'No Controller',
output will be forced to +1.0 at synthesis time (see fluid_mod_get_value()). output will be forced to +1.0 at synthesis time (see fluid_mod_get_value()).
That means that this source will behave unipolar only. We need to force the That means that this source will behave unipolar only. We need to force the
unipolar flags to ensure the modulator will behave correctly later. unipolar flag to ensure to ensure a correct evaluation of the minimum
value later (see fluid_voice_get_lower_boundary_for_attenuation()).
*/ */
if(((mod_dest->flags2 & FLUID_MOD_CC) == FLUID_MOD_GC) && if(((mod_dest->flags2 & FLUID_MOD_CC) == FLUID_MOD_GC) &&
(mod_dest->src2 == FLUID_MOD_NONE)) (mod_dest->src2 == FLUID_MOD_NONE))