notepat: UDP MIDI status badge — sibling to USB MIDI, pulses green on send
Rewrote the relay status indicator to read as the obvious sibling of the
existing "USB MIDI ON/OFF" badge in the top status bar. States:
disabled (no broadcast in /mnt/config.json) "UDP MIDI OFF" FG_DIM
broadcast enabled, socket not connected "UDP MIDI ..." amber
socket up, no notes sent yet "UDP MIDI ON" dim green
socket up, sending notes "UDP MIDI ON 60v100 ▸ 42"
pulsing green
The color pulses between dim green (100,220,140) and bright green
(160,255,190) on each note send, decaying back over ~1.5s via a new
udpMidiSendRecency() helper. Rapid play visibly lights the indicator
rather than sitting on a static "connected" state — makes it obvious
at a glance that notes are actually flowing through the UDP socket,
not just that the socket opened successfully.
Audit note: verified the end-to-end flow is correct:
rememberSound() → noteToMidiNumber(note, octave) = (oct+1)*12+idx
→ sendUdpMidiEvent() → udp.sendMidi() C binding
→ udp-client.c emits JSON {type:"notepat:midi", note, velocity, ...}
→ session-server fanouts via WebSocket `notepat:midi`
→ notepat-remote.mjs handleRelayEvent() receives ev.note/velocity
→ emitMaxNote() → send("daw:midi", {pitch, velocity, channel})
→ bios.mjs forwards to window.max.outlet("note", pitch, vel)
→ Max patcher [route note channel] → [noteout]
Middle C (note "c" octave 4) correctly maps to MIDI pitch 60 at every
hop, velocity is scaled 1..127, channel 0 passes through untouched.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>