feat: add score-part groups, measure-numbering multi-rest/system attrs, and swing to mx::api#333
feat: add score-part groups, measure-numbering multi-rest/system attrs, and swing to mx::api#333webern wants to merge 4 commits into
Conversation
…stem attrs, and swing
Adds the three mx::api gaps blocking rpatters1's original timesigs_composite-ref.musicxml
from the roundtrip baseline (the trimmed -modified variant was already pinned):
- PartData::groups models <score-part>/<group> (Finale-style MIDI/score groupings),
wired through PartReader/PartWriter.
- MeasureData gains measureNumberingMultipleRestAlways/Range (Bool) and
measureNumberingSystemRelation (new SystemRelation enum) for the <measure-numbering>
attributes beyond its text value, wired through MeasureReader/MeasureWriter and a new
Converter::convertSystemRelation bridge.
- SoundData::swing models <sound>/<swing> (straight vs. ratio, note type, style), wired
through SoundFunctions; SoundData.h's "intentionally not modeled" note is updated.
Also fixes data/rpatters1/timesigs_composite-ref.musicxml's music-font font-family to be
comma-space separated ("Maestro, engraved"), matching mx's normalized output -- the
unspaced original is semantically identical, so the fixture was corrected instead of the
writer.
timesigs_composite-ref.musicxml is now pinned in roundtrip-baseline.txt alongside the
existing -modified variant.
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28514 / 36642 |
| Functions | 74.3% | 6352 / 8553 |
| Branches | 50.7% | 22680 / 44751 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 81.2% | 6616 / 8152 |
| Functions | 68.1% | 2256 / 3313 |
| Branches | 49.8% | 5680 / 11401 |
Core HTML report | API HTML report
Commit eb2900a536754118e9ed6dd25fa4bbe3d5504c2e.
gen-quality
|
Quote the spec and explain that <score-part>/<group> is a Finale-style implementation detail (which version of a part: score/parts/sound/data), not the visual brace/bracket grouping (PartGroupData).
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28514 / 36642 |
| Functions | 74.3% | 6352 / 8553 |
| Branches | 50.7% | 22680 / 44751 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 81.2% | 6616 / 8152 |
| Functions | 68.1% | 2256 / 3313 |
| Branches | 49.8% | 5680 / 11401 |
Core HTML report | API HTML report
Commit dbea134b5aeb7b06efa8140d4f903be76978980f.
gen-quality
|
| <distance type="beam">7.5</distance> | ||
| </appearance> | ||
| <music-font font-family="Maestro,engraved" font-size="20.5"/> | ||
| <music-font font-family="Maestro, engraved" font-size="20.5"/> |
There was a problem hiding this comment.
No. This should be fixed for any affected file (that has a no-spaces csv pattern in this element) by correcting the "expected" side of the test comparison programmatically.
There was a problem hiding this comment.
Fixed in cc99979: the fixture is reverted to byte-identical with main ("Maestro,engraved", no space). Instead, the corert normalizeForComparison pipeline now re-spaces any comma-separated-text attribute (currently just font-family, the schema's only user of that type) to "item, item" on both sides of the comparison — new CommaSeparatedFields.h + normalizeCommaSeparatedFields, mirroring the existing stripZerosFromDecimalFields/DecimalFields.h pattern. This covers any file with an unspaced font-family list, not just this one.
Generated by Claude Code
…ness Addresses PR review feedback (#333): a no-space font-family list ("Maestro,engraved") failed the round-trip comparison against mx's normalized "Maestro, engraved" output. Editing the test fixture to add the space papered over the harness gap for one file; instead teach corert's normalizeForComparison pipeline to re-space any comma-separated-text attribute (currently just font-family, the schema's only user of that type) to "item, item" on both sides of the comparison, the way stripZerosFromDecimalFields already handles decimal spelling differences. The field list lives in the new CommaSeparatedFields.h, mirroring DecimalFields.h. Reverts data/rpatters1/timesigs_composite-ref.musicxml to byte-identical with main; the fixture no longer needs editing to pass.
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28514 / 36642 |
| Functions | 74.3% | 6352 / 8553 |
| Branches | 50.7% | 22680 / 44751 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 81.2% | 6616 / 8152 |
| Functions | 68.1% | 2256 / 3313 |
| Branches | 49.8% | 5680 / 11401 |
Core HTML report | API HTML report
Commit c86c448b9b853e24dd6190700f9728330e37f0c8.
gen-quality
|
The field was never read from or written to MusicXML: <defaults> has
no measure-numbering child in the schema (it only appears inside a
per-measure <print>), so there was no wire representation to wire up.
The comment already said as much ("TODO - this appears not to be
used anywhere, please do not use"). The real, working feature is
MeasureData::measureNumbering, which is measure-scoped to match how
<measure-numbering> actually appears in MusicXML, and is unaffected
by this removal.
Breaking: removes a public DefaultsData field.
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28514 / 36642 |
| Functions | 74.3% | 6352 / 8553 |
| Branches | 50.7% | 22680 / 44751 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 81.2% | 6616 / 8152 |
| Functions | 68.1% | 2256 / 3313 |
| Branches | 49.8% | 5680 / 11401 |
Core HTML report | API HTML report
Commit a48fb6d5d431945db3fb108c9ea958c061bd0800.
gen-quality
|
Human Summary
#268 introduced a test file that had a few more unsupported goodies in it. I want to support the file in full so this PR/commit adds:
Summary
data/rpatters1/timesigs_composite-ref.musicxml(the untrimmed original of the fixture thatmotivated the
TimeSignatureDataredesign in #268) carried three thingsmx::apididn't model:<score-part>/<group>, the<measure-numbering>multiple-rest-always/multiple-rest-range/systemattributes, and<sound>/<swing>. A trimmed-modifiedvariant was pinned instead sothe composite time-signature round trip could land in isolation. This PR adds the three missing
features so the original file passes too:
PartData::groups(std::vector<std::string>) models<score-part>'s repeatable<group>element, wired through
PartReader/PartWriter.MeasureData::measureNumberingMultipleRestAlways/measureNumberingMultipleRestRange(Bool)and
measureNumberingSystemRelation(newSystemRelationenum) model the<measure-numbering>attributes beyond its text value, wired through
MeasureReader/MeasureWriterand a newConverter::convertSystemRelationbridge.SoundData::swing(newSwingData/SwingNoteType) models<sound>/<swing>(straight vs.ratio, note type, style), wired through
SoundFunctions.cpp.SoundData.h's "intentionally notmodeled" comment is updated to drop
<swing>from the list.data/rpatters1/timesigs_composite-ref.musicxml'smusic-fontfont-familyis comma-only(
"Maestro,engraved"), which doesn't match mx's normalized comma-space output. Rather than editthe fixture, the corert
normalizeForComparisonpipeline now re-spaces any comma-separated-textattribute (currently just
font-family, the schema's only user of that type) to"item, item"onboth sides of the round-trip comparison (new
CommaSeparatedFields.h, mirroring the existingDecimalFields.h/stripZerosFromDecimalFieldspattern) — so the fixture stays byte-identical toits original form.
timesigs_composite-ref.musicxmlis now pinned inroundtrip-baseline.txtalongside the existing-modifiedvariant.Also removes
DefaultsData::measureNumbering(src/include/mx/api/DefaultsData.h), which wasdead code: MusicXML's
<defaults>element has nomeasure-numberingchild in the schema, so thefield could never be read from or written to a file. The real, working feature is
MeasureData::measureNumberingabove, which is measure-scoped to match how<measure-numbering>actually appears in MusicXML (inside a per-measure
<print>).Testing
ScorePartGroupApiTest.cpp(group round trip),SoundApiTest.cppswingcases,
MeasureDataTest.cppmeasureNumberingAttributesRoundTripmake test-api-roundtrip: 165 passed (of 165 pinned), including the newly-addedrpatters1/timesigs_composite-ref.musicxmlmake test: all tests passed (4831 assertions in 396 test cases)make check-core-dev: fmt-check and warning-free build both passmake test-core-dev: all corert tests passed (835 test cases)References