feat: round-trip harmony extras and figured-bass#201
Merged
Conversation
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28539 / 36623 |
| Functions | 74.4% | 6360 / 8549 |
| Branches | 50.7% | 22672 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 69.5% | 4880 / 7020 |
| Functions | 54.9% | 1479 / 2692 |
| Branches | 40.9% | 3973 / 9720 |
Core HTML report | API HTML report
Commit 3ca01633b076d3e3bbcea4103681cc93ef356f41.
Summary: The harmony-chord choice in the api ChordData only modeled the <root> alternative; <inversion>, the deprecated <function>, and the MusicXML 4.0 <numeral> were dropped on read and could not be written. This adds those fields to ChordData and wires read + write through DirectionReader and DirectionWriter. - ChordData gains: a HarmonyChordSource discriminator (root | numeral | function), functionText, the numeral fields (numeralRoot, numeralRootText, numeralAlter/hasNumeralAlter, numeralKey fifths + NumeralMode), and inversion/hasInversion. - DirectionReader::parseHarmony now branches on the HarmonyChordGroupChoice kind (it previously called asRoot() unconditionally) and reads inversion. The harmony-chord dispatch loop no longer filters to isRoot(), so numeral and function chords are no longer silently skipped. - DirectionWriter rebuilds root / numeral / function and inversion symmetrically. Test plan: - New src/private/mxtest/api/HarmonyExtrasApiTest.cpp: round-trip tests for inversion, function, and numeral (with numeral-alter and numeral-key). - make test (225 cases), make check, make test-api-roundtrip all pass.
Summary: <figured-bass> was read as flattened plain text into a WordsData direction (MeasureReader::parseFiguredBass) and never written back as <figured-bass>, so it was lost on round-trip. This adds an api type that models the element structurally and wires symmetric read + write. - New mx::api FiguredBassData (an ordered list of FigureData with optional prefix / figure-number / suffix, plus parentheses and an optional duration in ticks) and FigureData. Attached to DirectionData via a figuredBasses vector, so it is positioned and flushed at the right tick like harmony. - MeasureReader::parseFiguredBass now builds a FiguredBassData (figures, parentheses, duration) instead of the WordsData text stub. - DirectionWriter::createFiguredBassElements rebuilds <figured-bass> as a core::MusicDataChoice, emitted alongside harmony in getDirectionLikeThings. Scope: <figure> child <extend> and the figured-bass print/position formatting attributes are intentionally not modeled (kept lean); the round-tripped data is the figures' prefix/number/suffix text plus parentheses and duration. Test plan: - New src/private/mxtest/api/FiguredBassApiTest.cpp: round-trips multiple figures with prefix/number/suffix, and parentheses + duration. - make test (227 cases), make check, make test-api-roundtrip all pass.
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28539 / 36624 |
| Functions | 74.4% | 6360 / 8550 |
| Branches | 50.7% | 22672 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 71.2% | 5144 / 7227 |
| Functions | 56.5% | 1607 / 2843 |
| Branches | 42.4% | 4252 / 10037 |
Core HTML report | API HTML report
Commit 2b2518f69de1e94ab22e4f5ce959bdb0daacdff5.
Owner
Author
|
@copilot resolve the merge conflicts in this pull request |
Contributor
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28539 / 36624 |
| Functions | 74.4% | 6360 / 8550 |
| Branches | 50.7% | 22672 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 72.1% | 5326 / 7384 |
| Functions | 60.1% | 1819 / 3029 |
| Branches | 43.0% | 4445 / 10331 |
Core HTML report | API HTML report
Commit e5e408da8b43acbf38c3b48c89497af8d10d04b3.
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28539 / 36624 |
| Functions | 74.4% | 6360 / 8550 |
| Branches | 50.7% | 22672 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 72.1% | 5328 / 7390 |
| Functions | 60.1% | 1819 / 3029 |
| Branches | 43.0% | 4447 / 10333 |
Core HTML report | API HTML report
Commit 4432962f3ca945f20d05dc08a694b99fb93a0303.
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
Adds round-trip support for two previously-lossy harmony subsystems.
Figured-bass:
MeasureReader::parseFiguredBasswas emitting a plain-textWordsDatastub and never writing structured<figured-bass>back. NewFiguredBassDataholds an ordered list ofFigureData(prefix, figure number, suffix), parentheses flag, and duration.DirectionWriteremits<figured-bass>via a newcreateFiguredBassElementspath. Scoped out:<extend>and print/position attributes.Harmony extras:
ChordDataonly modeled<root>;<inversion>,<function>, and the MusicXML 4.0<numeral>were silently dropped.ChordDatagains aHarmonyChordSourcediscriminator,functionText, numeral fields, andinversion. The dispatch loop inDirectionReader::parseHarmonypreviously filtered toisRoot(), skipping function/numeral chords entirely; now it branches onHarmonyChordGroupChoice::Kind.DirectionWriterhandles all three variants symmetrically.Testing
HarmonyExtrasApiTest.cppcovers inversion, function, and numeral with alter and numeral-keyFiguredBassApiTest.cppcovers multi-figure with prefix/number/suffix, parentheses, and durationmake testpasses (227 cases),make checkpasses,make test-api-roundtripbaseline unchangedReferences
mx/apilayer. #159