mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-14 00:20:41 +00:00
Remove redundant invalid preset generators checking in fluid_defpreset_noteon() (#430)
This commit is contained in:
parent
457edfcdda
commit
75b77f0186
1 changed files with 32 additions and 35 deletions
|
@ -833,42 +833,39 @@ fluid_defpreset_noteon(fluid_defpreset_t *defpreset, fluid_synth_t *synth, int c
|
||||||
{
|
{
|
||||||
|
|
||||||
/* SF 2.01 section 8.5 page 58: If some generators are
|
/* SF 2.01 section 8.5 page 58: If some generators are
|
||||||
* encountered at preset level, they should be ignored */
|
encountered at preset level, they should be ignored.
|
||||||
if((i != GEN_STARTADDROFS)
|
However this check is not necessary when the soundfont
|
||||||
&& (i != GEN_ENDADDROFS)
|
loader has ignored invalid preset generators.
|
||||||
&& (i != GEN_STARTLOOPADDROFS)
|
Actually load_pgen()has ignored these invalid preset
|
||||||
&& (i != GEN_ENDLOOPADDROFS)
|
generators:
|
||||||
&& (i != GEN_STARTADDRCOARSEOFS)
|
GEN_STARTADDROFS, GEN_ENDADDROFS,
|
||||||
&& (i != GEN_ENDADDRCOARSEOFS)
|
GEN_STARTLOOPADDROFS, GEN_ENDLOOPADDROFS,
|
||||||
&& (i != GEN_STARTLOOPADDRCOARSEOFS)
|
GEN_STARTADDRCOARSEOFS,GEN_ENDADDRCOARSEOFS,
|
||||||
&& (i != GEN_KEYNUM)
|
GEN_STARTLOOPADDRCOARSEOFS,
|
||||||
&& (i != GEN_VELOCITY)
|
GEN_KEYNUM, GEN_VELOCITY,
|
||||||
&& (i != GEN_ENDLOOPADDRCOARSEOFS)
|
GEN_ENDLOOPADDRCOARSEOFS,
|
||||||
&& (i != GEN_SAMPLEMODE)
|
GEN_SAMPLEMODE, GEN_EXCLUSIVECLASS,GEN_OVERRIDEROOTKEY
|
||||||
&& (i != GEN_EXCLUSIVECLASS)
|
*/
|
||||||
&& (i != GEN_OVERRIDEROOTKEY))
|
|
||||||
|
/* SF 2.01 section 9.4 'bullet' 9: A generator in a
|
||||||
|
* local preset zone supersedes a global preset zone
|
||||||
|
* generator. The effect is -added- to the destination
|
||||||
|
* summing node -> voice_gen_incr */
|
||||||
|
|
||||||
|
if(preset_zone->gen[i].flags)
|
||||||
{
|
{
|
||||||
|
fluid_voice_gen_incr(voice, i, preset_zone->gen[i].val);
|
||||||
/* SF 2.01 section 9.4 'bullet' 9: A generator in a
|
}
|
||||||
* local preset zone supersedes a global preset zone
|
else if((global_preset_zone != NULL) && global_preset_zone->gen[i].flags)
|
||||||
* generator. The effect is -added- to the destination
|
{
|
||||||
* summing node -> voice_gen_incr */
|
fluid_voice_gen_incr(voice, i, global_preset_zone->gen[i].val);
|
||||||
|
}
|
||||||
if(preset_zone->gen[i].flags)
|
else
|
||||||
{
|
{
|
||||||
fluid_voice_gen_incr(voice, i, preset_zone->gen[i].val);
|
/* The generator has not been defined in this preset
|
||||||
}
|
* Do nothing, leave it unchanged.
|
||||||
else if((global_preset_zone != NULL) && global_preset_zone->gen[i].flags)
|
*/
|
||||||
{
|
}
|
||||||
fluid_voice_gen_incr(voice, i, global_preset_zone->gen[i].val);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* The generator has not been defined in this preset
|
|
||||||
* Do nothing, leave it unchanged.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
} /* if available at preset level */
|
|
||||||
} /* for all generators */
|
} /* for all generators */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue