feat(bridge): live MIDI dashboard panel — SSE wired end to end (#16)
Completes the parked MIDI feature (midimon.py + midistream.py were done/tested in 270a01d6; this wires them into the always-on Bridge). The "do better than a raw aseqdump in a terminal" monitor now lives in the web dashboard. server.py: a module-global MidiStream fan-out (lazy — opens aseqdump only while a tab is watching, closes on the last unsubscribe). Two GET routes: /api/midi/ports → list ALSA seq ports /api/midi/stream → Server-Sent Events of parsed events, ?port=addr to pick one. ThreadingHTTPServer gives each SSE connection its own thread, so blocking on the subscriber queue is fine; a ': ping' every 15 s holds the pipe open, and BrokenPipe/ConnectionReset on tab-close is swallowed and triggers unsubscribe. ui/index.html: a MIDI panel — port picker + connect/disconnect (EventSource) + rescan, and a live log. Rows are colour-coded by event (note-on green, note-off faint, control-change amber, pitch-bend magenta), show source/event/channel/ note-name and a velocity bar (val/127), newest on top, capped at 200. Never hue alone: the event word carries the meaning, colour reinforces (DESIGN principle 4). Verified end to end: systemd --user restart, /api/midi/ports lists the seq ports, /api/midi/stream emits ': connected' then live events, and the UI connects (green "live") and renders rows — no console errors. With no hardware controller attached the feed shows system/subscription events; note/CC rows appear once a controller port is selected and played.
Showing
Please
register
or
sign in
to comment