Hello Jimmy, Sorry for the delay. I looked over your proposed changes. It doesn't seem like that is really the proper place for them though (would affect the default SoundFont loader only).
I went ahead and implemented this logic in fluid_synth_program_change. This seems to satisfy basic preset fallback selection. So I've closed Ticket #23. Please let me know if this functionality works as expected. http://fluidsynth.resonance.org/trac/ticket/23 Best regards, Josh Green On Sat, 2009-02-07 at 07:31 -0800, jimmy wrote: > Hi Josh, > > One more try. This also takes care of drum bank 128 fallback. Here is > > fluid_defsfont.c : fluid_defsfont_get_preset() > > >>>>> > > fluid_defpreset_t* fluid_defsfont_get_preset(fluid_defsfont_t* sfont, > unsigned int bank, unsigned int num) > { > fluid_defpreset_t* preset = sfont->preset; > fluid_defpreset_t* fallback_preset = NULL; > while (preset != NULL) { > > if (num == preset->num) { > if ((preset->bank == bank)) { > return preset; > } > if ((128 != bank) && (0 == preset->bank)) { > fallback_preset = preset; > } > } > > if ((128 == bank) && (0 == preset->num)) { > fallback_preset = preset; > } > preset = preset->next; > } > > if (( fallback_preset != NULL )) { > FLUID_LOG(FLUID_WARN, " --- fluid_defsfont_get_preset: no instrument > found for [bank, prog: %d, %d], substituted with: [bank, prog: %d, %d]", > bank, num, fallback_preset->bank, fallback_preset->num ); > > return fallback_preset; > } > > return NULL; > } > > <<<<< > > Please don't forget > > fluid_ramsfont.c : fluid_ramsfont_get_preset() > > Best regards, > > Jimmy > > > > > > > _______________________________________________ > fluid-dev mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/fluid-dev _______________________________________________ fluid-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/fluid-dev
