diff --git a/importexport/musicxml/exportxml.cpp b/importexport/musicxml/exportxml.cpp index e709d477e5327..76600fc55e41d 100644 --- a/importexport/musicxml/exportxml.cpp +++ b/importexport/musicxml/exportxml.cpp @@ -3100,6 +3100,42 @@ static QString symIdToTechn(const SymId sid) case SymId::guitarGolpe: return "golpe"; break; + case SymId::handbellsBelltree: + return "belltree"; + break; + case SymId::handbellsDamp3: + return "damp"; + break; + case SymId::handbellsEcho1: + return "echo"; + break; + case SymId::handbellsGyro: + return "gyro"; + break; + case SymId::handbellsHandMartellato: + return "hand martellato"; + break; + case SymId::handbellsMalletLft: + return "mallet lift"; + break; + case SymId::handbellsMalletBellOnTable: + return "mallet table"; + break; + case SymId::handbellsMartellato: + return "martellato"; + break; + case SymId::handbellsMartellatoLift: + return "martellato lift"; + break; + case SymId::handbellsMutedMartellato: + return "muted martellato"; + break; + case SymId::handbellsPluckLift: + return "pluck lift"; + break; + case SymId::handbellsSwing: + return "swing"; + break; default: ; // nothing break; @@ -3332,6 +3368,15 @@ void ExportMusicXml::chordAttributes(Chord* chord, Notations& notations, Technic _xml.tagE("natural"); _xml.etag(); } + else if (QString(Sym::id2name(sid)).startsWith("handbells")) { + QString handbell = "handbell"; + handbell += color2xml(a); + handbell += positioningAttributes(a); + if (!placement.isEmpty()) { + handbell += QString(" placement=\"%1\"").arg(placement); + } + _xml.tag(handbell, symIdToTechn(sid)); + } else if (mxmlTechn.startsWith("harmon")) { _xml.stag(mxmlTechn); QString location = {}; diff --git a/importexport/musicxml/importmxmlpass2.cpp b/importexport/musicxml/importmxmlpass2.cpp index 287611c09bc8c..f07d4c5f818f3 100644 --- a/importexport/musicxml/importmxmlpass2.cpp +++ b/importexport/musicxml/importmxmlpass2.cpp @@ -1284,6 +1284,19 @@ static bool convertArticulationToSymId(const QString& mxmlName, SymId& id) map["smear"] = SymId::brassSmear ; map["open"] = SymId::brassMuteOpen; + map["belltree"] = SymId::handbellsBelltree; + map["damp"] = SymId::handbellsDamp3; + map["echo"] = SymId::handbellsEcho1; + map["gyro"] = SymId::handbellsGyro; + map["hand martellato"] = SymId::handbellsHandMartellato; + map["mallet lift"] = SymId::handbellsMalletLft; + map["mallet table"] = SymId::handbellsMalletBellOnTable; + map["martellato"] = SymId::handbellsMartellato; + map["martellato lift"] = SymId::handbellsMartellatoLift; + map["muted martellato"] = SymId::handbellsMutedMartellato; + map["pluck lift"] = SymId::handbellsPluckLift; + map["swing"] = SymId::handbellsSwing; + if (map.contains(mxmlName)) { id = map.value(mxmlName); return true; @@ -7687,7 +7700,7 @@ void MusicXMLParserNotations::ornaments() void MusicXMLParserNotations::technical() { while (_e.readNextStartElement()) { - SymId id { SymId::noSym }; + SymId id = SymId::noSym; if (convertArticulationToSymId(_e.name().toString(), id)) { Notation notation = Notation::notationWithAttributes(_e.name().toString(), _e.attributes(), "technical", id); @@ -7702,10 +7715,16 @@ void MusicXMLParserNotations::technical() } else if (_e.name() == "harmonic") harmonic(); + else if (_e.name() == "handbell") { + QXmlStreamAttributes attributes = _e.attributes(); + convertArticulationToSymId(_e.readElementText(), id); + _notations.push_back(Notation::notationWithAttributes(_e.name().toString(), + attributes, "technical", id)); + } else if (_e.name() == "harmon-mute") harmonMute(); else if (_e.name() == "other-technical") - otherTechnical(); + otherTechnical(); else skipLogCurrElem(); } diff --git a/mtest/musicxml/io/testHandbells.xml b/mtest/musicxml/io/testHandbells.xml new file mode 100644 index 0000000000000..65297cb864ffd --- /dev/null +++ b/mtest/musicxml/io/testHandbells.xml @@ -0,0 +1,236 @@ + + + + + Hand bell symbols test + + + Klaus Rettinghaus + + MuseScore 0.7.0 + 2007-09-10 + + + + + + + + + + Hand Bells + Ha. Be. + + Hand Bells + + + + 2 + 113 + 78.7402 + 0 + + + + + + + 1 + + 0 + + + 2 + + G + 2 + + + F + 4 + + + 0 + 0 + 1 + + + + + 4 + 1 + 1 + + + 4 + + + + F + 3 + + 2 + 5 + half + down + 2 + + + belltree + + + + + + A + 3 + + 2 + 5 + half + down + 2 + + + damp + + + + + + + + 4 + 1 + 1 + + + 4 + + + + G + 3 + + 2 + 5 + half + down + 2 + + + echo + + + + + + C + 3 + + 2 + 5 + half + up + 2 + + + gyro + + + + + + + + 4 + 1 + 1 + + + 4 + + + + C + 3 + + 2 + 5 + half + up + 2 + + + hand martellato + + + + + + G + 3 + + 2 + 5 + half + down + 2 + + + mallet lift + + + + + + + + 4 + 1 + 1 + + + 4 + + + + A + 3 + + 2 + 5 + half + down + 2 + + + mallet table + + + + + + F + 3 + + 2 + 5 + half + down + 2 + + + martellato + + + + + light-heavy + + + + diff --git a/mtest/musicxml/io/tst_mxml_io.cpp b/mtest/musicxml/io/tst_mxml_io.cpp index a5de697cdc573..8385056aa887f 100644 --- a/mtest/musicxml/io/tst_mxml_io.cpp +++ b/mtest/musicxml/io/tst_mxml_io.cpp @@ -151,6 +151,7 @@ private slots: void grace2() { mxmlIoTest("testGrace2"); } void grace3() { mxmlIoTest("testGrace3"); } void hairpinDynamics() { mxmlMscxExportTestRef("testHairpinDynamics"); } + void handbells() { mxmlIoTest("testHandbells"); } void harmony1() { mxmlIoTest("testHarmony1"); } void harmony2() { mxmlIoTest("testHarmony2"); } void harmony3() { mxmlIoTest("testHarmony3"); }