correct preset fallback on drum channels

This commit is contained in:
derselbst 2017-07-15 17:53:10 +02:00
parent f16c068962
commit 59bbdf1454

View file

@ -1970,8 +1970,9 @@ fluid_synth_program_change(fluid_synth_t* synth, int chan, int prognum)
/* Fallback to another preset if not found */ /* Fallback to another preset if not found */
if (!preset) { if (!preset) {
/* Percussion: Fallback to preset 0 in percussion bank */ /* Percussion: Fallback to preset 0 in percussion bank */
if (subst_bank == DRUM_INST_BANK) { if (channel->channel_type == CHANNEL_TYPE_DRUM) {
subst_prog = 0; subst_prog = 0;
subst_bank = DRUM_INST_BANK;
preset = fluid_synth_find_preset(synth, subst_bank, subst_prog); preset = fluid_synth_find_preset(synth, subst_bank, subst_prog);
} }
/* Melodic instrument */ /* Melodic instrument */