feat: support multi-note tremolos in mx::api#330
Open
webern wants to merge 1 commit into
Open
Conversation
Add MarkType::tremoloStart/tremoloStop plus MarkData::tremoloMarks (the slash count, 0-8) so a <tremolo type="start"/"stop"> pair spanning two adjacent notes can be authored and round-tripped. The existing tremoloSingleOne..Five glyph marks are unchanged. Pairing across notes is left to the api consumer via document order, matching the isTieStart/ isTieStop precedent -- MusicXML's <tremolo> has no `number` attribute to key off of. Closes #329.
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28513 / 36642 |
| Functions | 74.3% | 6352 / 8552 |
| Branches | 50.7% | 22678 / 44751 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 80.9% | 6437 / 7956 |
| Functions | 68.1% | 2230 / 3276 |
| Branches | 49.7% | 5525 / 11122 |
Core HTML report | API HTML report
Commit 0f5c38ddfffa33ff61e573490bf363e32ab9f2a6.
gen-quality
|
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.
Human Summary
That MarkData class is already a hodgepodge of things that are only applicable if the markType happens to correspond to it. It is not nice, and this extended the pattern. Not sure about this one but it is a quick path to making the feature reachable.
Summary
mx::apicould represent single-note (glyph) tremolos but silently dropped the measured, two-noteform written as
<tremolo type="start">/<tremolo type="stop">on adjacent notes. This adds it.MarkTypegainstremoloStartandtremoloStop, marking the first and second note of ameasured tremolo. The existing
tremoloSingleOne..Fiveglyph marks are unchanged.MarkDatagainstremoloMarks(std::optional<int>), the slash count (0-8) for the new marktypes. The
tremoloSingle*marks keep encoding their count in the enumerator itself, as before.<tremolo>has nonumberattribute (unlike slur/tie), so there is nothing to key across-note match on. Pairing the start on one note with the stop on a later note is left to the
api consumer via document order, the same way
NoteData::isTieStart/isTieStopalready work.OrnamentsFunctions.cpp(read) andNotationsWriter.cpp(write) are updated symmetrically;isMarkTremolo/isMarkOrnamentinclude the two new mark types. Unmeasured tremolos are stillnot representable and continue to be dropped as before.
Testing
NoteDataTest.cpp: an in-memory round trip of two adjacent notes carryingtremoloStart/tremoloStopmarks, and a read test againstdata/synthetic/tremolo.3.0.xmlmake test: all pass (4745 assertions in 382 test cases, plus the three examples)make test-api-roundtrip: 159 passed, 0 failed (of 159 pinned; no regressions)make discover-api-roundtrip: no newly-attributable passes; the two corpus files with realstart/stop tremolo content (
musuite/testTremolo.xml,lysuite/ly23e_Tuplets_Tremolo.xml)still fail on unrelated pre-existing subset gaps (an
identification/rightsmismatch and atime-modificationgap, respectively), so noroundtrip-baseline.txtentry was addedmake fmt/make checkcleanReferences
mx::api#329