XG drums

Started by gicci,

gicci

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?

Ian @ un4seen

Quote from: gicciI 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.

Quote from: gicciThen 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.

gicci

I am resuming this old thread as I have some issues with XG drums handling.

QuoteMIDI_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

I am not getting MIDI_EVENT_DRUMS querying BASS_MIDI_StreamGetEvents with XG files. I think that in the past it worked, or am I doing something wrong?

Then if I change during the playback on a XG drum channel the drum program with something like the following calls:

BASS_MIDI_StreamEvent() called with: handle = [-2147480567], chan = [9], event = [10], param = [127]
BASS_MIDI_StreamEvent() returned: true
BASS_MIDI_StreamEvent() called with: handle = [-2147480567], chan = [9], event = [70], param = [0]
BASS_MIDI_StreamEvent() returned: true
BASS_MIDI_StreamEvent() called with: handle = [-2147480567], chan = [9], event = [2], param = [0]
BASS_MIDI_StreamEvent() returned: true

on a channel already using the standard kit, the drum sounds change like some of their parameters are modified. Do I need to perform additional setup after sending those events? In GM/GS there is no issue.

Ian @ un4seen

Quote from: gicciI am not getting MIDI_EVENT_DRUMS querying BASS_MIDI_StreamGetEvents with XG files. I think that in the past it worked, or am I doing something wrong?

Please note that there will only be MIDI_EVENT_DRUMS events when the MIDI file contains sysex messages to enable/disable drum channels. If your file does contain such messages, please post/upload it to check what's happening to them.

If your file is using bank numbers to enable/disable drums (XG bank 127 = drums) then you would need to check MIDI_EVENT_BANK events instead.

gicci

#4
What about the drum sounds change when using BASS_MIDI_StreamGetEvents to set the program (even if keeping the same one already set)? Do I need to perform additional setup after sending those events? In GM/GS there is no issue.

As a side note, replacing the drum kit on channel 10 with an SFX kit via BASS_MIDI_StreamEvent always produces the standard drum kit.