Skip to content

Add ChordSymbol.placement and MusicXML <harmony placement> round-trip#1868

Merged
mscuthbert merged 3 commits intomasterfrom
claude/elastic-maxwell-b4b3e0
Apr 17, 2026
Merged

Add ChordSymbol.placement and MusicXML <harmony placement> round-trip#1868
mscuthbert merged 3 commits intomasterfrom
claude/elastic-maxwell-b4b3e0

Conversation

@mscuthbert
Copy link
Copy Markdown
Member

@mscuthbert mscuthbert commented Apr 16, 2026

Summary

(AI-Assisted)

Fixes #1867.

  • Adds placement: str|None = None to Harmony so chord symbols, Roman numerals etc. can carry a staff-placement hint ('above' or 'below').
  • Exporter (m21ToXml.py): writes placement="above|below" on the <harmony> element when set, replacing the # TODO: attrGroup: placement stub.
  • Parser (xmlToM21.py): calls the existing setPlacement() helper to read the attribute back into cs.placement, replacing the matching TODO stub.

mscuthbert and others added 2 commits April 16, 2026 13:58
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>
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 17, 2026

Coverage Status

coverage: 93.063% (+0.004%) from 93.059% — claude/elastic-maxwell-b4b3e0 into master

- 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>
@mscuthbert mscuthbert merged commit 429d162 into master Apr 17, 2026
7 checks passed
@mscuthbert mscuthbert deleted the claude/elastic-maxwell-b4b3e0 branch April 17, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChordSymbol.placement not exported/imported to/from MusicXML (<harmony placement="...">)

2 participants