From 4481ebbdd2a29b542fb5e3d1e1ee205d620490cc Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Thu, 22 Mar 2018 10:26:44 +0300 Subject: [PATCH] Fixed an incorrect ADLMIDI playback As DMX uses both 10'th and 16'th channels for percussions, I'll turn a 16'th channel into percussive by XG way on every init/reset. --- src/sound/mididevices/music_adlmidi_mididevice.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sound/mididevices/music_adlmidi_mididevice.cpp b/src/sound/mididevices/music_adlmidi_mididevice.cpp index c8cf5b8fc..615f0acd9 100644 --- a/src/sound/mididevices/music_adlmidi_mididevice.cpp +++ b/src/sound/mididevices/music_adlmidi_mididevice.cpp @@ -75,6 +75,8 @@ ADLMIDIDevice::ADLMIDIDevice(const char *args) if (Renderer != nullptr) { adl_setBank(Renderer, 14); + //! Set 16'th channel be percussive (XG way) + adl_rt_bankChange(Renderer, 0x0F, 0x7F00); } } @@ -107,6 +109,8 @@ int ADLMIDIDevice::Open(MidiCallback callback, void *userdata) if (ret == 0) { adl_rt_resetState(Renderer); + //! Set 16'th channel be percussive (XG way) + adl_rt_bankChange(Renderer, 0x0F, 0x7F00); } return ret; } @@ -141,7 +145,7 @@ void ADLMIDIDevice::HandleEvent(int status, int parm1, int parm2) break; case ME_PROGRAM: - adl_rt_bankChange(Renderer, chan, parm1); + adl_rt_patchChange(Renderer, chan, parm1); break; case ME_CHANNELPRESSURE: