Hi everyone,
Perhaps I completely misunderstand the purpose of MidiMessageSequence::updateMatchedPairs
but my assumption was that this function is supposed to “fix” note-on messages that do not have a matching note-off and therefore will cause a hanging note when played back in a sequencer.
I wrote this example piece of code below. After calling updateMatchedPairs
, nothing really changes in the sequence object even though I expected it to either remove the note-on or append a note-off (both could be reasonable solutions for fixing a hanging note).
juce::MidiMessageSequence sequence;
sequence.addEvent(juce::MidiMessage::noteOn(1, 60, 1.0f), 0);
DBG(sequence.getNumEvents()); // 1
sequence.updateMatchedPairs();
DBG(sequence.getNumEvents()); // 1
Could anyone explain to me what is going on here?
Thank you very much,
Jelle