Skip to content

Live hit matching / scoring engine #7

Closed

Description

@cchacs

Part of #2. Depends on #3 (device access), #4 (kit profile mapping), #6 (chart data).

During playback, resolve each incoming MIDI note-on through the active kit profile to a piece-id, then match it against the nearest expected drum_tab hit for that piece within a timing window.

Design:

  • Tolerance window: reuse drum_highway_3d's HIT_TOLERANCE_S = 0.05 (±50ms) convention so timing feel is consistent across the two plugins.
  • Timing classification: mirror drum_highway_3d's _classifyTiming (EARLY/OK/LATE at 40% of the tolerance window) rather than inventing a different curve.
  • Track hit/miss/streak/timing-error per piece and overall, following the shape of other instrument scorers in this ecosystem (notedetect's recordJudgment is the reference, but do not take a hard dependency on notedetect internals — this is a MIDI-only plugin and notedetect is pitch-detection-flavored; duplicate the small matching primitive instead of coupling to it, per the scoping discussion).
  • A MIDI hit that resolves to a piece-id with no corresponding chart note nearby is an extra/unexpected hit — decide and document how this affects scoring (likely: no penalty for v1, just not counted as a hit — avoid punishing fills/ghost taps that aren't in a simplified chart).
  • A MIDI hit on an unmapped piece-id (song references a piece the user's kit profile doesn't cover) should be visible to the user as a "needs mapping" state, not silently dropped — surface it the same way gp2rs.convert_drum_track_to_drumtab's out_unmapped does for conversion-time unmapped notes (count + sample timestamps), so the calibration wizard (Per-piece kit-profile calibration wizard #4) can prompt to fill the gap next time.

Acceptance:

  • Hit/miss/timing-error counts are correct against a known-good recorded take (manual test with a MIDI keyboard standing in for a kit, since CI has no real hardware).
  • An unmapped piece is surfaced, not silently dropped.
  • Switching kit profiles mid-song (user realizes they picked the wrong profile) doesn't require a song reload.
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