feat(engraving): add configurable rest position settings#2693
Open
roscopeeco wants to merge 2 commits intoCoderLine:developfrom
Open
feat(engraving): add configurable rest position settings#2693roscopeeco wants to merge 2 commits intoCoderLine:developfrom
roscopeeco wants to merge 2 commits intoCoderLine:developfrom
Conversation
Adds `restPositionMain` and `restPositionSecondary` properties to `EngravingSettings`, allowing the vertical position of rests to be overridden per-voice via the `RestPosition` enum. The `RestPosition` enum provides named staff-line positions (Line1-Line5 and the spaces between) calibrated to a 5-line staff. Positions are adjusted automatically for staves with fewer than 5 lines using the formula `override - (5 - lineCount) * 2`. When either property is null (the default), rest positioning falls back to the existing auto-calculated behaviour so there is no change to existing scores. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
I'm thinking we could make this more granular and add per track settings for restPositionMain and restPositionSecondary. This would be done on a per track basis in the score...something like track.settings.restPositionMain etc. |
Adds RestPosition.test.ts with 21 visual tests covering: - Default rendering (single voice and multi-voice) with no settings applied - All RestPosition enum values for restPositionMain - All rest durations with an override applied - Multi-voice scenarios (both set, main only, secondary only) - Staff line counts 1-5 to verify the line count adjustment formula Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Just added a set of tests. There is one pre-existing issue that the second test shows. The image rest-position-default-multi-voice.png highlights the issue. The test doesn't apply any settings but in the image the secondary voice rest on bars 3 & 6 is above the staff |
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.
Issues
#2572
Fixes #
Proposed changes
Adds
restPositionMainandrestPositionSecondaryproperties toEngravingSettings, allowing the vertical position of rests to be overridden per-voice via theRestPositionenum.The
RestPositionenum provides named staff-line positions (Line1-Line5 and the spaces between) calibrated to a 5-line staff. Positions are adjusted automatically for staves with fewer than 5 lines using the formulaoverride - (5 - lineCount) * 2.When either property is null (the default), rest positioning falls back to the existing auto-calculated behaviour so there is no change to existing scores.
These changes are purely to the typescript source code.
Checklist
I've tested it using creating a restPositionMain setting in the playground/demo/control app (this was not included in the pr). The test just dealt with a 5 line staff case. If you are happy with the content of the changes but need test i can investigate your test suite to see how they should be applied.
Further details