From 28b712a96190c2148a985f4de820f42dafd91ac9 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 17 Nov 2017 03:50:14 +0300 Subject: Let XG SFX1/SFX2 use LSB==1 range of percussion instruments of WOPL file --- src/adlmidi_midiplay.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 9fe1cfd..4705bc4 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -923,16 +923,21 @@ bool MIDIplay::realTime_NoteOn(uint8_t channel, uint8_t note, uint8_t velocity) { bank = (uint16_t(Ch[channel].bank_msb) * 256) + uint16_t(Ch[channel].bank_lsb); if(bank == 0x7E00) //XG SFX1/SFX2 channel (16128 signed decimal) + { + //Let XG SFX1/SFX2 bank will have LSB==1 (128...255 range in WOPL file) + bank = (uint16_t)midiins + 128; // MIDI instrument defines the patch isPercussion = true; + } if(bank == 0x7F00) //XG Percussion channel (16256 signed decimal) + { + //Let XG Percussion bank will use (0...127 range in WOPL file) + bank = (uint16_t)midiins; // MIDI instrument defines the patch isPercussion = true; + } } if(isPercussion) - { - bank = (uint16_t)midiins; // MIDI instrument defines the patch midiins = opl.dynamic_percussion_offset + note; // Percussion instrument - } //Set bank bank if(bank > 0) -- cgit v1.2.3