aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_midiplay.cpp
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2017-11-03 00:56:22 +0300
committerWohlstand <admin@wohlnet.ru>2017-11-03 00:56:22 +0300
commitc9e841b5f1cd7afbdb2d6c3be610ae48299390ab (patch)
treea54ec56db24c56c1beeb9ce1a963b180cd16ee98 /src/adlmidi_midiplay.cpp
parent2017bff1824134273865b600c3eeca4f6cb0d299 (diff)
downloadlibADLMIDI-c9e841b5f1cd7afbdb2d6c3be610ae48299390ab.tar.gz
libADLMIDI-c9e841b5f1cd7afbdb2d6c3be610ae48299390ab.tar.bz2
libADLMIDI-c9e841b5f1cd7afbdb2d6c3be610ae48299390ab.zip
Failed attempt to fix two-voice instruments with same instrument ID
Still not working :-(
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r--src/adlmidi_midiplay.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 0b721e9..458e1b5 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -799,14 +799,14 @@ bool MIDIplay::realTime_NoteOn(uint8_t channel, uint8_t note, uint8_t velocity)
{
if(ccount == 1)
{
- if(i[0] == i[1]) break; // No secondary channel
-
+ if((i[0] == i[1]) && !pseudo_4op)
+ break; // No secondary channel
if(adlchannel[0] == -1)
break; // No secondary if primary failed
}
int32_t c = -1;
- long bs = -0x7FFFFFFFl;
+ int32_t bs = -0x7FFFFFFFl;
for(uint32_t a = 0; a < opl.NumChannels; ++a)
{
@@ -845,11 +845,10 @@ bool MIDIplay::realTime_NoteOn(uint8_t channel, uint8_t note, uint8_t velocity)
}
}
- long s = CalculateAdlChannelGoodness(a, i[ccount], channel);
-
+ int64_t s = CalculateAdlChannelGoodness(a, i[ccount], channel);
if(s > bs)
{
- bs = s; // Best candidate wins
+ bs = (int32_t)s; // Best candidate wins
c = static_cast<int32_t>(a);
}
}