Various engine bug fixes

This commit is contained in:
Jack Andersen
2016-05-19 01:03:38 -10:00
parent f2f11fee33
commit 3a8a9f0ef2
5 changed files with 12 additions and 5 deletions

View File

@@ -144,7 +144,14 @@ std::shared_ptr<Voice> Sequencer::ChannelState::keyOn(uint8_t note, uint8_t velo
return {};
/* Ensure keyoff sent first */
keyOff(note, 0);
auto keySearch = m_chanVoxs.find(note);
if (keySearch != m_chanVoxs.cend())
{
keySearch->second->keyOff();
keySearch->second->setPedal(false);
m_keyoffVoxs.emplace(std::move(keySearch->second));
m_chanVoxs.erase(keySearch);
}
std::shared_ptr<Voice> ret = m_parent.m_engine._allocateVoice(m_parent.m_audioGroup,
m_parent.m_groupId, 32000.0,