Skip to content

Commit 9129215

Browse files
jcelerierclaude
andcommitted
ui: add a MIDI display process
A scrolling piano-roll monitor for whatever goes through a MIDI port, meant for debugging note lifetimes. A note whose note-off never arrives is drawn as a bar that does not end - amber while held, red hatched past two seconds - and counted in a "STUCK" readout. Note-ons on an already-held note and note-offs for notes that were not held are flagged too, since those are what a broken note-off path looks like from the outside. Non-note messages get a colour-coded lane at the bottom, and the context menu copies the decoded, timestamped log. Two things drove the design: The engine -> UI transport for control outputs is lossy: the queue is drained keeping only its last entry, polled on coarseUpdateTimer, so at ~40 ticks/s against a ~10Hz poll most ticks never reach the UI. Pushing "the events of this tick" would silently invent missing note-offs. The node instead keeps a ring of the last second of events and pushes all of it every time, with a per-event sequence number the layer uses to append only what it has not seen. Note pairing is done in the node rather than the layer. The layer only ever holds a window and is rebuilt when playback restarts; deriving pairing from a window reports every note-on whose note-off fell before it as stuck, and every note-off whose note-on fell before it as unmatched. Both are artifacts of the window. The node has seen the whole stream, so it computes the flags and the held/stuck counts and ships them alongside the events. No pass-through outlet: MIDI outlets fan out, so it taps a chain without interrupting it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 916fe0e commit 9129215

3 files changed

Lines changed: 823 additions & 0 deletions

File tree

src/plugins/score-plugin-ui/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ endif()
77

88
add_library(
99
score_plugin_ui
10+
"${CMAKE_CURRENT_SOURCE_DIR}/Ui/MidiDisplay.hpp"
1011
"${CMAKE_CURRENT_SOURCE_DIR}/Ui/SignalDisplay.hpp"
1112
"${CMAKE_CURRENT_SOURCE_DIR}/Ui/TextBox.hpp"
1213
"${CMAKE_CURRENT_SOURCE_DIR}/Ui/ValueDisplay.hpp"

0 commit comments

Comments
 (0)