Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2 Couperin ornaments #10412

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/engraving/libmscore/articulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ bool Articulation::isOrnament(int subtype)
SymId::ornamentPrecompSlide,
SymId::ornamentShake3,
SymId::ornamentShakeMuffat1,
SymId::ornamentTremblementCouperin,
SymId::ornamentPinceCouperin
};

SymId symId = static_cast<SymId>(subtype);
Expand Down
3 changes: 2 additions & 1 deletion src/engraving/libmscore/rendermidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,9 +916,10 @@ std::vector<OrnamentExcursion> excursions = {
{ SymId::ornamentPrallUp, any, _16th, { 1, 0 }, { 1, 0 }, true, true, { -1, 0 } },// p136 Double Cadence [1]
{ SymId::ornamentPrallDown, any, _16th, { 1, 0 }, { 1, 0 }, true, true, { -1, 0, 0, 0 } },// p144 ex 153 [1]
{ SymId::ornamentPrecompSlide, any, _32nd, {}, { 0 }, false, true, {} },

{ SymId::ornamentShake3, any, _32nd, { 1, 0 }, { 1, 0 }, true, true, {} },
{ SymId::ornamentShakeMuffat1, any, _32nd, { 1, 0 }, { 1, 0 }, true, true, {} },
{ SymId::ornamentTremblementCouperin, any, _32nd, { 1, 1 }, { 0, 1 }, true, true, { 0, 0 } },
{ SymId::ornamentPinceCouperin, any, _32nd, { 0 }, { 0, -1 }, true, true, { 0, 0 } }
cbjeukendrup marked this conversation as resolved.
Show resolved Hide resolved

// [1] Some of the articulations/ornaments in the excursions table above come from
// Baroque Music, Style and Performance A Handbook, by Robert Donington,(c) 1982
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ void SymbolsMetaParser::doParse(const EngravingItem* item, const RenderingContex
types.emplace(mpe::ArticulationType::UpMordent);
break;
case SymId::ornamentMordent:
case SymId::ornamentPinceCouperin:
types.emplace(mpe::ArticulationType::LowerMordent);
break;
case SymId::ornamentDownMordent:
Expand Down
4 changes: 2 additions & 2 deletions src/engraving/types/symnames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5265,7 +5265,7 @@ constexpr const std::array<const char*, size_t(SymId::lastSym) + 1> SymNames::s_
"Oblique straight line tilted NW-SE",
"Oblique straight line tilted SW-NE",
"Oriscus",
"Pincé (Couperin)",
QT_TRANSLATE_NOOP("engraving/sym", "Pincé (Couperin)"),
"Port de voix",
"Supported appoggiatura trill",
"Supported appoggiatura trill with two-note suffix",
Expand Down Expand Up @@ -5307,7 +5307,7 @@ constexpr const std::array<const char*, size_t(SymId::lastSym) + 1> SymNames::s_
"Ornament top right concave stroke",
"Ornament top right convex stroke",
QT_TRANSLATE_NOOP("engraving/sym", "Tremblement"),
"Tremblement appuyé (Couperin)",
QT_TRANSLATE_NOOP("engraving/sym", "Tremblement appuyé (Couperin)"),
QT_TRANSLATE_NOOP("engraving/sym", "Trill"),
QT_TRANSLATE_NOOP("engraving/sym", "Turn"),
QT_TRANSLATE_NOOP("engraving/sym", "Inverted turn"),
Expand Down
6 changes: 6 additions & 0 deletions src/importexport/musicxml/internal/musicxml/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2894,6 +2894,12 @@ static QString symIdToOrnam(const SymId sid)
case SymId::ornamentPrecompSlide:
return "schleifer";
break;
case SymId::ornamentTremblementCouperin:
return "other-ornament smufl=\"ornamentTremblementCouperin\"";
break;
case SymId::ornamentPinceCouperin:
return "other-ornament smufl=\"ornamentPinceCouperin\"";
break;

default:
; // nothing
Expand Down
31 changes: 31 additions & 0 deletions src/importexport/musicxml/internal/musicxml/importmxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,30 @@ static void addMordentToChord(const Notation& notation, ChordRest* cr)
}
}

//---------------------------------------------------------
// addOtherOrnamentToChord
//---------------------------------------------------------

/**
Add Other Ornament to Chord.
*/

static void addOtherOrnamentToChord(const Notation& notation, ChordRest* cr)
{
const QString name = notation.name();
const QString symname = notation.attribute("smufl");
SymId sym = SymId::noSym; // legal but impossible ArticulationType value here indicating "not found"
sym = SymNames::symIdByName(symname);

if (sym != SymId::noSym) {
Articulation* na = Factory::createArticulation(cr);
na->setSymId(sym);
cr->add(na);
} else {
LOGD("unknown ornament: name '%s': '%s'.", qPrintable(name), qPrintable(symname));
}
}

//---------------------------------------------------------
// convertArticulationToSymId
//---------------------------------------------------------
Expand Down Expand Up @@ -5860,6 +5884,11 @@ void MusicXMLParserNotations::ornaments()
} else if (_e.name() == "inverted-mordent"
|| _e.name() == "mordent") {
mordentNormalOrInverted();
} else if (_e.name() == "other-ornament") {
Notation notation = Notation::notationWithAttributes(_e.name().toString(),
_e.attributes(), "ornaments");
_notations.push_back(notation);
_e.skipCurrentElement(); // skip but don't log
} else {
skipLogCurrElem();
}
Expand Down Expand Up @@ -6551,6 +6580,8 @@ void MusicXMLParserNotations::addNotation(const Notation& notation, ChordRest* c
} else if (notation.parent() == "ornaments") {
if (notation.name() == "mordent" || notation.name() == "inverted-mordent") {
addMordentToChord(notation, cr);
} else if (notation.name() == "other-ornament") {
addOtherOrnamentToChord(notation, cr);
}
} else if (notation.parent() == "articulations") {
if (note && notation.name() == "chord-line") {
Expand Down
2 changes: 2 additions & 0 deletions src/palette/internal/palettecreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,8 @@ PalettePtr PaletteCreator::newOrnamentsPalette(bool defaultPalette)
SymId::ornamentPrecompSlide,
SymId::ornamentShake3,
SymId::ornamentShakeMuffat1,
SymId::ornamentTremblementCouperin,
SymId::ornamentPinceCouperin
};

for (auto ornamentType : defaultPalette ? defaultOrnaments : masterOrnaments) {
Expand Down
2 changes: 2 additions & 0 deletions tools/fonttools/smufl2sym-in-trans.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,14 @@
"metNoteWhole": null,
"ornamentMordent": null,
"ornamentMordentInverted": null,
"ornamentPinceCouperin": null,
"ornamentPrecompMordentUpperPrefix": null,
"ornamentPrecompSlide": null,
"ornamentShake3": null,
"ornamentShakeMuffat1": null,
"ornamentShortTrill": null,
"ornamentTremblement": null,
"ornamentTremblementCouperin": null,
"ornamentTrill": null,
"ornamentTurn": null,
"ornamentTurnInverted": null,
Expand Down