Add ChordSymbol.placement and MusicXML <harmony placement> round-trip#1868
Merged
mscuthbert merged 3 commits intomasterfrom Apr 17, 2026
Merged
Add ChordSymbol.placement and MusicXML <harmony placement> round-trip#1868mscuthbert merged 3 commits intomasterfrom
mscuthbert merged 3 commits intomasterfrom
Conversation
Fixes #1867. The `placement` attribute ('above', 'below', or None) is now: - stored on Harmony objects (harmony.py) - exported as a placement attribute on <harmony> in m21ToXml.py - imported back via setPlacement() in xmlToM21.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- intervalNetwork.py: annotate postPairs/prePairs as list[tuple[Pitch, Terminus|int]] so the inferred type matches non-terminus nodes appended in the collect branch - partStaffExporter.py: assert isinstance(part_staff, stream.PartStaff) to narrow the type from Music21Object (Spanner iteration) to PartStaff Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
(AI-Assisted)
Fixes #1867.
placement: str|None = NonetoHarmonyso chord symbols, Roman numerals etc. can carry a staff-placement hint ('above'or'below').placement="above|below"on the<harmony>element when set, replacing the# TODO: attrGroup: placementstub.setPlacement()helper to read the attribute back intocs.placement, replacing the matching TODO stub.