Skip to content

Claude/general midi boop audit j8u0ks - #1885

Merged
glloq merged 2 commits into
mainfrom
claude/general-midi-boop-audit-j8u0ks
Aug 2, 2026
Merged

Claude/general midi boop audit j8u0ks#1885
glloq merged 2 commits into
mainfrom
claude/general-midi-boop-audit-j8u0ks

Conversation

@glloq

@glloq glloq commented Aug 2, 2026

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits August 2, 2026 23:37
Previously the paired BLE-MIDI list was in-memory only, so an offline-first
Raspberry Pi forgot every Bluetooth instrument on reboot, and an unexpected
drop was never recovered.

- New migration 031 + BluetoothDB table: paired devices persist (address,
  name, auto_reconnect, last_connected_at).
- BluetoothManager persists on connect, removes on unpair, restores the list
  on startup, and opportunistically reconnects auto-reconnect devices.
- Unexpected drops (out of range / powered off) trigger a bounded,
  backing-off reconnect (2s→30s, 5 attempts); a deliberate disconnect/unpair
  does not. All reconnect timers are cleared on cleanup.

Guarded so tests / DB-less runs are unaffected. New integration test covers
persist → restore, unpair removal, reconnect-on-unexpected-drop, and
no-reconnect-on-deliberate-disconnect. Backend 1320 green; lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoexTLbJhezUpFHKKq85BP
Discrete instruments (kalimba, handpan, tuned percussion) declare a
`selected_notes` set in 'discrete' note-selection mode — the only pitches they
can physically produce — but nothing consumed it at playback, so off-set notes
were sent verbatim and simply didn't sound.

The scheduler now snaps each played note (after range folding) to the nearest
value in `selectedNotes`, ties breaking downward; the GM drum channel is
exempt, and instruments without a discrete set are untouched. `selected_notes`
flows through CapabilityResolver → PlaybackSnapshot only when the instrument is
in 'discrete' mode with a non-empty list (no key/root guessing).

Left unimplemented deliberately: octave_mode's diatonic/pentatonic scale
snapping (needs an instrument key/root the schema doesn't carry — would alter
music on a guess), and the hand-shift travel-time anticipation (kept as
documented future work rather than wired blindly or deleted).

New test: discrete-note snapping. Backend 1324 green; typecheck/lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoexTLbJhezUpFHKKq85BP
@glloq
glloq merged commit 73614ef into main Aug 2, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants