fix: keep <tie> in serialized <note> children (#60) - #62
Merged
Conversation
The <note> constructor built its child list without the parsed ties, so every <tie> was dropped on serialization and a parse-then-write round trip lost the tie information. Add the ties to the child list in the slot the MusicXML content model gives them, between <duration> and <voice>. Co-authored-by: SheepYang1993 <15150244+SheepYang1993@users.noreply.github.com>
This was referenced Aug 7, 2026
Closed
3 tasks
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.
Closes #60. Replaces #61.
Problem
The
<note>constructor built its child list without the parsed ties, so every<tie>was dropped on serialization. Parse a file and write it back, and the tie information was gone.<tied>inside<notations>was never broken on its own — it disappeared for the same reason, because the parent<note>never carried the tie into its children at all.Fix
One line: add
...tiesto the child list, in the slot the MusicXML content model gives it, between<duration>and<voice>.Credit
@SheepYang1993 found this in #60 and wrote the same one-line fix in #61. That PR also added a
syncChildrenToXml()layer that re-appended the ties at serialize time, which moved<tie>after<stem>and broke the spec order, so this PR keeps only the constructor change. Thank you for the report and the fix.Test plan
dart test— 113 pass (3 new)dart analyze— cleandart format— no changesmainand pass here