Skip to content

Per-piece kit-profile calibration wizard #4

Closed

Description

@cchacs

Part of #2. Depends on #3 (device access).

The core feature: "hit each trigger to assign it to the drum sounds used in the song."

Flow:

  1. Resolve the distinct drum piece-ids actually used by the loaded song's active drum part, from the drum_tab message's kit[] (piece-ids are lib/drums.py PIECES keys — kick, snare, hh_closed, etc; see Drum chart consumption: drum_tab/drum_hits + multi-part support #6 for where this is read from).
  2. Walk the user through each piece not yet mapped in the active kit profile, one at a time: "Hit your " (use drum_tab.kit[].name, falling back to the title-cased piece-id).
  3. Listen on all open MIDI inputs (via Device access via the core midi-input capability domain #3's handle); capture the first qualifying note-on as { note, channel, logicalSourceKey }; show a confirm/retry step (mirroring input_setup's "✓ Got it" pattern) before advancing.
  4. Store into the active kit profile (see Kit profile persistence via settings.server_files #5 for persistence) under the piece-id key.
  5. Allow remapping a single piece without redoing the whole kit.

Edge cases to handle:

  • Same physical trigger captured for two different piece-ids (e.g. ambiguous pad) — warn and let the user choose which one keeps it, or allow an explicit one-trigger-to-many-pieces mapping if that's a real kit limitation (a cheap electronic kit may only have one cymbal pad covering crash+ride).
  • No MIDI device connected / midi-input domain unavailable — clear empty state, same tone as input_setup's fail-soft panel, with a path to skip and map later.
  • A song references a piece-id with no mapping yet mid-playback — surfaced as "unmapped," not a crash (see Live hit matching / scoring engine #7's scoring behavior for unmapped pieces).
  • Multiple devices contributing to one kit (kick pedal on device A, pads on device B) — the capture step must disambiguate by logicalSourceKey, not assume a single source.

Acceptance:

  • A fresh kit profile can be built end-to-end for a song with ≥5 distinct pieces using a single MIDI keyboard (velocity-sensitive keys standing in for pads) as a smoke test, since real e-kit hardware isn't available in CI.
  • Remapping one piece doesn't require re-walking the whole wizard.

Activity

  1. pullfrog commented on Oct 4, 2026

    @pullfrog
    Contributor
  2. pullfrog commented on Oct 6, 2026

    @pullfrog
    Contributor

    Implemented kit-profile calibration wizard for midi-drums:

    • Extended routes.py with kit profile persistence (active_kit, kit_profiles) including validation, sanitization, and new GET/POST /api/plugins/midi-drums/kit-profiles endpoints. Settings persistence follows existing patterns (atomic writes, bounded bodies, lock-protected RMW).
    • Added PIECES definitions, wizard UI in screen.html, wizard logic in screen.js to walk through required pieces from a loaded drum chart, capture MIDI hits tagged by logicalSourceKey, confirm/retry, remap single pieces, and warn on ambiguous trigger mappings.
    • Added wizard/mapping styles in assets/plugin.css. Python and JS syntax validated; changes committed and pushed.

    Changes are on branch pullfrog/4-kit-profile-calibration-wizard (pushed to origin). However, the commit also exists on main and origin/main are at the same commit, so there are no distinct commits to open a PR from the new branch against main.

    Task list (10/10 completed)
    • Understand the issue Per-piece kit-profile calibration wizard #4 requirements fully and what needs to be built in midi-drums plugin
    • Extend routes.py to add kit profile persistence (active kit profile, piece mappings)
    • Add drum pieces definition (PIECES) - define common drum piece types (kick, snare, hh_closed, etc.)
    • Extend UI (screen.html) to add calibration wizard section
    • Implement wizard logic in screen.js - walk through pieces, capture MIDI hits, handle edge cases
    • Add wizard UI wiring in screen.js (bind buttons, render steps, handle events)
    • Add assets/plugin.css styling for wizard UI
    • Handle edge cases: no devices, remap single piece, disambiguate ambiguous hits, etc.
    • Test and self-review with reviewfrog
    • Commit, push, create PR

    Pullfrog  | View workflow run | via Pullfrog | Using big-pickle (free) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions