Skip to content

Draw a theme's extract from its upbeat - #589

Merged
isc merged 1 commit into
mainfrom
claude/excerpt-pickup
Dec 5, 2026
Merged

isc merged 1 commit into
mainfrom
claude/excerpt-pickup

Conversation

@isc

@isc isc commented Dec 5, 2026

Copy link
Copy Markdown
Owner

What

An About note's bar link that starts at the first full bar of a score opening on a pickup now draws the pickup too. "The theme, bars 1–4" of the Nocturne Op. 9 No. 2 used to start on beat 1 of bar 1, without the B♭ upbeat the tune begins on; the Waltz Op. 69 No. 2's theme lost its F♯ the same way.

drawExcerpt (public/js/scoreExcerpt.js) starts at the pickup when the range begins at index 1 and OSMD marks bar 0 as ImplicitMeasure. Done in the drawer rather than by rewriting links to #m0-…: every note gets it, and a theme of eight bars plus its upbeat stays within the eight-bar cap of about.test.js. Für Elise's explicit #m0-4 draws the same as before.

Mid-piece returns of a theme keep starting at their bar: their upbeat is the end of the bar before, which an extract cannot draw in part.

Testing

  • New test/about_test.rb case: the Nocturne's "m. 1–4" draws five bars. 5 runs out of 5 on its own, and the whole suite (282 runs, 0 failures); npx vitest run green.
  • Checked in Chromium: Nocturne 1–4 → 5 bars, Op. 69 No. 2 1–8 → 9; no change where there is no pickup (BWV 846 and 847, Clair de lune, Gymnopédie) or where the pickup is numbered 1 (Waltz in A minor).

🤖 Generated with Claude Code

A note's link from the first full bar of a score that opens on a pickup
now draws the pickup too: "the theme, bars 1–4" of the Nocturne Op. 9
No. 2 starts on its B-flat, the Waltz Op. 69 No. 2 on its F-sharp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Preview supprimée (PR fermée). L'URL n'est plus accessible.

@isc
isc enabled auto-merge (squash) December 5, 2026 14:17
@isc
isc merged commit 06c165c into main Dec 5, 2026
6 checks passed
@isc
isc deleted the claude/excerpt-pickup branch December 5, 2026 14:41
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.

1 participant