notepat: velocity-capture + pressure smoothing + NuPhy badge/gauge
Addresses two reported problems on the NuPhy HE keyboard:
1. Popping on sustained tones (esp. sine). Root cause: raw pressure
samples arrive at driver-specific ADC step rates and the sim loop
was writing every raw value straight into synth.update() each
frame, so discrete pressure steps produced audible clicks. Fix:
smooth pressure with a one-pole lowpass (α=0.20 ≈ 80ms time
constant) AND rate-limit synth.update() to changes > 0.5%. Retains
the expressive wobble; removes the pops.
2. Velocity not captured. Notes now stash their key-down pressure as
`entry.velocity`; the per-frame mix is `0.55·velocity + 0.45·
smoothed_pressure × master`. Initial hit dominates, live pressure
modulates — classic MIDI-like feel with a bit of aftertouch.
Also adds NuPhy presence detection + live sensor gauge:
- `lastAnalogKeyAt` / `lastAnalogPressure` bump on any key-down with
pressure strictly between 0 and 1 (digital keys stamp 1.0).
- Status bar renders a "nuphy" badge + two-row pressure gauge for 60s
after the last analog press. Top bar = echo of last press value
(fades over 2s); bottom bar = current max smoothed pressure across
all active analog notes. Tolerance ticks at 0.10 (soft threshold)
and 0.70 (high threshold) show where our envelope inflection points
are vs what the hardware is actually reporting.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>