-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrill_adjust.qml
35 lines (33 loc) · 1.07 KB
/
Trill_adjust.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
35
/*
* 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.Adjust Positions"
description: "Adjust positions of baroque trills"
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.SYMBOL && el.symbol == SymId.ornamentShake3 || el.symbol == SymId.ornamentShakeMuffat1 || el.symbol == SymId.ornamentTremblementCouperin) {
var note = el.parent;
var nY = note.posY;
if (el.symbol == SymId.ornamentTremblementCouperin) {
el.offsetY = nY > 1 ? -1 - nY : -2;
}
else {
el.offsetY = nY > 0.5 ? -1 - nY : -1.5;
}
}
}
curScore.endCmd();
cmd("escape");
Qt.quit()
}
}