From aafcec29dbd743c7cc3544ca100ebd14c422c1ef Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Tue, 8 Sep 2020 10:46:54 +0300 Subject: Make HMI channel management being more accurate #223 --- src/adlmidi_midiplay.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 843bdb2..09a4c15 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -1364,13 +1364,12 @@ int64_t MIDIplay::calculateChipChannelGoodness(size_t c, const MIDIchannel::Note { s -= 40000; // If it's same instrument, better chance to get it when no free channels - if(chan.recent_ins == ins) - { - if(synth.m_musicMode == Synth::MODE_CMF || synth.m_volumeScale == Synth::VOLUME_HMI) - s = 0; // Re-use channel immediately - else - s = -koff_ms; // Wait until releasing sound will complete - } + if(chan.recent_ins == ins && synth.m_musicMode == Synth::MODE_CMF) + s = 0; // Re-use releasing channel with the same instrument + else if(synth.m_volumeScale == Synth::VOLUME_HMI) + s = 0; // HMI doesn't care about the same instrument + else + s = -koff_ms; // Wait until releasing sound will complete return s; } -- cgit v1.2.3