[BASSMIDI] Volume controller regression on Yamaha XG MIDI files in 2.4.16

Started by Myshor,

Myshor

Hi Ian,

Following an investigation on the CoolSoft forum regarding a regression in VirtualMIDISynth (ref: https://coolsoft.altervista.org/en/forum/thread/11754), Claudio suggested reporting this issue directly to you.

Issue summary:
Some older Yamaha XG MIDI files produce no audible sound at all / playback is completely silent in BASSMIDI 2.4.16, whereas they play normally with proper channel volumes in BASSMIDI 2.4.15.5.

Test details:
- Problematic file: Srv2.mid (attached directly as Srv2.zip; also available in the CoolSoft thread linked above).
- Soundfonts tested: Reproducible across different soundfonts, including custom https://github.com/Myshor/Myshor-GS-XG as well as standard soundfonts.
- Working version: bassmidi.dll 2.4.15.5 (from VirtualMIDISynth 2.14.0.0). Plays properly with correct volume balances.
- Broken version: bassmidi.dll 2.4.16 (bundled with VirtualMIDISynth 2.14.1). Playback is completely silent (channel volume appears to be muted or zeroed out).
- Workaround / confirmation: Replacing bassmidi.dll 2.4.16 with the older 2.4.15.5 build immediately resolves the issue without touching soundfonts or player settings.

Could you please verify if any changes introduced between 2.4.15.5 and 2.4.16 affected Yamaha XG sysex handling or channel volume controller processing?

Thanks,
Myshor

Ian @ un4seen

I don't seem to be able to reproduce that here - the BASSMIDI 2.4.15 and 2.4.16 output is basically identical. Please see if you can reproduce it there with the pre-compiled MIDITEST.EXE example that's included in BASSMIDI package (C\BIN folder). If that's working fine then perhaps the problem is triggered by some setting that VirtualMIDISynth is using?

Myshor

Hi Ian,

Here are the test results:

1. In 32-bit miditest.exe using 32-bit bassmidi.dll 2.4.16, Srv2.mid plays fine with full audio.
2. In VirtualMIDISynth (64-bit), using the official 64-bit bassmidi.dll 2.4.16 directly from the bassmidi24.zip archive results in complete silence.
3. Replacing bassmidi.dll in VirtualMIDISynth with 2.4.15.5 immediately restores sound.

Could this issue be specific to the 64-bit build of bassmidi.dll? Or, as you suggested, could it be triggered by a specific BASSMIDI setting or flag that VirtualMIDISynth passes to 2.4.16?

Thanks,
Myshor

Ian @ un4seen

Ah! I do see the problem now. It's triggered by XG per-drum sysex events (to set chorus/reverb/etc on a drum key). Here's an update that should fix the problem:

    www.un4seen.com/stuff/bassmidi.zip

Let me know if it still gives you any trouble.

Myshor

Hi Ian,

Tested the updated 64-bit build in VirtualMIDISynth with Srv2.mid and the SoundFont, and it plays perfectly now. Full audio is back, and the XG drum effects work as expected.

Thanks a lot for the quick fix!

Will this fix make its way into the next official release of BASSMIDI? Once confirmed, I'll update the thread over at CoolSoft so Claudio knows it's sorted on upstream and can update the library when the new release is out.

I will keep running this test DLL locally in the meantime to see if anything else pops up.

Thanks again,
Myshor

Ian @ un4seen

Good to hear it's working properly again. The fix will indeed be in the next BASSMIDI release. In the meantime, it should be fine to use the update above (it's a "release" build).

Falcosoft

Quote from: Ian @ un4seenAh! I do see the problem now. It's triggered by XG per-drum sysex events (to set chorus/reverb/etc on a drum key). Here's an update that should fix the problem:

    www.un4seen.com/stuff/bassmidi.zip

Let me know if it still gives you any trouble.
Hi,
I cannot reproduce the problem with version 2.4.16.4 of Bassmidi. How is this possible? What special settings/flags are needed to trigger the bug?

Myshor

Quote from: FalcosoftHi,
I cannot reproduce the problem with version 2.4.16.4 of Bassmidi. How is this possible? What special settings/flags are needed to trigger the bug?

Ian already identified the trigger above: the issue is specifically caused by Yamaha XG per-drum SysEx messages (which set reverb/chorus on individual drum keys), and he provided an updated bassmidi build addressing this.

Regarding reproduction in MidiPlayer: VirtualMIDISynth streams live MIDI events directly into BASSMIDI in real time, whereas standard file playback might handle or parse events differently. Routing a live stream through a loopMIDI port via the MIDI In option might help replicate the exact scenario.

Also, does your player run the 64-bit or 32-bit BASSMIDI DLL? In my case, the issue was observed on the 64-bit version.

Ian @ un4seen

What I wrote above wasn't entirely correct. The problem was actually triggered by an unsupported XG per-drum sysex, so it was incorrect to give chorus/reverb as examples (they are supported). In the test file's case, it's a "Rcv NOTE OFF" sysex (43 10 4c 30 21 09 01). The problem was that those sysex left an uninitialized variable, possibly resulting in a random event getting added to the stream. The silence was caused by that event being MIDI_EVENT_END, ending the track.

Falcosoft

Quote from: Myshor
Quote from: FalcosoftHi,
I cannot reproduce the problem with version 2.4.16.4 of Bassmidi. How is this possible? What special settings/flags are needed to trigger the bug?

Ian already identified the trigger above: the issue is specifically caused by Yamaha XG per-drum SysEx messages (which set reverb/chorus on individual drum keys), and he provided an updated bassmidi build addressing this.

Regarding reproduction in MidiPlayer: VirtualMIDISynth streams live MIDI events directly into BASSMIDI in real time, whereas standard file playback might handle or parse events differently. Routing a live stream through a loopMIDI port via the MIDI In option might help replicate the exact scenario.

Also, does your player run the 64-bit or 32-bit BASSMIDI DLL? In my case, the issue was observed on the 64-bit version.

Maybe I was not clear enough: My Midi Player also uses real-time Bassmidi functions (BASS_MIDI_StreamEvents) and I tested your example file (Srv2.mid). Your report said that nothing should be heard ( no audible sound at all).
Yet in my 64-bit Midi player that uses BassMidi version 2.4.16.4 I can clearly hear audio when Srv2.mid is played back.
I understand that Ian found the bug but I'm still curious how this is possible.
Here is my test video:
https://youtu.be/wJUFnTL-KIM

In the test video I also used a real Yamaha XG emulator and aside from the obvious engine/effect differences both sounded right.

Ian @ un4seen

As the problem was caused by an uninitialized variable, it's very possible that it wouldn't happen in all cases. It depends on what happens to be in that variable's memory location.