aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2025-05-25 04:59:49 +0300
committerWohlstand <admin@wohlnet.ru>2025-05-25 04:59:49 +0300
commitf7c04e97cd07507d6993ab8e0e1d1aa8a642048e (patch)
tree731594341f83c949e97b9656365c669143045a2e /src
parent31ab9fccd609ac6a0c25819d0b7e685298b4047b (diff)
downloadlibADLMIDI-f7c04e97cd07507d6993ab8e0e1d1aa8a642048e.tar.gz
libADLMIDI-f7c04e97cd07507d6993ab8e0e1d1aa8a642048e.tar.bz2
libADLMIDI-f7c04e97cd07507d6993ab8e0e1d1aa8a642048e.zip
Fixed glitchy note sounding after channel stealing
Diffstat (limited to 'src')
-rw-r--r--src/adlmidi_midiplay.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 9ed7ee0..a30fbe8 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -1568,8 +1568,9 @@ bool MIDIplay::killSecondVoicesIfOverflow(int32_t &new_chan)
AdlChannel::LocationData &jd = j->value;
m_midiChannels[jd.loc.MidCh].clear_all_phys_users(new_chan);
- m_chipChannels[new_chan].users.clear();
- m_chipChannels[new_chan].koff_time_until_neglible_us = 0;
+ m_chipChannels[new_chan].users.erase(j);
+ assert(m_chipChannels[new_chan].users.empty()); // No users should remain!
+ synth.noteOff(new_chan);
ret = true;
}