diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2018-09-30 20:43:22 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2018-09-30 20:43:22 +0300 |
commit | 299f4614cf77862c3f20b6b95c56c91102d1e27a (patch) | |
tree | 82e77298d966a3295c88479ac3ae1abc5a1f84f8 /src/adlmidi_midiplay.cpp | |
parent | 204c483dee24a3053ba220e0cafb6e065a215813 (diff) | |
parent | 77e8b86be524edf42a7070e2b7a1f6f67d7cfaa8 (diff) | |
download | libADLMIDI-299f4614cf77862c3f20b6b95c56c91102d1e27a.tar.gz libADLMIDI-299f4614cf77862c3f20b6b95c56c91102d1e27a.tar.bz2 libADLMIDI-299f4614cf77862c3f20b6b95c56c91102d1e27a.zip |
Merge branch 'master' into stable
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 276a33d..1e1da07 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -141,7 +141,7 @@ MIDIplay::MIDIplay(unsigned long sampleRate): m_setup.maxdelay = 512.0 / (double)m_setup.PCM_RATE; m_setup.bankId = 0; - m_setup.numFourOps = 7; + m_setup.numFourOps = -1; m_setup.numChips = 2; m_setup.deepTremoloMode = -1; m_setup.deepVibratoMode = -1; @@ -198,9 +198,13 @@ void MIDIplay::applySetup() m_synth.m_volumeScale = (OPL3::VolumesScale)m_synth.m_insBankSetup.volumeModel; m_synth.m_numChips = m_setup.numChips; - m_synth.m_numFourOps = m_setup.numFourOps; m_cmfPercussionMode = false; + if(m_setup.numFourOps >= 0) + m_synth.m_numFourOps = m_setup.numFourOps; + else + adlCalculateFourOpChannels(this, true); + m_synth.reset(m_setup.emulator, m_setup.PCM_RATE, this); m_chipChannels.clear(); m_chipChannels.resize(m_synth.m_numChannels); @@ -1461,6 +1465,8 @@ void MIDIplay::killOrEvacuate(size_t from_channel, AdlChannel::LocationData *j, MIDIplay::MIDIchannel::activenoteiterator i) { + uint32_t maxChannels = ADL_MAX_CHIPS * 18; + // Before killing the note, check if it can be // evacuated to another channel as an arpeggio // instrument. This helps if e.g. all channels @@ -1470,7 +1476,7 @@ void MIDIplay::killOrEvacuate(size_t from_channel, { uint16_t cs = static_cast<uint16_t>(c); - if(c > std::numeric_limits<uint32_t>::max()) + if(c >= maxChannels) break; if(c == from_channel) continue; |