feat: add Practice mode — play a tune's part on a real drum and get scored on your timing#151
Open
pliski wants to merge 6 commits into
Open
feat: add Practice mode — play a tune's part on a real drum and get scored on your timing#151pliski wants to merge 6 commits into
pliski wants to merge 6 commits into
Conversation
…t-off; Listen/Compose unchanged)
…calibration wizard
This was referenced Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
A new Practice tab. The user plays one instrument's part on a real drum into their microphone, and RoR Player scores their timing and accuracy against the tune.
How it works
src/services/onsetDetector*): an AudioWorklet computes RMS energy with an adaptive noise floor and emits an onset per detected drum hit.src/services/practiceEngine.ts): runs a count-in, then loops the tune (your part solo, or the band minus your part) and anchors a per-loop baseline on the real audio loop wrap.src/services/practiceScorer.ts): matches detected onsets against the expected timeline on an unrolled monotonic loop timeline, yielding per-stroke verdicts and a 0–100 score.src/ui/practice/): toolbar (tune/part/instrument/mode), a live score rail with a timing meter, the per-stroke partition highlight, and an acoustic-loopback latency calibration wizard.How to try it
Open Practice, pick a tune → part → instrument, put on headphones, press
Start, and play along after the count-in. Use ⚙ → Calibrate to measure your
audio latency.
Notes for reviewers
Needs a microphone and headphones (speaker bleed is counted as your hits).
The build emits a separately-served
onsetDetector.worklet-*.js— AudioWorklet code cannot be inlined.New dev-dependency:
@types/audioworklet(typings only).The Practice i18n namespace is intentionally English-only for now.
Additive / opt-in: shared components (
pattern-player,hybrid-sidebar) gained default-off props, so Listen and Compose are byte-unchanged.Companion documentation PR: docs: add Practice mode user guide ror-player-docs#1