-
Notifications
You must be signed in to change notification settings - Fork 0
/
Trill_replace_Treblement_Couperin.qml
34 lines (33 loc) · 1.09 KB
/
Trill_replace_Treblement_Couperin.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* GNU General Public License v3.0
* author: sammik (C) 2022
* https://github.com/sammik/musescore-plugin-baroque-trills-engraver
*/
import QtQuick 2.0
import MuseScore 3.0
MuseScore {
menuPath: "Plugins.Baroque Trills.Create 'Tremblement appuyé (Couperin)'"
description: "Replace default short trill with baroque one"
version: "1.1"
onRun: {
cmd("select-all");
curScore.startCmd();
var els = curScore.selection.elements;
for (var i in els) {
var el = els[i];
if (el.type == Element.ARTICULATION && el.symbol == SymId.ornamentShortTrill && el.visible == true) {
el.visible = false;
var note = el.parent.notes[el.parent.notes.length - 1];
var nY = note.posY;
var sym = newElement(Element.SYMBOL);
sym.symbol = "ornamentTremblementCouperin";
note.add(sym);
sym.offsetY = nY > 1 ? -1 - nY : -2;
sym.offsetX = -0.4;
}
}
curScore.endCmd();
cmd("escape");
Qt.quit()
}
}