Skip to content

Commit

Permalink
Do not hardcode bank of drum channels
Browse files Browse the repository at this point in the history
Second attempt after #176
  • Loading branch information
derselbst committed Feb 8, 2025
1 parent 77e98b6 commit 6e5a6c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 5 additions & 2 deletions src/synth/fluid_chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ fluid_channel_set_bank_msb(fluid_channel_t *chan, int bankmsb)
return;
}

if(style == FLUID_BANK_STYLE_GM ||
chan->channel_type == CHANNEL_TYPE_DRUM)
if(style == FLUID_BANK_STYLE_GM )
{
return; /* ignored */
}
Expand All @@ -344,6 +343,10 @@ fluid_channel_set_bank_msb(fluid_channel_t *chan, int bankmsb)

if(style == FLUID_BANK_STYLE_GS)
{
if(chan->channel_type == CHANNEL_TYPE_DRUM)
{
bankmsb += DRUM_INST_BANK;
}
newval = (oldval & ~BANK_MASKVAL) | (bankmsb << BANK_SHIFTVAL);
}
else /* style == FLUID_BANK_STYLE_MMA */
Expand Down
9 changes: 1 addition & 8 deletions src/synth/fluid_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3109,14 +3109,7 @@ fluid_synth_program_change(fluid_synth_t *synth, int chan, int prognum)

channel = synth->channel[chan];

if(channel->channel_type == CHANNEL_TYPE_DRUM)
{
banknum = DRUM_INST_BANK;
}
else
{
fluid_channel_get_sfont_bank_prog(channel, NULL, &banknum, NULL);
}
fluid_channel_get_sfont_bank_prog(channel, NULL, &banknum, NULL);

if(synth->verbose)
{
Expand Down

0 comments on commit 6e5a6c6

Please sign in to comment.