feat: full MusicXML key-mode support in mx::api - #380
Open
rpatters1 wants to merge 1 commit into
Open
Conversation
KeyMode covered only major and minor; every other <mode>, including none, read as unsupported and wrote nothing. Expand it to the ten standard MusicXML modes and route both directions through a Converter bridge table. - unspecified still writes no <mode>; none writes <mode>none</mode> - zero fifths implies no mode: C major, A minor, none, and unspecified stay distinct - unsupported is retained for out-of-vocabulary <mode> values - pin lysuite/ly13b_KeySignatures_ChurchModes.xml to the api roundtrip New enumerators are appended, so existing KeyMode values are unchanged.
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
Extend API KeyMode support to include all known values on both read and write. Unknown values are handled as
unsupported.Summary
KeyModeinKeyData.honly hadmajorandminor.MeasureReadermapped every other<mode>toKeyMode::unsupportedandPropertiesWriterwrote a<mode>element only formajor and minor, so a keyless signature (
<fifths>0</fifths><mode>none</mode>) could beneither read nor written.
KeyModenow covers the ten standard MusicXML modes. Reading and writing both go through anew bridge table in
Converterinstead of a hand-rolled if-chain, which retires the// TODO - support all modesinMeasureReader. The new enumerators are appended, so theexisting values are unchanged.
Distinctions that are preserved:
unspecifiedwrites no<mode>element;nonewrites<mode>none</mode>distinct states
unsupportedis kept, and still earns its keep:<mode>is an open vocabulary, so it iswhat an unrecognized value reads back as. It writes nothing.
noneis an ordinary mode value. It writes a traditional key and is not coupled tonontraditional key handling.
No
print-objectsupport, and nothing Finale-specific: this is general mode support.lysuite/ly13b_KeySignatures_ChurchModes.xmlis pinned to the api roundtrip to defend thefeature. On the base commit it fails with
child count mismatchat the key element (thedropped
<mode>), and passes with this change.Testing
ly13b_KeySignatures_ChurchModes.xmlfails before the change, passes afterdeserializes, zero-fifths
noneround-trips, absent<mode>stays unspecified, anunrecognized mode reads as unsupported, and the four zero-fifths
*_KeyData: 285 assertions in 20 test cases)make api-testpasses (5366 assertions in 471 test cases)make api-roundtrippasses (296 of 296 pinned)make core-roundtrip-testpasses (837 test cases)make core-unitpasses (212 assertions in 41 test cases)