From a451bbc61930eecd5deb8bdd9cf4b66ebf36cee7 Mon Sep 17 00:00:00 2001 From: Robert Patterson Date: Fri, 7 Aug 2026 06:09:17 -0500 Subject: [PATCH 1/2] fix: correct miscelaneousFields typo in EncodingData EncodingData::miscelaneousFields was missing an 'l'. The class it holds, MiscellaneousField, and every core-side name were already spelled correctly, so the member was the lone outlier. Breaking: the member is public mx::api. Callers using the old spelling must rename. No alias is left behind, matching the ScoreData layout -> defaults rename in v0.5.0. --- src/include/mx/api/EncodingData.h | 4 ++-- src/private/mx/impl/EncodingFunctions.cpp | 2 +- src/private/mx/impl/ScoreReader.cpp | 2 +- src/private/mxtest/api/ApiK016aMiscScoreData.h | 6 +++--- src/private/mxtest/api/ApiLy43eScoreData.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/include/mx/api/EncodingData.h b/src/include/mx/api/EncodingData.h index 662b5d70f..cbc44a353 100644 --- a/src/include/mx/api/EncodingData.h +++ b/src/include/mx/api/EncodingData.h @@ -59,7 +59,7 @@ class EncodingData std::string encodingDescription; std::vector software; std::vector supportedItems; - std::vector miscelaneousFields; + std::vector miscellaneousFields; // mx stamps its own provenance node (the mx URL plus the build's git // SHA) into on every api write. The intent is to aid in diagnosing and @@ -102,7 +102,7 @@ MXAPI_EQUALS_MEMBER(encoder) MXAPI_EQUALS_MEMBER(encodingDescription) MXAPI_EQUALS_MEMBER(software) MXAPI_EQUALS_MEMBER(supportedItems) -MXAPI_EQUALS_MEMBER(miscelaneousFields) +MXAPI_EQUALS_MEMBER(miscellaneousFields) MXAPI_EQUALS_MEMBER(writeMxVersion) MXAPI_EQUALS_END; MXAPI_NOT_EQUALS_AND_VECTORS(EncodingData); diff --git a/src/private/mx/impl/EncodingFunctions.cpp b/src/private/mx/impl/EncodingFunctions.cpp index ec75f257b..cb8c065f3 100644 --- a/src/private/mx/impl/EncodingFunctions.cpp +++ b/src/private/mx/impl/EncodingFunctions.cpp @@ -91,7 +91,7 @@ void createEncoding(const api::EncodingData &inEncoding, core::ScoreHeaderGroup bool hasMiscellaneous = identification.miscellaneous().has_value(); core::Miscellaneous miscellaneous = identification.miscellaneous().value_or(core::Miscellaneous{}); - for (const auto &m : inEncoding.miscelaneousFields) + for (const auto &m : inEncoding.miscellaneousFields) { hasIdentification = true; hasEncoding = true; diff --git a/src/private/mx/impl/ScoreReader.cpp b/src/private/mx/impl/ScoreReader.cpp index 61348f9d4..7c5d79b9c 100644 --- a/src/private/mx/impl/ScoreReader.cpp +++ b/src/private/mx/impl/ScoreReader.cpp @@ -247,7 +247,7 @@ api::ScoreData ScoreReader::getScoreData() const { std::string key; key = m.name(); - encodingData.miscelaneousFields.emplace_back(m.name(), m.value()); + encodingData.miscellaneousFields.emplace_back(m.name(), m.value()); } } diff --git a/src/private/mxtest/api/ApiK016aMiscScoreData.h b/src/private/mxtest/api/ApiK016aMiscScoreData.h index c9efde1ba..0deaa8857 100644 --- a/src/private/mxtest/api/ApiK016aMiscScoreData.h +++ b/src/private/mxtest/api/ApiK016aMiscScoreData.h @@ -14,9 +14,9 @@ inline mx::api::ScoreData apiK016aMiscScoreData() using namespace mx::api; ScoreData scoreData; scoreData.encoding.software.emplace_back("komp"); - scoreData.encoding.miscelaneousFields.emplace_back("komp-version-major", "1"); - scoreData.encoding.miscelaneousFields.emplace_back("komp-version-minor", "2"); - scoreData.encoding.miscelaneousFields.emplace_back("komp-version-patch", "3"); + scoreData.encoding.miscellaneousFields.emplace_back("komp-version-major", "1"); + scoreData.encoding.miscellaneousFields.emplace_back("komp-version-minor", "2"); + scoreData.encoding.miscellaneousFields.emplace_back("komp-version-patch", "3"); scoreData.parts.emplace_back(PartData{}); auto &part = scoreData.parts.back(); part.name = "hello world"; diff --git a/src/private/mxtest/api/ApiLy43eScoreData.h b/src/private/mxtest/api/ApiLy43eScoreData.h index 1f47bb7a1..c2b404dec 100644 --- a/src/private/mxtest/api/ApiLy43eScoreData.h +++ b/src/private/mxtest/api/ApiLy43eScoreData.h @@ -14,7 +14,7 @@ inline mx::api::ScoreData apiLy43eScoreData() ScoreData score; score.parts.emplace_back(PartData{}); score.ticksPerQuarter = 8; - score.encoding.miscelaneousFields.emplace_back( + score.encoding.miscellaneousFields.emplace_back( "description", "A piano staff with dynamics and \n clef changes, where each element (ffff, wedge and " "clef changes) \n applies only to one voice or one staff, respectively."); From 498bcf197739ac5545838db304b1604485995701 Mon Sep 17 00:00:00 2001 From: Robert Patterson Date: Fri, 7 Aug 2026 07:04:40 -0500 Subject: [PATCH 2/2] chore: correct misspelled identifiers and comments Follows the miscellaneousFields rename with the other misspellings a dictionary pass over the identifiers turned up. All are private mx::impl names or comment text, so nothing here is breaking. TechnicalFunctions had the same word misspelled two different ways while the class itself was spelled correctly: parseTechicalMark and its techicalChoice parameter dropped the 'n', and the constructor parameter inTechincalChoiceSet and member myTechincalChoiceSet transposed it. MeasureReader's isUserRequestedVoiceNumberConsistentAccrossAllVoices had a doubled 'c'. Comment fixes in public headers: alyways, convient, otherwords, and Clarient in the TransposeData doc table. SoundID.h is deliberately untouched. brass.sackbutt and strings.violono.piccolo mirror the MusicXML standard sound-id strings and must match the wire format. --- src/include/mx/api/DirectionData.h | 2 +- src/include/mx/api/MarkData.h | 2 +- src/include/mx/api/PartData.h | 2 +- src/include/mx/api/TransposeData.h | 2 +- src/private/mx/impl/MeasureReader.cpp | 4 +- src/private/mx/impl/MeasureReader.h | 2 +- src/private/mx/impl/TechnicalFunctions.cpp | 68 +++++++++++----------- src/private/mx/impl/TechnicalFunctions.h | 6 +- 8 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/include/mx/api/DirectionData.h b/src/include/mx/api/DirectionData.h index 7980f12dd..a4f61fae6 100644 --- a/src/include/mx/api/DirectionData.h +++ b/src/include/mx/api/DirectionData.h @@ -52,7 +52,7 @@ struct DirectionData int voice; // Direction elements are placed inside the StaffData object in mx api. This would mean that - // they are alyways assigned to a staff, however MusicXML makes the staff element optional. + // they are always assigned to a staff, however MusicXML makes the staff element optional. // in the case that we want a direction element to have no element then me must place // the direction on staffIndex = 0 and set isStaffValueSpecified. otherwise the we will // assume that the element is present with a value of staffIndex + 1. This bool is diff --git a/src/include/mx/api/MarkData.h b/src/include/mx/api/MarkData.h index dd9ce4d91..bff6c117b 100644 --- a/src/include/mx/api/MarkData.h +++ b/src/include/mx/api/MarkData.h @@ -174,7 +174,7 @@ enum class MarkType // instead it has an attribute 'type' that is either 'upright' or 'inverted'. // it appears that implementations interpret 'upright' to mean the 'normal' or // correct orientation and 'inverted' to mean that the fermata should be 'flipped' - // from its correct orientation. in otherwords the implementation has to figure + // from its correct orientation. in other words the implementation has to figure // out if the fermata is above or below the note on its own (using its own // algorithm combined with any default-y and relative-y values). this mess is // going to be beyond the scope of the MusicXML Class Library at this time. You diff --git a/src/include/mx/api/PartData.h b/src/include/mx/api/PartData.h index 4a1e66242..eed1e575e 100644 --- a/src/include/mx/api/PartData.h +++ b/src/include/mx/api/PartData.h @@ -206,7 +206,7 @@ class PartData /// The initial transposition for the part. If the music entered into the part is not in /// concert pitch, then this field is used to specify the transposition that is in- /// effect. Note, MusicXML encodes transposition in the measure data, not in the part - /// data. Here we offer a convient way to set the transposition in the first measure of + /// data. Here we offer a convenient way to set the transposition in the first measure of /// the part. Subsequent transposition changes are not currently supported by mx::api. std::optional transposition; diff --git a/src/include/mx/api/TransposeData.h b/src/include/mx/api/TransposeData.h index d0f924b74..d5c55a99b 100644 --- a/src/include/mx/api/TransposeData.h +++ b/src/include/mx/api/TransposeData.h @@ -35,7 +35,7 @@ namespace api /// |---------------------|--------------------|----------|---------| /// | Glockenspiel | Up two Octaves | 24 | 14 | /// | Piccolo | Up an Octave | 12 | 7 | -/// | Clarient in Bb | Down a Major Second| -2 | -1 | +/// | Clarinet in Bb | Down a Major Second| -2 | -1 | /// | French Horn in F | Down a Fifth | -7 | -4 | /// | Alto Saxophone in Eb| Down a Major Sixth | -9 | -5 | /// | Bass Clarinet in Bb | Down a Major Ninth | -14 | -8 | diff --git a/src/private/mx/impl/MeasureReader.cpp b/src/private/mx/impl/MeasureReader.cpp index e4babb5a8..d917b70a8 100644 --- a/src/private/mx/impl/MeasureReader.cpp +++ b/src/private/mx/impl/MeasureReader.cpp @@ -1172,7 +1172,7 @@ void MeasureReader::consolidateVoicesForAllStaves() const { for (auto &staff : myOutMeasureData.staves) { - if (isUserRequestedVoiceNumberConsistentAccrossAllVoices(staff)) + if (isUserRequestedVoiceNumberConsistentAcrossAllVoices(staff)) { takeUserRequestedVoiceNumbers(staff); } @@ -1231,7 +1231,7 @@ bool MeasureReader::isUserRequestedVoiceNumberConsistent(const api::VoiceData &v return true; } -bool MeasureReader::isUserRequestedVoiceNumberConsistentAccrossAllVoices(const api::StaffData &staff) const +bool MeasureReader::isUserRequestedVoiceNumberConsistentAcrossAllVoices(const api::StaffData &staff) const { std::set userRequestedVoiceNumbers; for (const auto &voicePair : staff.voices) diff --git a/src/private/mx/impl/MeasureReader.h b/src/private/mx/impl/MeasureReader.h index e2d4fbfda..d1f756ee9 100644 --- a/src/private/mx/impl/MeasureReader.h +++ b/src/private/mx/impl/MeasureReader.h @@ -119,7 +119,7 @@ class MeasureReader void takeUserRequestedVoiceNumbers(api::StaffData &staff) const; void collapseVoicesAutomatically(api::StaffData &staff) const; bool isUserRequestedVoiceNumberConsistent(const api::VoiceData &voiceData) const; - bool isUserRequestedVoiceNumberConsistentAccrossAllVoices(const api::StaffData &staff) const; + bool isUserRequestedVoiceNumberConsistentAcrossAllVoices(const api::StaffData &staff) const; int getUserRequestedVoiceNumber(const api::VoiceData &voiceData) const; void advanceTickTimePosition(int amount, std::string reason) const; }; diff --git a/src/private/mx/impl/TechnicalFunctions.cpp b/src/private/mx/impl/TechnicalFunctions.cpp index b557fe524..369d8f134 100644 --- a/src/private/mx/impl/TechnicalFunctions.cpp +++ b/src/private/mx/impl/TechnicalFunctions.cpp @@ -142,14 +142,14 @@ api::HarmonicMarkData harmonicMarkDataFromCore(const core::Harmonic &inHarmonic) return outData; } -TechnicalFunctions::TechnicalFunctions(std::span inTechincalChoiceSet, Cursor inCursor) - : myTechincalChoiceSet{inTechincalChoiceSet}, myCursor{inCursor} +TechnicalFunctions::TechnicalFunctions(std::span inTechnicalChoiceSet, Cursor inCursor) + : myTechnicalChoiceSet{inTechnicalChoiceSet}, myCursor{inCursor} { } void TechnicalFunctions::parseTechnicalMarks(std::vector &outMarks) const { - for (const auto &techChoice : myTechincalChoiceSet) + for (const auto &techChoice : myTechnicalChoiceSet) { const auto choiceKind = techChoice.kind(); Converter converter; @@ -162,7 +162,7 @@ void TechnicalFunctions::parseTechnicalMarks(std::vector &outMark api::MarkData markData; markData.markType = markType; markData.tickTimePosition = myCursor.tickTimePosition; - bool isSuccess = parseTechicalMark(techChoice, markData); + bool isSuccess = parseTechnicalMark(techChoice, markData); if (isSuccess) { @@ -171,23 +171,23 @@ void TechnicalFunctions::parseTechnicalMarks(std::vector &outMark } } -bool TechnicalFunctions::parseTechicalMark(const core::TechnicalChoice &techicalChoice, - api::MarkData &outMarkData) const +bool TechnicalFunctions::parseTechnicalMark(const core::TechnicalChoice &technicalChoice, + api::MarkData &outMarkData) const { - switch (techicalChoice.kind()) + switch (technicalChoice.kind()) { case core::TechnicalChoice::Kind::upBow: { - parseMarkDataAttributes(techicalChoice.asUpBow(), outMarkData); + parseMarkDataAttributes(technicalChoice.asUpBow(), outMarkData); outMarkData.name = "up-bow"; return true; } case core::TechnicalChoice::Kind::downBow: { - parseMarkDataAttributes(techicalChoice.asDownBow(), outMarkData); + parseMarkDataAttributes(technicalChoice.asDownBow(), outMarkData); outMarkData.name = "down-bow"; return true; } case core::TechnicalChoice::Kind::harmonic: { - const auto &harmonic = techicalChoice.asHarmonic(); + const auto &harmonic = technicalChoice.asHarmonic(); parseMarkDataAttributes(harmonic, outMarkData); outMarkData.name = "harmonic"; const auto harmonicData = harmonicMarkDataFromCore(harmonic); @@ -199,17 +199,17 @@ bool TechnicalFunctions::parseTechicalMark(const core::TechnicalChoice &techical return true; } case core::TechnicalChoice::Kind::openString: { - parseMarkDataAttributes(techicalChoice.asOpenString(), outMarkData); + parseMarkDataAttributes(technicalChoice.asOpenString(), outMarkData); outMarkData.name = "open-string"; return true; } case core::TechnicalChoice::Kind::thumbPosition: { - parseMarkDataAttributes(techicalChoice.asThumbPosition(), outMarkData); + parseMarkDataAttributes(technicalChoice.asThumbPosition(), outMarkData); outMarkData.name = "thumb-position"; return true; } case core::TechnicalChoice::Kind::fingering: { - const auto &fingering = techicalChoice.asFingering(); + const auto &fingering = technicalChoice.asFingering(); parseMarkDataAttributes(fingering, outMarkData); outMarkData.name = fingering.value(); Converter converter; @@ -224,39 +224,39 @@ bool TechnicalFunctions::parseTechicalMark(const core::TechnicalChoice &techical return true; } case core::TechnicalChoice::Kind::pluck: { - const auto &pluck = techicalChoice.asPluck(); + const auto &pluck = technicalChoice.asPluck(); parseMarkDataAttributes(pluck, outMarkData); outMarkData.name = pluck.value(); return true; } case core::TechnicalChoice::Kind::doubleTongue: { - parseMarkDataAttributes(techicalChoice.asDoubleTongue(), outMarkData); + parseMarkDataAttributes(technicalChoice.asDoubleTongue(), outMarkData); outMarkData.name = "double-tongue"; return true; } case core::TechnicalChoice::Kind::tripleTongue: { - parseMarkDataAttributes(techicalChoice.asTripleTongue(), outMarkData); + parseMarkDataAttributes(technicalChoice.asTripleTongue(), outMarkData); outMarkData.name = "triple-tongue"; return true; } case core::TechnicalChoice::Kind::stopped: { - parseMarkDataAttributes(techicalChoice.asStopped(), outMarkData); + parseMarkDataAttributes(technicalChoice.asStopped(), outMarkData); outMarkData.name = "stopped"; return true; } case core::TechnicalChoice::Kind::snapPizzicato: { - parseMarkDataAttributes(techicalChoice.asSnapPizzicato(), outMarkData); + parseMarkDataAttributes(technicalChoice.asSnapPizzicato(), outMarkData); outMarkData.name = "snap-pizzicato"; return true; } case core::TechnicalChoice::Kind::fret: { - const auto &fret = techicalChoice.asFret(); + const auto &fret = technicalChoice.asFret(); parseMarkDataAttributes(fret, outMarkData); outMarkData.name = std::to_string(fret.value()); return true; } case core::TechnicalChoice::Kind::string: { - const auto &s = techicalChoice.asString(); + const auto &s = technicalChoice.asString(); parseMarkDataAttributes(s, outMarkData); outMarkData.name = std::to_string(s.value().value()); return true; @@ -270,75 +270,75 @@ bool TechnicalFunctions::parseTechicalMark(const core::TechnicalChoice &techical case core::TechnicalChoice::Kind::tap: return false; case core::TechnicalChoice::Kind::heel: { - parseMarkDataAttributes(techicalChoice.asHeel(), outMarkData); + parseMarkDataAttributes(technicalChoice.asHeel(), outMarkData); outMarkData.name = "heel"; return true; } case core::TechnicalChoice::Kind::toe: { - parseMarkDataAttributes(techicalChoice.asToe(), outMarkData); + parseMarkDataAttributes(technicalChoice.asToe(), outMarkData); outMarkData.name = "toe"; return true; } case core::TechnicalChoice::Kind::fingernails: { - parseMarkDataAttributes(techicalChoice.asFingernails(), outMarkData); + parseMarkDataAttributes(technicalChoice.asFingernails(), outMarkData); outMarkData.name = "fingernails"; return true; } case core::TechnicalChoice::Kind::hole: { - const auto &hole = techicalChoice.asHole(); + const auto &hole = technicalChoice.asHole(); parseMarkDataAttributes(hole, outMarkData); outMarkData.name = technicalFunctionsHoleToSmuflName(hole); return true; } case core::TechnicalChoice::Kind::arrow: { - const auto &arrow = techicalChoice.asArrow(); + const auto &arrow = technicalChoice.asArrow(); parseMarkDataAttributes(arrow, outMarkData); outMarkData.name = technicalFunctionsArrowToSmuflName(arrow); return true; } case core::TechnicalChoice::Kind::handbell: { - const auto &handbell = techicalChoice.asHandbell(); + const auto &handbell = technicalChoice.asHandbell(); parseMarkDataAttributes(handbell, outMarkData); outMarkData.name = technicalFunctionsHandbellToSmuflName(handbell.value()); return true; } case core::TechnicalChoice::Kind::brassBend: { - parseMarkDataAttributes(techicalChoice.asBrassBend(), outMarkData); + parseMarkDataAttributes(technicalChoice.asBrassBend(), outMarkData); outMarkData.name = "brass-bend"; return true; } case core::TechnicalChoice::Kind::flip: { - parseMarkDataAttributes(techicalChoice.asFlip(), outMarkData); + parseMarkDataAttributes(technicalChoice.asFlip(), outMarkData); outMarkData.name = "flip"; return true; } case core::TechnicalChoice::Kind::smear: { - parseMarkDataAttributes(techicalChoice.asSmear(), outMarkData); + parseMarkDataAttributes(technicalChoice.asSmear(), outMarkData); outMarkData.name = "smear"; return true; } case core::TechnicalChoice::Kind::open: { - parseMarkDataAttributes(techicalChoice.asOpen(), outMarkData); + parseMarkDataAttributes(technicalChoice.asOpen(), outMarkData); outMarkData.name = "open"; return true; } case core::TechnicalChoice::Kind::halfMuted: { - parseMarkDataAttributes(techicalChoice.asHalfMuted(), outMarkData); + parseMarkDataAttributes(technicalChoice.asHalfMuted(), outMarkData); outMarkData.name = "half-muted"; return true; } case core::TechnicalChoice::Kind::harmonMute: { - parseMarkDataAttributes(techicalChoice.asHarmonMute(), outMarkData); + parseMarkDataAttributes(technicalChoice.asHarmonMute(), outMarkData); outMarkData.name = "harmon-mute"; return true; } case core::TechnicalChoice::Kind::golpe: { - parseMarkDataAttributes(techicalChoice.asGolpe(), outMarkData); + parseMarkDataAttributes(technicalChoice.asGolpe(), outMarkData); outMarkData.name = "golpe"; return true; } case core::TechnicalChoice::Kind::otherTechnical: { - const auto &oa = techicalChoice.asOtherTechnical(); + const auto &oa = technicalChoice.asOtherTechnical(); parseMarkDataAttributes(oa, outMarkData); outMarkData.name = oa.value(); api::OtherMarkData payload; diff --git a/src/private/mx/impl/TechnicalFunctions.h b/src/private/mx/impl/TechnicalFunctions.h index 59955b9de..66057ec68 100644 --- a/src/private/mx/impl/TechnicalFunctions.h +++ b/src/private/mx/impl/TechnicalFunctions.h @@ -28,16 +28,16 @@ class TechnicalFunctions { public: - TechnicalFunctions(std::span inTechincalChoiceSet, Cursor inCursor); + TechnicalFunctions(std::span inTechnicalChoiceSet, Cursor inCursor); void parseTechnicalMarks(std::vector &outMarks) const; private: - std::span myTechincalChoiceSet; + std::span myTechnicalChoiceSet; const Cursor myCursor; private: - bool parseTechicalMark(const core::TechnicalChoice &techicalChoice, api::MarkData &outMarkData) const; + bool parseTechnicalMark(const core::TechnicalChoice &technicalChoice, api::MarkData &outMarkData) const; }; } // namespace impl } // namespace mx