Further to this, I propose a change to the bank number handling. While I
already saw some changes under way to use MSB or LSB or both depending
on the MIDI standard, I think it's better to combine the approach.
Since SoundFont hardware devices expect the bank change commands to only
be in the MSB, and those correspond to the bank numbers encoded in the
SoundFont banks themselves, I think FluidSynth should behave
accordingly. Namely, it should read SoundFont bank numbers scaled to
MSB. The player code should handle both MSB and LSB, and in case of XG
MIDI data setting the bank LSB, the preset search fallback should search
for a bank number with the LSB masked off in the event that a MSB+LSB
match is not found. This is what I currently do in my modified
FluidSynth which I link into foo_midi.
Of course, I'm not sure what to do about the bank LSB field. While the
SoundFont 2.x file format does support a 16-bit bank field, I don't
think any editors actually allow setting the bank to higher than 128,
the drum bank.
Although the above seems to be fine for when I'm using a largely General
MIDI preset with AnotherXG as the first bank loaded, as a fallback. In
fact, it even takes care of XG style drum mapping, since bank 16256, or
MSB 127, is filled with drum instruments in that bank. In fact, my
higher level fallback bank, SGP v2.01, even has drum instruments in bank
127.
So, I have changed the defined drum bank to 16256, and the default
SoundFont loader also multiplies file bank numbers by 128 so they're in
the MSB, or sets it to 16256 if it's 128. This nicely handles XG drum
channel settings, and falls bank on the normal bank 128 drum kits in
case no SoundFonts with bank 127 drum kits are loaded. If a SoundFont
has both bank 127 and bank 128 drum kits, the bank 127 kits will be
found first. Maybe this needs to be optimized so that if bank 127
defines drum kits, corresponding instruments in bank 128 will be
ignored. Hmm...
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fluid-dev