Skip to content

feat: notehead parentheses and color in mx::api - #473

Open
webern wants to merge 1 commit into
m/mxdev-figextendfrom
m/mxdev-nhparen
Open

webern wants to merge 1 commit into
m/mxdev-figextendfrom
m/mxdev-nhparen

Conversation

@webern

@webern webern commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

<notehead> lost its parentheses and color attributes, and on a normal notehead the whole
element vanished, because the writer only emitted <notehead>normal</notehead> when filled or a
SMuFL glyph was set.

NoteData gains two fields next to noteheadFilled and noteheadSmufl:

  • Bool noteheadParentheses (unspecified writes nothing; yes/no are written as given)
  • std::optional<ColorData> noteheadColor (empty means the notehead takes the note's color),
    following the newer optional-color precedent (DampData, TempoData, ...)

NoteWriter::setNotehead still skips the element when nothing is set, and now writes a normal
notehead when either new field is set. Additive; plain fields rather than a notehead struct,
because grouping would break the released noteheadFilled and noteheadSmufl.

data/api.features.xml marks notehead parentheses as supported, and corrects filled from
partial to yes (stale since noteheadFilled was added).

Two corpus files now round-trip and are pinned:

  • lysuite/ly22d_Parenthesized_Noteheads.xml
  • musuite/testNoteheads.xml

Still not modeled: notehead font attributes (which keep synthetic/notehead.* failing), and an
explicit <notehead>normal</notehead> with no attributes is still dropped (ly22a).

Testing

  • New NoteDataTest cases for parentheses yes/no (including parentheses="no" on a normal
    notehead), color on normal and non-normal noteheads, and equality; default and synthetic-file
    tests extended
  • make api-test passes (6300 assertions in 740 test cases)
  • make api-roundtrip passes, 454 of 454 pinned files
  • make api-roundtrip-discover: 454 pass, against 452 on the commit below; no file lost its pass
  • make fmt-check passes

References

@webern webern added feature new feature request non-breaking fixes or implementation that do not require breaking changes api Affects the mx::api layer impl Affects the mx::impl layer ai Issues opened by, or through, a coding agent. labels Oct 28, 2026
@webern
webern added this pull request to stack #475 October 28, 2026 20:08
@webern webern changed the title feat: round-trip notehead parentheses and color in mx::api feat: notehead parentheses and color in mx::api Oct 30, 2026
@webern
webern marked this pull request as ready for review October 30, 2026 08:03
<notehead> has parentheses and color attributes that mx::api could not
hold. A parenthesized notehead (the usual ghost-note mark) lost its
parentheses, a colored one lost its color, and on a normal notehead the
whole element disappeared.

NoteData gains noteheadParentheses (a Bool) and noteheadColor (an
optional ColorData). The reader fills them, and the writer emits
<notehead> for a normal notehead whenever either is set. The defaults
leave output unchanged.

lysuite/ly22d_Parenthesized_Noteheads.xml and musuite/testNoteheads.xml
now round-trip and are pinned in the baseline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Issues opened by, or through, a coding agent. api Affects the mx::api layer feature new feature request impl Affects the mx::impl layer non-breaking fixes or implementation that do not require breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant