Repository navigation
feat: figured-bass extend lines in mx::api - #472
Merged
Merged
Conversation
5 tasks done
webern
marked this pull request as ready for review
October 30, 2026 08:00
A figured-bass <figure> can end with <extend/>, the continuation line that carries a figure across the bass notes that follow. mx::api dropped it on read, so a figure holding only an extend came back as an empty <figure/>. FigureData gains std::optional<FigureExtend> extend. Absent means no line. FigureExtend::type is a FigureExtendType whose unspecified value is a bare <extend/>; start, continue_ and stop write the matching type attribute. musuite/testFiguredBass2.xml now round-trips and is pinned in the baseline.
webern
force-pushed
the
m/mxdev-figextend
branch
from
October 30, 2026 08:15
0b73025 to
47453af
Compare
webern
added a commit
that referenced
this pull request
Nov 1, 2026
## 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 - [x] 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 - [x] `make api-test` passes (6300 assertions in 740 test cases) - [x] `make api-roundtrip` passes, 454 of 454 pinned files - [x] `make api-roundtrip-discover`: 454 pass, against 452 on the commit below; no file lost its pass - [x] `make fmt-check` passes ## References - Stacked on #472 - Related to #183 (earlier notehead values in `mx::api`)
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.
Summary
A figured-bass
<figure>can end with<extend/>, the continuation line that carries a figureacross the bass notes that follow.
mx::apidropped it on read, so a figure holding only anextend came back as an empty
<figure/>.FigureDatagainsstd::optional<FigureExtend> extend. Absent means no line.FigureExtend::typeis aFigureExtendTypewhoseunspecifiedvalue is a bare<extend/>;start,continue_andstopwrite the matching type attribute. Additive; existing callers areunaffected.
Why this shape: "no line" and "a line with no type" are different facts (every extend in the
corpus file is the bare kind), AGENTS.md rules out
std::optional<SomeEnum>, and ahasExtend+ type pair likeLyricData's can contradict itself. The one-field struct leaves roomfor the
<extend>position and color attributes, which are not modeled yet (none appear in thecorpus).
FigureExtendTyperepeatsLyricExtendType's values rather than reusing a lyric-namedtype.
musuite/testFiguredBass2.xmlnow round-trips and is pinned. It also needs #471, which puts alater staff's leading
<figured-bass>after the<backup>.Testing
FiguredBassApiTestcases: round trip, extend-only figure, all four types, written XMLfor every form plus no extend, and equality
make api-testpasses (6271 assertions in 735 test cases)make api-roundtrippasses, 452 of 452 pinned filesmake api-roundtrip-discover: 452 pass, against 451 on the commit below; no file lost its passmake fmt-checkpassesReferences
mx::api)