Skip to content

fix(metronome): pickup-aware accents; remove study count-in (core owns it) - #23

Merged
byrongamatos merged 1 commit into
mainfrom
fix/metronome-pickup
Jul 23, 2026
Merged

fix(metronome): pickup-aware accents; remove study count-in (core owns it)#23
byrongamatos merged 1 commit into
mainfrom
fix/metronome-pickup

Conversation

@gionnibgud

Copy link
Copy Markdown
Contributor

What

Follow-up to #22, from a user report: on a 4/4 piano score that opens with a
pickup measure (two eighth notes), the metronome accents fell on the wrong
beats and the study count-in ran a full bar, so the pickup entered where the
downbeat was expected.

Three changes.

1. The pickup is now in the model. The notation JSON already marks it
("pickup": true on measure 0) and core streams the flag through untouched —
_buildScore just never read it. It now maps onto alphaTab’\s isAnacrusis,
so the bar is sized by its content instead of the declared time signature
(verified present in the pinned alphaTab 1.8.2).

2. The metronome no longer accents the pickup’\s click. A pickup is the
tail of an incomplete bar, so the first accent belongs to the first full
measure’\s downbeat. Everything else about the click track is unchanged.

3. The study-mode preroll count-in is removed — toggle, countdown,
pause→play edge tracking (_svWasAudioPaused / _svPrerollResuming), and
the staffview_preroll key. Core already owns a count-in
(countdownBeforeSong), and with both enabled they stacked at song start:
core counted four, then staffview paused and counted again. One count-in,
owned by core, is the right shape — a plugin-local second one has no way to
stay consistent with it. If someone wants study mode to opt out of the global
count-in, that is a core setting, not a re-added plugin countdown.

Study mode is otherwise untouched: it still gate-pauses and resumes, just
without its own clicks.

Note on the fix this does NOT include

The global count-in is still a hardcoded 4 clicks — it ignores the time
signature (a 3/4 song gets 4) and the pickup. That fix belongs in
feedBack/static/js/count-in.js and affects every instrument, so it is a
separate core PR rather than something to work around here.

The converter that produced the bad timeline in the first place is fixed in
got-feedBack/feedBack-plugin-musicxml-import#10 — existing packs need a
re-import for the accents to be right.

Testing

  • npm test118/118 pass. Two new cases in tests/metronome.test.js
    (pickup: first accent lands on bar 1, not the pickup; no pickup: first-beat
    accent unchanged); the count-in cases are removed with the feature.
  • Verified in the running app on the reported song.

Branch note

Rebuilt on current main rather than continuing feat/metronome, which
branched before #21 merged — continuing it would have reverted the
bass-only-cursor fix.

🤖 Generated with Claude Code

…s it)

- Map the notation JSON's pickup flag onto alphaTab's isAnacrusis so the
  model sizes measure 0 by content, not the declared time signature.
- Don't accent the pickup's metronome click: it is the tail of an
  incomplete bar, so the first accent belongs to the first full measure.
- Remove the study-mode preroll count-in (toggle, countdown, pause->play
  edge tracking): core's countdownBeforeSong is the single count-in;
  making it TS- and pickup-aware is a follow-up core PR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: gionnibgud <gionnibgud@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 59 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: a21a0c0a-a001-46cd-a941-6b12bc46c66b

📥 Commits

Reviewing files that changed from the base of the PR and between 3cf5b38 and f7d1dd1.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • screen.js
  • tests/metronome.test.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/metronome-pickup

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.

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