More correct note handling logic

This commit is contained in:
xenakios 2019-01-17 19:35:11 +02:00
parent cf3c26989e
commit aa740528f5

View File

@ -784,15 +784,17 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M
{ {
if (midi_it.getNextEvent(midi_msg, midi_msg_pos) == false) if (midi_it.getNextEvent(midi_msg, midi_msg_pos) == false)
break; break;
if (midi_msg.isNoteOff() && midi_msg.getNoteNumber()==m_midinote_to_use)
{
m_midinote_to_use = -1;
break;
}
if (midi_msg.isNoteOn()) if (midi_msg.isNoteOn())
{ {
m_midinote_to_use = midi_msg.getNoteNumber(); m_midinote_to_use = midi_msg.getNoteNumber();
break; break;
} }
if (midi_msg.isNoteOff())
{
m_midinote_to_use = -1;
}
} }
if (m_midinote_to_use >= 0) if (m_midinote_to_use >= 0)
{ {