Repository navigation
Size the gap between staves to the chords in each system - #9
Merged
Merged
Conversation
The sheet reserved room for the note-name pills by widening every staff gap by the biggest chord in the whole piece, so one 4-note chord spread every system apart. Now OSMD's bottom line is lowered only under each chord by its own stack of pills, so the gap follows what each system actually holds. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014oVTjqwWe51bFsyUnDqaeJ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Requested by Paul · project thread
Before: with note names on, the sheet left room under every staff for the biggest chord anywhere in the piece. One 4-note chord pushed the treble and bass staves apart in every system, even where both hands only play single notes.
After: each staff gets only the room its own chords' name pills need, measured under each chord. Simple passages stay tight, and the gap grows only in systems that hold big chords. With names on, the full Für Elise sheet is 24% shorter (7,436 to 5,687 px at 1440 wide) and the full Gymnopédie No. 1 from #7 is 17% shorter. Pieces with single notes look the same as before.
How:
SheetViewno longer adds a constant to OSMD'sMinSkyBottomDistBetweenStaves/MinSkyBottomDistBetweenSystems.reservePillSpacewraps two steps of OSMD's layout calculator. After the sky/bottom lines are computed, it records how low each staff line's notes reach. After fingerings, dynamics and pedals are placed (just before OSMD spaces the staves), it lowers the bottom line under each staff entry by that entry's stack of pills. OSMD's own staff-distance optimisation then does the rest. The pill overlay draws from the same recorded depth, so the pills land in the reserved space.Checked:
npm run typecheck,npx vitest run(108 passed, 5 skipped),npm run build, and the full Playwright suite (10 passed). I compared before/after screenshots of Für Elise (Full), Gymnopédie No. 1 (Full, with #7 applied locally) and the Prelude in C with note names on, and saw no page errors.🤖 Generated with Claude Code
https://claude.ai/code/session_014oVTjqwWe51bFsyUnDqaeJ
Generated by Claude Code