diff options
author | Wohlstand <admin@wohlnet.ru> | 2025-05-23 21:35:53 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2025-05-23 21:35:53 +0300 |
commit | 91558f59359eedef8d67dacacb838da498e3c3ef (patch) | |
tree | 3780e58dec518c6bf2f33d406a7b064a319e21d6 /src/adlmidi_midiplay.hpp | |
parent | 9b4e6de8ca758afa0917ad7472bde41bfc3848c0 (diff) | |
download | libADLMIDI-91558f59359eedef8d67dacacb838da498e3c3ef.tar.gz libADLMIDI-91558f59359eedef8d67dacacb838da498e3c3ef.tar.bz2 libADLMIDI-91558f59359eedef8d67dacacb838da498e3c3ef.zip |
Improve stability of 2-voice instruments on single OPL2
Diffstat (limited to 'src/adlmidi_midiplay.hpp')
-rw-r--r-- | src/adlmidi_midiplay.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/adlmidi_midiplay.hpp b/src/adlmidi_midiplay.hpp index 6ab0915..e5058b9 100644 --- a/src/adlmidi_midiplay.hpp +++ b/src/adlmidi_midiplay.hpp @@ -963,6 +963,13 @@ private: int64_t calculateChipChannelGoodness(size_t c, const MIDIchannel::NoteInfo::Phys &ins) const; /** + * @brief If no free chip channels, try to kill at least one second voice of pseudo-4-op instruments and steal the released channel + * @param new_chan Value of released chip channel to reuse + * @return true if any channel was been stolen, or false when nothing happen + */ + bool killSecondVoicesIfOverflow(int32_t &new_chan); + + /** * @brief A new note will be played on this channel using this instrument. * @param c Wanted chip channel * @param ins Instrument wanted to be used in this channel |