Author Topic: XG drums  (Read 92 times)

gicci

  • Posts: 105
XG drums
« on: 19 Mar '23 - 01:32 »
I have the impression that the BASS_MIDI_FONT_XGDRUMS SoundFont flag cannot be changed without reloading the SoundFont, even if the documentation does not say so.
On a SF with both 127:000 and 128:000 drum kits, disabling 128:000 will make the drum stop playing. Enabling then the BASS_MIDI_FONT_XGDRUMS will not let the playback resume, unless I reload the SF.
Could you please confirm?

Then it seems that for XG files the MIDI_EVENT_DRUMS event is not present in additional drum channels. Should I just check for bank numbers in this case?
« Last Edit: 19 Mar '23 - 02:26 by gicci »

Ian @ un4seen

  • Administrator
  • Posts: 25067
Re: XG drums
« Reply #1 on: 20 Mar '23 - 14:29 »
I have the impression that the BASS_MIDI_FONT_XGDRUMS SoundFont flag cannot be changed without reloading the SoundFont, even if the documentation does not say so.
On a SF with both 127:000 and 128:000 drum kits, disabling 128:000 will make the drum stop playing. Enabling then the BASS_MIDI_FONT_XGDRUMS will not let the playback resume, unless I reload the SF.
Could you please confirm?

The BASS_MIDI_FONT_XGDRUMS flag can be toggled on a loaded soundfont via BASS_MIDI_FontFlags, but a MIDI stream's already loaded presets will still be active. In that case, please try using BASS_MIDI_StreamSetFonts to remove the soundfont from the MIDI stream (thus removing its presets from the stream) and then add it again.

Then it seems that for XG files the MIDI_EVENT_DRUMS event is not present in additional drum channels. Should I just check for bank numbers in this case?

Yes, MIDI_EVENT_DRUMS will only be present in a MIDI stream's events when the corresponding sysex is present in the MIDI file. But MIDI_EVENT_DRUMS with BASS_MIDI_StreamGetEvent will also return 1 when drums are enabled via the bank number in XG/GM2 modes, so you can use that to check a channel's current drum status.