Skip to content

MusicXML export: move out-of-range octaves into 0-9 - #2105

Merged
mscuthbert merged 3 commits into
masterfrom
out-of-range-xml
Oct 25, 2026
Merged

mscuthbert merged 3 commits into
masterfrom
out-of-range-xml

Conversation

@mscuthbert

@mscuthbert mscuthbert commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

MusicXML only allows octaves 0–9. Notes below octave 0 or above 9 were written as-is, making invalid files. They now export at octave 0 or 9 with a MusicXMLWarning; the music21 pitch is unchanged. Covers notes, chords, unpitched display-octave, and shifted rests.

Add a skill about how music21 uses warnings (not consistently)

AI-assisted (Claude)

MusicXML only allows octaves 0-9; we wrote -1 or 10+ as-is, giving
invalid files. Clamp octave and display-octave (notes, chords, unpitched,
shifted rests) with a MusicXMLWarning.

AI-assisted (Claude)
@coveralls

coveralls commented Oct 25, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 93.387% (+0.002%) from 93.385% — out-of-range-xml into master

@mscuthbert
mscuthbert marked this pull request as ready for review October 25, 2026 04:00
Rename _octaveInRange to moveOctaveIntoMusicxmlRange. Its doctest now
records the warning instead of printing it to the console. Add the
warnings-and-environment skill, pointed to from AGENTS.md.

AI-assisted (Claude)
@mscuthbert
mscuthbert merged commit a65baee into master Oct 25, 2026
8 checks passed
@mscuthbert
mscuthbert deleted the out-of-range-xml branch October 25, 2026 04:17
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.

2 participants