-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format voices across staves and parts #183
Conversation
I realized that I made a modeling mistake, but this should be straightforward to fix. To properly format a new Formatter()
.joinVoices([voice1]) // part 1
.joinVoices([voice2]) // part 2
.joinVoices([voice3, voice4]) // part 3
.formatToStave([voice1, voice2, voice3, voice4], stave1); Currently, the model is:
With this structure, it's possible for a measure to know about its sibling part measures, but it has to originate from the system, the closest ancestor. I spent a great deal of effort to make The model I need is:
This allows measure fragments to format across all parts without having to pass around more context. This also simplifies |
You can joinVoices in steps, they are accumulative. And format and draw at the very end. |
This will break tests, but it's a necessary step to switch to the new hierarchy.
This PR fixes #181, fixes #182.
rendering.Part
as a child ofrendering.MeasureFragment
.rendering.Seed
, format voices across all parts as described in [BUG] (v0.0.0): Voices in a single part, but different staves are not formatted together #182 (comment). Make sure that thevexflow.Voice
objects are thrown away because we will resize the measures to fit the width given tovexml.Vexml.render
.rendering.MeasureFragment
to calculate it.render.Chrous
, use avexflow.Formatter
per stave to join the voices.vexflow.Formatter
per stave formatting to the first stave.vexml
multi_stave_single_part_formatting.musicxml
multi_part_formatting.musicxml