# MidiMessageSequence and note off messages

**URL:** <https://forum.juce.com/t/midimessagesequence-and-note-off-messages/65916>\
**Category:** General JUCE discussion\
**Created:** [April 24, 2025, 7:07pm UTC](https://forum.juce.com/t/midimessagesequence-and-note-off-messages/65916 "2025-04-24T19:07:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leehu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/leehu/32/3280_2.png) [@leehu](https://forum.juce.com/u/leehu)\
**Post date:** [April 24, 2025, 7:07pm UTC](https://forum.juce.com/t/midimessagesequence-and-note-off-messages/65916/1 "2025-04-24T19:07:46Z")

</div>

Hi, I wonder under the impression that there was something to add note off messages to all unmatched note on message but can’t seem to find this.

Was I imagining this?

Thx

---

<div class="post-metadata">

**Author:** ![bgporter](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bgporter/32/12710_2.png) [@bgporter](https://forum.juce.com/u/bgporter)\
**Post date:** [April 24, 2025, 7:30pm UTC](https://forum.juce.com/t/midimessagesequence-and-note-off-messages/65916/2 "2025-04-24T19:30:50Z")

</div>

Do you mean a JUCE API call, or CC123 (all notes off)?

---

<div class="post-metadata">

**Author:** ![cpr2323](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/cpr2323/32/18682_2.png) [@cpr2323](https://forum.juce.com/u/cpr2323)\
**Post date:** [April 24, 2025, 8:03pm UTC](https://forum.juce.com/t/midimessagesequence-and-note-off-messages/65916/3 "2025-04-24T20:03:40Z")

</div>

There is [MidiMesasgeSequence::updateMatchedPairs](https://docs.juce.com/master/classMidiMessageSequence.html#a84c73c931fad6357ea81af0323109606)

---

<div class="post-metadata">

**Author:** ![leehu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/leehu/32/3280_2.png) [@leehu](https://forum.juce.com/u/leehu)\
**Post date:** [April 25, 2025, 12:26pm UTC](https://forum.juce.com/t/midimessagesequence-and-note-off-messages/65916/4 "2025-04-25T12:26:16Z")

</div>

Yeah, thx - doesn’t actually add missing note off at the end tho. It’s no probs, was easy to implement, just thought it already existed somewhere.

---

<div class="post-metadata">

**Author:** ![cpr2323](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/cpr2323/32/18682_2.png) [@cpr2323](https://forum.juce.com/u/cpr2323)\
**Post date:** [April 25, 2025, 1:19pm UTC](https://forum.juce.com/t/midimessagesequence-and-note-off-messages/65916/5 "2025-04-25T13:19:19Z")

</div>

I was going to point to the post linked below as why it might be doing something different, but I realized only the copy ctor changed, not the `updateMatchedPairs` call.

> [@MidiMessageSequence copy constructor has incorrect hidden side-effect](https://forum.juce.com/t/midimessagesequence-copy-constructor-has-incorrect-hidden-side-effect/26988):
>
> I am manually managing the noteOffObject of the MidiEventHolder as made quite easy with the return value of addEvent (as mentioned in this post from 2012, [MidiMessageSequence and updateMatchedPairs](https://forum.juce.com/t/midimessagesequence-and-updatematchedpairs/8600/2)). But the copy constructor for MidiMessageSequence has a hidden side effect that breaks this, and actual produces a copy that may not be the same as the source (ie. has noteOffObject filled in, even if the source didn’t). The issue is that the copy constructor calls updateMatchedPairs(). I have a prop…
