Repository navigation
MusicXML export: move out-of-range octaves into 0-9 - #2105
Merged
Merged
Conversation
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)
mscuthbert
marked this pull request as ready for review
October 25, 2026 04:00
AI-assisted (Claude)
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)
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.
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)