feat(editor): the drum kit — every chart piece plays its real sound - #282
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (22)
📝 WalkthroughWalkthroughAdds GM drum-kit sample assets, drum-specific loading and playback helpers, and scheduler integration for band and drum-grid guide events. Drum mappings, velocity behavior, vendored assets, and release notes are covered by tests and documentation. ChangesDrum playback
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant GuideScheduler
participant DrumPlayback
participant DrumAsset
GuideScheduler->>DrumPlayback: scan drum hits
DrumPlayback->>DrumAsset: lazy-load note sample
DrumAsset-->>DrumPlayback: expose WebAudioFont preset
DrumPlayback-->>GuideScheduler: schedule drum one-shot or clap fallback
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
byrongamatos
added a commit
that referenced
this pull request
Jul 15, 2026
…edupe set Two bugs in the GM drum kit (#282), both on the stateful guide path: 1. Velocity was flattened. `_drumKitVoicesInWindow` voiced every hit at a constant 0.75*scale, ignoring the authored per-hit velocity (drumTab `.v`). This contradicts the changelog's "hit velocity carries" and made ghost notes (v=35) play as loud as accents — in both band mode and the drum-edit guide. Root cause: fixed gain literal. Fix: new pure `_drumHitGainPure(v, scale)` normalizes v/127 (default 100 → 0.79, ~the old level) and scales; gmDrumVoiceAt still clamps the 0.05 floor. 2. Unbounded dedupe scratch. The new drum-edit guide path routes through `_bandFiredKeys` but the size>4096 guard lived only inside the band-mode branch, so a long drum-edit playback grew the set one key per hit. Moved the guard to end-of-tick so it bounds every voiced path. Regression test (tests/drum_kit.test.mjs): ghost < accent, default = 100/127, scale multiplies — fails against the old 0.75 constant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
byrongamatos
changed the base branch from
feat/editor-instruments-default
to
main
July 15, 2026 20:28
…GM percussion) Drums stop being a click. Every chartable piece voices its FluidR3 percussion one-shot — kick, snare + cross-stick, the three hats, four toms, both crashes, splash, china, ride + bell, cowbell — in band-mode playback AND inside the drum grid's own guide. - gm-guide.js: percussion naming pures (file 128<note>_0_..., global _drum_<note>_0_... — the '128' prefix drops from the variable name, pinned), DRUM_PIECE_GM_NOTE (the explicit inverse of the pad strip's GM_DRUM_MAP; 'stack' borrows the china — no GM home), and the drum loader/voice riding the melodic machinery through a disjoint 'drum:<note>' keyspace (same source chain, same adjustPreset). - audio.js: _drumKitVoicesInWindow — shared by the band branch's drums part (per-part gain target) and the drum-edit guide (guide bus + strip volume). Piece-scoped dedupe (kick + snare on one millisecond both sound); a not-yet-loaded piece ticks (never silent) while ensureGmDrum streams it. - Vendored the 17 one-shots behind the piece table (~900 KB) into assets/wafonts — the kit needs zero network; README provenance updated (FluidR3-only kept; the whitelist's 128NN_N form was already reserved for exactly this). tests/drum_kit.test.mjs (3 cases, fails on main): the naming contract, full piece coverage + GM_DRUM_MAP round-trip (stack exception pinned), and every voiced one-shot genuinely on disk. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
…edupe set Two bugs in the GM drum kit (#282), both on the stateful guide path: 1. Velocity was flattened. `_drumKitVoicesInWindow` voiced every hit at a constant 0.75*scale, ignoring the authored per-hit velocity (drumTab `.v`). This contradicts the changelog's "hit velocity carries" and made ghost notes (v=35) play as loud as accents — in both band mode and the drum-edit guide. Root cause: fixed gain literal. Fix: new pure `_drumHitGainPure(v, scale)` normalizes v/127 (default 100 → 0.79, ~the old level) and scales; gmDrumVoiceAt still clamps the 0.05 floor. 2. Unbounded dedupe scratch. The new drum-edit guide path routes through `_bandFiredKeys` but the size>4096 guard lived only inside the band-mode branch, so a long drum-edit playback grew the set one key per hit. Moved the guard to end-of-tick so it bounds every voiced path. Regression test (tests/drum_kit.test.mjs): ghost < accent, default = 100/127, scale multiplies — fails against the old 0.75 constant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
byrongamatos
force-pushed
the
feat/editor-drum-kit
branch
from
July 15, 2026 20:39
d6487e7 to
cda1786
Compare
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
Drums stop being a click. Every drum piece the editor can chart now plays its real sound — kick, snare and cross-stick, open/closed/pedal hi-hats, all four toms, both crashes, splash, china, ride and ride bell, cowbell — sourced from the same FluidR3 (MIT) family as the melodic instruments. It works in both places drums are heard:
Details that matter: two hits on the same instant (kick + snare) both sound (piece-scoped dedupe), hit velocity carries into the one-shot volume, and a piece whose sample is still streaming ticks for a moment instead of going silent (the guide's never-silent contract, per piece).
How
DRUM_PIECE_GM_NOTE— the explicit inverse of the pad strip'sGM_DRUM_MAP, so the chart, the pads, and the sound can never disagree about what a piece is. The one borrow (stack→ china's 52 — GM has no stack) is documented and pinned.drum:<note>keyspace — same three-rung source chain (plugin → org → CDN), sameadjustPreset, no new machinery./wafontwhitelist's128NN_Nform was reserved for exactly this since the README was written; the FluidR3-only provenance contract is kept and every file is listed._drumKitVoicesInWindowis one shared scheduler used by both call sites (band-mode per-part gain target vs guide bus + drum-strip volume).Testing
tests/drum_kit.test.mjs(3 cases, fails on main): the webaudiofontdata naming contract (the128prefix drops from the variable name — easy to get wrong), full piece coverage with theGM_DRUM_MAPround-trip, and every voiced one-shot genuinely on disk. Full gates green: 161 files / 0 fail, lint at baseline,test_wafont_route.py4/4 (the whitelist already admits the drum form).🤖 Generated with Claude Code
https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
Summary by CodeRabbit