diff options
author | Wohlstand <admin@wohlnet.ru> | 2020-09-08 10:46:54 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2020-09-08 10:46:54 +0300 |
commit | aafcec29dbd743c7cc3544ca100ebd14c422c1ef (patch) | |
tree | 2c66417f5705db7ea3171c42c93169336e20a8cc /src/adlmidi_midiplay.cpp | |
parent | 5703f4b48bc2aeac92ffe1e9d10d3738125709c3 (diff) | |
download | libADLMIDI-aafcec29dbd743c7cc3544ca100ebd14c422c1ef.tar.gz libADLMIDI-aafcec29dbd743c7cc3544ca100ebd14c422c1ef.tar.bz2 libADLMIDI-aafcec29dbd743c7cc3544ca100ebd14c422c1ef.zip |
Make HMI channel management being more accurate
#223
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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; } |