From 3bdda83b7d5417785f5df0120d4f2d73af4253d4 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Fri, 25 Jan 2019 08:16:31 +0100 Subject: force note-on to do immediate note killing --- src/adlmidi_midiplay.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/adlmidi_midiplay.cpp') diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index f8bd0a2..011f74a 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -345,7 +345,7 @@ bool MIDIplay::realTime_NoteOn(uint8_t channel, uint8_t note, uint8_t velocity) if(static_cast(channel) > m_midiChannels.size()) channel = channel % 16; - noteOff(channel, note); + noteOff(channel, note, velocity != 0); // On Note on, Keyoff the note first, just in case keyoff // was omitted; this fixes Dance of sugar-plum fairy // by Microsoft. Now that we've done a Keyoff, @@ -1733,7 +1733,7 @@ void MIDIplay::updatePortamento(size_t midCh) } -void MIDIplay::noteOff(size_t midCh, uint8_t note) +void MIDIplay::noteOff(size_t midCh, uint8_t note, bool forceNow) { MIDIchannel &ch = m_midiChannels[midCh]; MIDIchannel::notes_iterator i = ch.find_activenote(note); @@ -1741,7 +1741,7 @@ void MIDIplay::noteOff(size_t midCh, uint8_t note) if(!i.is_end()) { MIDIchannel::NoteInfo &ni = i->value; - if(ni.ttl <= 0) + if(forceNow || ni.ttl <= 0) noteUpdate(midCh, i, Upd_Off); else ni.isOnExtendedLifeTime = true; -- cgit v1.2.3