From ae9f7b45c8fc80df08d85df029eebcd903a2d2fd Mon Sep 17 00:00:00 2001 From: Paulius Uza Date: Mon, 12 Jan 2026 13:40:45 +0200 Subject: [PATCH] Add AllNotesOff (CC 123) handling in MIDI.h Implement handling for AllNotesOff event to clear active voices. --- runtime/elem/builtins/MIDI.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/elem/builtins/MIDI.h b/runtime/elem/builtins/MIDI.h index d42191ab..f8eb59f5 100644 --- a/runtime/elem/builtins/MIDI.h +++ b/runtime/elem/builtins/MIDI.h @@ -75,6 +75,12 @@ namespace elem voiceMap[voiceIndex].lastModified = steadyClock + time; } } + + if (event.message.isAllNotesOff()) + { + // Clear all voices on CC123 AllNotesOff + voiceMap.empty(); + } }); steadyClock += ctx.numSamples;