Skip to content

feat(editor): the drums track is an ordinary arr:<idx> mixer/Tracks channel - #338

Merged
byrongamatos merged 1 commit into
mainfrom
mt-drums-p2b
Jul 21, 2026
Merged

byrongamatos merged 1 commit into
mainfrom
mt-drums-p2b

Conversation

@ChrisBeWithYou

Copy link
Copy Markdown
Contributor

PR2b of the drums-as-arrangement arc — stacked on #337 (base mt-drums-p2), which is stacked on #336#335.

What & why

Retire the legacy 'drums' mix-key singleton so the drums arrangement mixes on its own arr:<idx> channel — the same address every pitched part uses. The mixer strip, Tracks mix, band roster, and S.partMix key now all agree. This is the substrate the N-drums work (PR3/PR4) needs: two drum charts can't share one 'drums' slot; each drum arrangement now gets its own strip by index.

Deliberately narrow — holds the #337 invariant: S.currentArr stays pitched and the drum grid stays a mode (S.drumEditMode). Only the mix address moves. The drums arrangement's durable target id stays 'drums' (DRUM_TARGET_ID), so every tracks-row / stemLinks / delete / rename / selection hook that keys on it — and main.js's selectTrackSessionTarget/openTrackSessionTarget 'drums' branches — are untouched.

Also fixes a latent double-strip: #336 materialized the drums arrangement into S.arrangements but left _mixerPartsPure also synthesizing a 'drums' strip from the drum tab — so the mixer showed drums twice (arr:<idx> and 'drums'). The drums strip now comes solely from the arrangement pass.

Changes

  • mixer-panel.js_mixerPartsPure drops the synthesized 'drums' strip (drums ride the arrangement pass as arr:<idx>); new pure _mixerActivePartKeyPure maps drum-edit mode → arr:<drumIdx> (currentArr stays pitched); _mixerClapStatePure takes the drum index; _selectedStripKeyPure + the meter active-part resolve drums via the general id→index path (its id is 'drums').
  • track-session.js — the drum target's mixKeyarr:<drumIdx> (id stays 'drums'); DeleteDrumTabCmd saves/restores partMix['arr:<drumIdx>'] (re-derives the index on undo, robust to a shifted pitched count).
  • audio.js_bandPartsPure keys the drum band entry arr:<drumIdx> so the strip and engine agree; the band scheduler routes the type:"drums" arrangement to real GM percussion (_drumKitVoicesInWindow) before the clap-notes path (its own notes are empty), keeping the legacy "Drums"-named pitched-part clap path intact.
  • host.js / state.js — partMix key-convention docs.

Verification

  • JS 297/0, lint 0 err / 3 baseline, routes.py untouched. Five suites re-pointed to arr:<idx>; added a live-S clap-gate test and a _mixerActivePartKeyPure invariant test (drum mode → arr:<drumIdx>, currentArr ignored; drumIdx < 0 falls back).
  • Runtime-verified (Playwright, asdf_asdf.feedpak — the one library pack with drums): the mixer shows a single Drums strip keyed arr:1 (no 'drums' key, no double-strip); mute lights it (aria-pressed, real S.partMix) + status "its guide voice is silent"; solo lights it; the fader scales it (+0.0−10.5 dB); drums↔pitched round-trips cleanly.

⚠️ Stacked PR: base is mt-drums-p2 (#337). CI (ci.yml) is main-only, so checks won't run until the base retargets to main after #335#336#337 land.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@byrongamatos, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e413a9a-46e6-4524-82fb-13c581b2da36

📥 Commits

Reviewing files that changed from the base of the PR and between f60e5f8 and 9eb1fb3.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • src/audio.js
  • src/host.js
  • src/mixer-panel.js
  • src/state.js
  • src/track-session.js
  • tests/drum_arrangement.test.mjs
  • tests/drum_delete_undo.test.mjs
  • tests/drum_delete_undo_middle.test.mjs
  • tests/midi_playback.test.mjs
  • tests/mixer_panel.test.mjs
  • tests/stem_engine.test.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mt-drums-p2b

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@byrongamatos
byrongamatos changed the base branch from mt-drums-p2 to main July 21, 2026 11:34
…hannel (#338)

Includes review fix: make drum-tab delete undo a true inverse (renumber arr keys).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@byrongamatos
byrongamatos merged commit 1e5c56e into main Jul 21, 2026
3 of 4 checks passed
@byrongamatos
byrongamatos deleted the mt-drums-p2b branch July 21, 2026 11:39
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