fix: write arranger and publisher, add page-text enclosure - #390
Merged
Conversation
rpatters1
force-pushed
the
api-metadata-and-credit-enclosure
branch
from
August 7, 2026 03:00
ad41a10 to
b29df45
Compare
Three small gaps from Denigma's mx::api gap list, each confined to mx::impl plus one new field. ScoreData::arranger and ScoreData::publisher existed with equality members but nothing in mx::impl ever touched them. ScoreReader read an incoming <creator type="arranger"> into ScoreData::lyricist, so a file carrying both an arranger and a lyricist lost the lyricist, and ScoreWriter then re-emitted the arranger's text mislabelled as type="lyricist". Both now read into their own field (first of each type wins, as the api has one slot) and are written on the same path as composer and lyricist. <credit-words> is type formatted-text-id, the same core class as <words> and <rehearsal>, so it carries the whole text-formatting group. core::FormattedTextID already exposes enclosure()/setEnclosure() and Converter already has both directions; only the api field was missing. PageTextData gains Enclosure enclosure, converted in both directions in PageTextFunctions.cpp beside the existing justify handling. SpannerNumberResolver's comments claimed <pedal> has no number attribute. That was true through MusicXML 3.0; 3.1 added it. Pedals stay out of number resolution because mx::api does not model the attribute -- behaviour unchanged, only the stated reason corrected.
rpatters1
force-pushed
the
api-metadata-and-credit-enclosure
branch
from
August 7, 2026 03:04
b29df45 to
8816a0a
Compare
webern
approved these changes
Aug 7, 2026
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
This is a omnibus PR that cleans up some minor issues.
PageTextDataSummary
Three small gaps in
mx::api, collected into one fix-up PR. Each is confined tomx::implplus a single new field; none needs a new API model.Arranger and publisher were accepted but never written.
ScoreData::arrangerandScoreData::publisherhave existed, with equality members, but nothing inmx::implever touched them -- a scan of everyMXAPI_EQUALS_MEMBERname againstsrc/private/mx/impl/showed these two as the only dead public fields. Worse than dead:ScoreReaderread an incoming<creator type="arranger">intoScoreData::lyricist, so a file carrying both an arranger and a lyricist lost the lyricist, andScoreWriterthen re-emitted the arranger's text mislabelled astype="lyricist". Both now read into their own field and are written beside composer and lyricist. Where a file has several creators of one type (recsuite/Echigo_Jishi.xmlhas two arrangers) the first wins, since the api has one slot.Before, on
musuite/testMetaData.xml:lyricist == "MetaArranger",arranger == "", and the round trip emitted<creator type="lyricist">MetaArranger</creator>. After: composer, lyricist and arranger each land in their own field and are rewritten with the right type.Page text carried no enclosure.
<credit-words>is typeformatted-text-id, the same core class as<words>and<rehearsal>, so it carries the wholetext-formattingattribute group.core::FormattedTextIDalready exposesenclosure()/setEnclosure(), andConverteralready has both directions from #378, so only the api field was missing.PageTextDatagainsEnclosure enclosure, converted in both directions inPageTextFunctions.cppbeside the existingjustifyhandling -- the same shape #273 used for justify.A stale comment about
<pedal>.SpannerNumberResolverasserted in two places that<pedal>has nonumberattribute. True through MusicXML 3.0; 3.1 added it andcore::Pedalsupports it. Pedals still stay out of number resolution, becausemx::apidoes not model the attribute -- behaviour unchanged, only the stated reason corrected.Testing
DocumentManagertests: all four creator types survive a round trip independently and serialize with the righttype, and a read ofmusuite/testMetaData.xmlkeeps composer, lyricist and arranger apart. The second fails before the fix (lyricistcomes back asMetaArranger).ROUND_TRIP_TEST_SCALARentries forarrangerandpublishercreditRoundTriptests:enclosure="rectangle"survives, an explicitnonesurvives, and an unset enclosure writes no attribute and reads backunspecifiedmake api-roundtrippasses (363 of 363 pinned)make api-roundtrip-discoverstill shows 363 PASS -- no file changed status, so the baseline is untouchedmake core-roundtrip-testpasses (839 test cases)make core-unitpasses (212 assertions in 41 test cases)make fmt-checkclean on touched filesNo corpus files added or removed, so no pinned-count bump and no audit regeneration.
References
justify) and fill <credit> gaps in mx::api (credit-image, no-words credits, multiple credit-type) #187 (credit gaps) -- same family, and the enclosure work follows the pattern both establishedEnclosureenum