Commit 9129215
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments