Remove redundant invalid preset generators checking in fluid_defpreset_noteon() (#430)

This commit is contained in:
jjceresa 2018-09-20 20:11:11 +02:00 committed by Tom M
parent 457edfcdda
commit 75b77f0186

View file

@ -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 */