Skip to content

Four kinds of malformed MusicXML are still absorbed in silence #29

Description

@alessonqueirozdev-hub

Problem

parseMusicXML / scoreFromMusicXML accept an optional warnings list, so a partial import is no longer indistinguishable from a complete one. Coverage is not total, and this issue tracks the residue rather than letting the README carry it alone.

Re-probed for 2.8.0 over nine malformed documents:

Document Behaviour
<pitch> with no <octave> rejected — FormatException
unknown <step> rejected — FormatException
not a score at all rejected — FormatException
<divisions>0</divisions> warned
non-positive <duration> warned
unknown <clef><sign> SILENT
unknown <type> SILENT
non-numeric <alter> SILENT
missing <part-list> SILENT

Why the silent four matter

Each one changes what the score means without saying so. An unknown <clef><sign> silently keeps the previous clef, so every pitch after it is engraved on the wrong line. A non-numeric <alter> drops an accidental. An unknown <type> drops a duration. A missing <part-list> loses staff naming and grouping.

Acceptance criteria

  • Each of the four raises a warning naming the element and the offending value.
  • The decision between warn and reject is stated per case, not chosen ad hoc — the current rule is that a defect which makes the surrounding music unreadable rejects, and one that loses a detail warns.
  • A test per case, in the same shape as the existing malformed-document probes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginteropMusicXML, MEI and JSON import/export

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions