OPL 4-op note preview possible fix

This commit is contained in:
tildearrow 2022-04-28 05:38:28 -05:00
parent 3906fc1dd4
commit 8675cdf802

View file

@ -2175,7 +2175,7 @@ void DivEngine::autoNoteOn(int ch, int ins, int note, int vol) {
// 2. find a free channel
do {
if (isViable[finalChan] && chan[finalChan].midiNote==-1 && getChannelType(finalChan)==finalChanType) {
if (isViable[finalChan] && chan[finalChan].midiNote==-1 && (insInst->type==DIV_INS_OPL || getChannelType(finalChan)==finalChanType)) {
chan[finalChan].midiNote=note;
chan[finalChan].midiAge=midiAgeCounter++;
pendingNotes.push(DivNoteEvent(finalChan,ins,note,vol,true));
@ -2189,7 +2189,7 @@ void DivEngine::autoNoteOn(int ch, int ins, int note, int vol) {
// 3. find the oldest channel
int candidate=finalChan;
do {
if (isViable[finalChan] && getChannelType(finalChan)==finalChanType && chan[finalChan].midiAge<chan[candidate].midiAge) {
if (isViable[finalChan] && (insInst->type==DIV_INS_OPL || getChannelType(finalChan)==finalChanType) && chan[finalChan].midiAge<chan[candidate].midiAge) {
candidate=finalChan;
}
if (++finalChan>=chans) {