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).
  • Loading branch information
Jojo-Schmitz committed Oct 29, 2022
1 parent a3f332c commit 7442134
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
14 changes: 13 additions & 1 deletion src/engraving/libmscore/articulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,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 @@ -562,6 +568,10 @@ String Articulation::symId2ArticulationName(SymId symId)

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

case SymId::articAccentStaccatoAbove:
Expand Down Expand Up @@ -696,7 +706,9 @@ void Articulation::computeCategories()
_symId == SymId::articStaccatoAbove || _symId == SymId::articStaccatoBelow
|| _symId == SymId::articMarcatoStaccatoAbove || _symId == SymId::articMarcatoStaccatoBelow
|| _symId == SymId::articTenutoStaccatoAbove || _symId == SymId::articTenutoStaccatoBelow
|| _symId == SymId::articAccentStaccatoAbove || _symId == SymId::articAccentStaccatoBelow);
|| _symId == SymId::articAccentStaccatoAbove || _symId == SymId::articAccentStaccatoBelow
|| _symId == SymId::tremoloDivisiDots2 || _symId == SymId::tremoloDivisiDots3
|| _symId == SymId::tremoloDivisiDots4 || _symId == SymId::tremoloDivisiDots6);

m_categories.setFlag(ArticulationCategory::ACCENT,
_symId == SymId::articAccentAbove || _symId == SymId::articAccentBelow
Expand Down
8 changes: 4 additions & 4 deletions src/engraving/types/symnames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5879,10 +5879,10 @@ constexpr const std::array<const char*, size_t(SymId::lastSym) + 1> SymNames::s_
"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
18 changes: 15 additions & 3 deletions src/palette/internal/palettecreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,19 @@ PalettePtr PaletteCreator::newTremoloPalette()
tremolo->setTremoloType(TremoloType(i));
sp->appendElement(tremolo, tremolo->subtypeUserName());
}

static const SymIdList dots {
SymId::tremoloDivisiDots2,
SymId::tremoloDivisiDots3,
SymId::tremoloDivisiDots4,
SymId::tremoloDivisiDots6
};
// include additional symbol-based tremolo articulations, implemented as articulations
for (auto i : dots) {
auto s = Factory::makeArticulation(gpaletteScore->dummy()->chord());
s->setSymId(i);
sp->appendElement(s, s->typeUserName());
}
return sp;
}

Expand Down Expand Up @@ -675,6 +688,7 @@ PalettePtr PaletteCreator::newArticulationsPalette(bool defaultPalette)
auto slur = Factory::makeSlur(gpaletteScore->dummy());
sp->appendElement(slur, QT_TRANSLATE_NOOP("palette", "Slur"));

// do not include additional symbol-based fingerings (temporarily?) implemented as articulations
static const SymIdList defaultArticulations {
SymId::articAccentAbove,
SymId::articStaccatoAbove,
Expand Down Expand Up @@ -771,7 +785,6 @@ PalettePtr PaletteCreator::newOrnamentsPalette(bool defaultPalette)
sp->setDrawGrid(true);
sp->setVisible(false);

// do not include additional symbol-based fingerings (temporarily?) implemented as articulations
static const SymIdList defaultOrnaments {
SymId::ornamentTurnInverted,
SymId::ornamentTurn,
Expand Down Expand Up @@ -831,8 +844,7 @@ PalettePtr PaletteCreator::newAccordionPalette()
sp->setDrawGrid(true);
sp->setVisible(false);

// do not include additional symbol-based fingerings (temporarily?) implemented as articulations
static SymIdList art {
static const SymIdList art {
SymId::accdnCombDot,
SymId::accdnCombLH2RanksEmpty,
SymId::accdnCombLH3RanksEmptySquare,
Expand Down
4 changes: 4 additions & 0 deletions tools/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

0 comments on commit 7442134

Please sign in to comment.