Update direction-note association algorithm #209
Merged
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.
Warning
This implementation is not completely correct and is not in its intended final state.
This PR renders part of
Prelude_No._1_BWV_846_in_C_Major.mxl
from #207 and adds it to thevexml
test suite.The voice creation algorithm (
rendering.Chorus
) now accounts for the direction's stave and voice. When a direction's voice is not specified, it defaults to the last voice rendered. When the algorithm encounters a new voice, the directions are flushed out and associated with the last encountered voice.However, when a direction is specified after the note it gets assigned to, it seems to signal that the direction should be applied to the end of the note when applicable, like in
vexflow.PedalMarking
objects. However, the current vexflow.PedalMarking API does not allow you to specify the leading or trailing edge of the "note duration" (not the graphic), so I would have to create a placeholder note to get it to render properly. I'm wary that this might make formatting more difficult, so I'm going to open an issue againstvexflow
instead to allow us to specify more drawing information forvexflow.PedalMarking
objects.vexml