Skip to content

Commit

Permalink
Fix #306189: Extend Tremolo palette
Browse files Browse the repository at this point in the history
to allow for "Divide measured tremolo by [2-4.6]", `tremoloDivisiDots[2-4,6]`, implemented as articulations, actually even as staccatos, but (currently) without any playback effect on tremolos (as 'normal' staccatos don't work on those either).

Backport of musescore#10000
  • Loading branch information
Jojo-Schmitz committed Dec 7, 2021
1 parent 6eee7ea commit cc37d7c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
4 changes: 4 additions & 0 deletions fonttools/smufl2sym-in-trans.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@
"timeSigCut2": null,
"timeSigCut3": null,
"timeSigCutCommon": null,
"tremoloDivisiDots2": null,
"tremoloDivisiDots3": null,
"tremoloDivisiDots4": null,
"tremoloDivisiDots6": null,
"wiggleSawtooth": null,
"wiggleSawtoothWide": null,
"wiggleVibratoLargeFaster": null,
Expand Down
4 changes: 4 additions & 0 deletions importexport/musicxml/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2496,6 +2496,10 @@ static std::vector<QString> symIdToArtics(const SymId sid)

case SymId::articStaccatoAbove:
case SymId::articStaccatoBelow:
case SymId::tremoloDivisiDots2:
case SymId::tremoloDivisiDots3:
case SymId::tremoloDivisiDots4:
case SymId::tremoloDivisiDots6:
return { "staccato" };
break;

Expand Down
14 changes: 13 additions & 1 deletion libmscore/articulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@ Articulation::AnchorGroup Articulation::anchorGroup(SymId symId)
case SymId::luteFingeringRHThird:
return AnchorGroup::LUTE_FINGERING;

case SymId::tremoloDivisiDots2:
case SymId::tremoloDivisiDots3:
case SymId::tremoloDivisiDots4:
case SymId::tremoloDivisiDots6:
return AnchorGroup::ARTICULATION;

default:
break;
}
Expand All @@ -457,6 +463,10 @@ const char* Articulation::symId2ArticulationName(SymId symId)

case SymId::articStaccatoAbove:
case SymId::articStaccatoBelow:
case SymId::tremoloDivisiDots2:
case SymId::tremoloDivisiDots3:
case SymId::tremoloDivisiDots4:
case SymId::tremoloDivisiDots6:
return "staccato";

case SymId::articAccentStaccatoAbove:
Expand Down Expand Up @@ -590,7 +600,9 @@ bool Articulation::isStaccato() const
{
return _symId == SymId::articStaccatoAbove || _symId == SymId::articStaccatoBelow
|| _symId == SymId::articMarcatoStaccatoAbove || _symId == SymId::articMarcatoStaccatoBelow
|| _symId == SymId::articAccentStaccatoAbove || _symId == SymId::articAccentStaccatoBelow;
|| _symId == SymId::articAccentStaccatoAbove || _symId == SymId::articAccentStaccatoBelow
|| _symId == SymId::tremoloDivisiDots2 || _symId == SymId::tremoloDivisiDots3
|| _symId == SymId::tremoloDivisiDots4 || _symId == SymId::tremoloDivisiDots6;
}

bool Articulation::isAccent() const
Expand Down
8 changes: 4 additions & 4 deletions libmscore/sym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5824,10 +5824,10 @@ const std::array<const char*, int(SymId::lastSym)+1> Sym::symUserNames = { {
"Combining tremolo 3",
"Combining tremolo 4",
"Combining tremolo 5",
"Divide measured tremolo by 2",
"Divide measured tremolo by 3",
"Divide measured tremolo by 4",
"Divide measured tremolo by 6",
QT_TRANSLATE_NOOP("symUserNames", "Divide measured tremolo by 2"),
QT_TRANSLATE_NOOP("symUserNames", "Divide measured tremolo by 3"),
QT_TRANSLATE_NOOP("symUserNames", "Divide measured tremolo by 4"),
QT_TRANSLATE_NOOP("symUserNames", "Divide measured tremolo by 6"),
"Fingered tremolo 1",
"Fingered tremolo 2",
"Fingered tremolo 3",
Expand Down
22 changes: 16 additions & 6 deletions mscore/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,18 @@ PalettePanel* MuseScore::newTremoloPalettePanel()
tremolo->setTremoloType(TremoloType(i));
sp->append(tremolo, tremolo->subtypeName());
}

static const std::vector<SymId> dots {
SymId::tremoloDivisiDots2,
SymId::tremoloDivisiDots3,
SymId::tremoloDivisiDots4,
SymId::tremoloDivisiDots6
};
// include additional symbol-based tremolo articulations implemented as articulations
for (auto i : dots) {
Articulation* s = new Articulation(i, gscore);
sp->append(s, s->userName());
}
return sp;
}

Expand Down Expand Up @@ -901,7 +913,6 @@ PalettePanel* MuseScore::newArticulationsPalettePanel()
sp->setGrid(42, 25);
sp->setDrawGrid(true);

// do not include additional symbol-based fingerings (temporarily?) implemented as articulations
static const std::vector<SymId> fermatas {
SymId::fermataAbove,
SymId::fermataShortAbove,
Expand All @@ -915,6 +926,7 @@ PalettePanel* MuseScore::newArticulationsPalettePanel()
Fermata* f = new Fermata(i, gscore);
sp->append(f, f->userName());
}
// do not include additional symbol-based fingerings (temporarily?) implemented as articulations
static const std::vector<SymId> art {
SymId::articAccentAbove,
SymId::articStaccatoAbove,
Expand Down Expand Up @@ -986,7 +998,6 @@ PalettePanel* MuseScore::newOrnamentsPalettePanel()
sp->setGrid(42, 25);
sp->setDrawGrid(true);

// do not include additional symbol-based fingerings (temporarily?) implemented as articulations
static const std::vector<SymId> art {
SymId::ornamentTurnInverted,
SymId::ornamentTurnSlash,
Expand Down Expand Up @@ -1023,8 +1034,7 @@ PalettePanel* MuseScore::newAccordionPalettePanel()
sp->setGrid(42, 25);
sp->setDrawGrid(true);

// do not include additional symbol-based fingerings (temporarily?) implemented as articulations
static std::vector<SymId> art {
static const std::vector<SymId> art {
SymId::accdnCombDot,
SymId::accdnCombLH2RanksEmpty,
SymId::accdnCombLH3RanksEmptySquare,
Expand Down Expand Up @@ -1218,14 +1228,14 @@ PalettePanel* MuseScore::newClefsPalettePanel(bool defaultPalettePanel)
sp->setGrid(35, 50);
sp->setYOffset(1.0);

static std::vector<ClefType> clefsDefault {
static const std::vector<ClefType> clefsDefault {
ClefType::G, ClefType::G8_VA, ClefType::G15_MA, ClefType::G8_VB, ClefType::G15_MB, ClefType::G8_VB_O,
ClefType::G8_VB_P, ClefType::G_1, ClefType::C1, ClefType::C2, ClefType::C3,
ClefType::C4, ClefType::C5, ClefType::F, ClefType::F_8VA, ClefType::F_15MA,
ClefType::F8_VB, ClefType::F15_MB, ClefType::F_B, ClefType::F_C, ClefType::PERC,
ClefType::PERC2, ClefType::TAB, ClefType::TAB4
};
static std::vector<ClefType> clefsMaster {
static const std::vector<ClefType> clefsMaster {
ClefType::G, ClefType::G8_VA, ClefType::G15_MA, ClefType::G8_VB, ClefType::G15_MB, ClefType::G8_VB_O,
ClefType::G8_VB_P, ClefType::G_1, ClefType::C1, ClefType::C2, ClefType::C3,
ClefType::C4, ClefType::C5, ClefType::C_19C, ClefType::C1_F18C, ClefType::C3_F18C, ClefType::C4_F18C, ClefType::C1_F20C, ClefType::C3_F20C, ClefType::C4_F20C,
Expand Down

0 comments on commit cc37d7c

Please sign in to comment.