My BASS/BASSMIDI app, MyMIDI Player, stacks sound fonts and supports non-bank 0 instruments. Years back I had a conversion with Ian about getting the BASS_MIDI_StreamEvent call to set MIDI_EVENT_BANK (non-zero bank) to work, and that was successful. At some point it has stopped working, and I'm trying to work out why.
There is no MIDI_SYSTEM_GM1 event sent, and BASS_MIDI_StreamEvent is called for MIDI_EVENT_PROGRAM after the BASS_MIDI_BANK call every time. The bank and program values match those loaded by using BASS_MIDI_FontGetPreset, so the numbers are right. I've traced the process of trying to activate the non-zero banks, the numbers all match, the calls return true, but the instrument never changes.
My key setup calls are:
BASS_MIDI_StreamCreateFile(0, this->getFilename(), 0, 0, BASS_MIDI_ASYNC | BASS_MIDI_DECAYEND | BASS_SAMPLE_FLOAT, 44100)
BASS_ChannelSetAttribute(chan, BASS_ATTRIB_MIDI_SRC, 2); // used to be BASS_MIDI_SINCINTER in the BASS_MIDI_StreamCreateFile call, but that also fails
BASS_ChannelSetAttribute(chan, BASS_ATTRIB_MIDI_CHANS, 32); // allocate extra MIDI channels for MIDI stream accessing VSTi (I don't believe this is relevant, as this problem only relates to SF2 soundfonts, not VSTi)
There have been key changes since it worked in my earlier version:
- I've upgraded to the latest BASS and BASSMIDI versions. Previous versions were BASS 2.4.10 and BASSMIDI 2.4.8 (32 bit). Now using BASS 2.4.17 and BASSMIDI 2.4.14.9 (64 bit).
- I've moved from 32 bit to 64 bit
- I've built in VSTi support, but I don't believe this is related. With no VSTi plugins activated, therefore no VSTi related calls, the problem still occurs. The exception is the BASS_ChannelSetAttribute(chan, BASS_ATTRIB_MIDI_CHANS, 32) call when creating the stream. Removing that call for testing purposes does not fix the problem.
The problem is, I don't know when or why it stopped working. All my focus was on implementing VST instruments, and eventually noticed the non-bank 0 instrument changes weren't working.
Any thoughts on what changes could cause the non-bank 0 calls to stop working would be greatly appreciated.