diff --git a/importexport/musicxml/importmxmlpass2.cpp b/importexport/musicxml/importmxmlpass2.cpp index 287611c09bc8c..fd0ecb2b651fe 100644 --- a/importexport/musicxml/importmxmlpass2.cpp +++ b/importexport/musicxml/importmxmlpass2.cpp @@ -3903,6 +3903,19 @@ void MusicXMLParserDirection::textToDynamic(QString& text) const if (!preferences.getBool(PREF_IMPORT_MUSICXML_IMPORTINFERTEXTTYPE)) return; QString simplifiedText = text.simplified(); + // Correct finale's incorrect dynamic export + if (_pass1.exporterSoftware() == MusicXMLExporterSoftware::FINALE) { + static const std::map finaleDynamicSubs + = { { "π", "pp" }, { "P", "mp" }, { "F", "mf" }, { "ƒ", "ff" }, { "Ï", "fff" }, { "S", "sf" }, { "ß", "sfz" }, + { "Z", "fz" }, { "Í", "fp" } }; + for (const auto& sub : finaleDynamicSubs) { + if (simplifiedText == sub.first) { + simplifiedText = sub.second; + break; + } + } + } for (auto dyn : dynList) { if (dyn.tag == simplifiedText) { text = text.replace(simplifiedText, dyn.text); diff --git a/mtest/musicxml/io/testFinaleDynamics.xml b/mtest/musicxml/io/testFinaleDynamics.xml new file mode 100644 index 0000000000000..544fb343e01af --- /dev/null +++ b/mtest/musicxml/io/testFinaleDynamics.xml @@ -0,0 +1,305 @@ + + + + + Untitled score + + + Composer / arranger + + Finale v27.4 for Windows + 2024-05-20 + + + + + + + + + + 6.99911 + 40 + + + 1696.94 + 1200.48 + + 85.7252 + 85.7252 + 85.7252 + 85.7252 + + + 85.7252 + 85.7252 + 85.7252 + 85.7252 + + + + 1.8 + 5.5 + 5 + 4.5 + 1 + 1 + 1.1 + 1 + 1.6 + 1.1 + 1.1 + 2.1 + 0.5 + 1.1 + 1 + 2.1 + 0.5 + 1 + 1.2 + 70 + 70 + 49 + + + + + + + + Flute + Fl. + + Flute + wind.flutes.flute + + + + 1 + 74 + 78.7402 + 0 + + + + + + + + + 50 + -0 + + 70 + + + + 1 + + 0 + + + + G + 2 + + + + + π + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + Ï + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + p + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + S + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + + + P + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + ß + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + F + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + Z + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + + + f + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + Í + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + ƒ + + + + + + B + 4 + + 1 + 1 + quarter + down + + + + B + 4 + + 1 + 1 + quarter + down + + + light-heavy + + + + diff --git a/mtest/musicxml/io/testFinaleDynamics_ref.mscx b/mtest/musicxml/io/testFinaleDynamics_ref.mscx new file mode 100644 index 0000000000000..c08211cafb038 --- /dev/null +++ b/mtest/musicxml/io/testFinaleDynamics_ref.mscx @@ -0,0 +1,317 @@ + + + + + 0 + 480 + + 1 + 1 + 1 + 0 + + Composer / arranger + + + + + + + + + Untitled score + + + + stdNormal + + 3 + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + 100 + 95 + + + 100 + 33 + + + 100 + 50 + + + 100 + 67 + + + 100 + 100 + + + 120 + 67 + + + 150 + 100 + + + 150 + 50 + + + 120 + 50 + + + 120 + 100 + + + + + + + + + + 10 + + + Untitled score + + + + Composer / arranger + + + + + + G + G + + + 4 + 4 + + + pp + 33 + down + + + quarter + down + + 71 + 19 + + + + fff + 33 + down + + + quarter + down + + 71 + 19 + + + + p + 49 + down + + + quarter + down + + 71 + 19 + + + + sf + 33 + down + + + quarter + down + + 71 + 19 + + + + + + + + mp + 64 + down + + + quarter + down + + 71 + 19 + + + + sfz + 33 + down + + + quarter + down + + 71 + 19 + + + + mf + 80 + down + + + quarter + down + + 71 + 19 + + + + fz + 33 + down + + + quarter + down + + 71 + 19 + + + + + + + + f + 96 + down + + + quarter + down + + 71 + 19 + + + + fp + 33 + down + + + quarter + down + + 71 + 19 + + + + ff + 112 + down + + + quarter + down + + 71 + 19 + + + + quarter + down + + 71 + 19 + + + + end + + + + + + diff --git a/mtest/musicxml/io/tst_mxml_io.cpp b/mtest/musicxml/io/tst_mxml_io.cpp index a5de697cdc573..7ba2bd394b897 100644 --- a/mtest/musicxml/io/tst_mxml_io.cpp +++ b/mtest/musicxml/io/tst_mxml_io.cpp @@ -141,6 +141,7 @@ private slots: void figuredBassDivisions() { mxmlIoTest("testFiguredBassDivisions"); } // void finaleInstr() { mxmlImportTestRef("testFinaleInstr"); } // TODO void finaleInstr2() { mxmlImportTestRef("testFinaleInstr2"); } + void finaleDynamics() { mxmlImportTestRef("testFinaleDynamics"); } // void formattedThings() { mxmlIoTest("testFormattedThings"); } // TODO void fractionMinus() { mxmlIoTestRef("testFractionMinus"); } void fractionPlus() { mxmlIoTestRef("testFractionPlus"); }