-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRecorder_Tablature_A_G3.qml
118 lines (109 loc) · 4.38 KB
/
Recorder_Tablature_A_G3.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//=============================================================================
// MuseScore
//
// Recorder Woodwind Tablature plugin
//
// Copyright (C)2011 Dario Escobedo, Werner Schweer and others
// This is a variation of Werner Schweer very famous recorder_fingering plugin,
// using Matthew Hindson Woodwind Tablature font. This font is located at
// http://www.hindson.com.au/fonts/RecorderTablature.zip. Dario Escobedo, Werner
// Schweer and others are not the owners of the the font itself.
//
// Modified for MuseScore 2 in 2016 by Maksim Samsyka. And use new Recorder font
// created by Alberto Gomez Gomez (algomgom@gmail.com) on July 26, 2006, and
// located at http://www.fontspace.com/algomgom/recorder
// This font was modified too to include Yamaha fingerings.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
import QtQuick 2.1
import QtQuick.Dialogs 1.0
import QtQuick.Controls 1.0
import MuseScore 3.0
MuseScore {
version: "2.0"
description: "Place recorder tablature under notes"
menuPath: "Plugins.Recorder Tablature.Alto German"
pluginType: "dialog"
id:window
width: 200; height: 100;
Label {
id: textLabel
wrapMode: Text.WordWrap
text: qsTr("Font size:")
font.pointSize:11
anchors.left: window.left
anchors.top: window.top
anchors.leftMargin: 10
anchors.topMargin: 10
}
SpinBox {
id:fontSize
anchors.top: window.top
anchors.left: textLabel.right
anchors.right: window.right
anchors.topMargin: 10
anchors.leftMargin: 10
anchors.rightMargin: 10
height: 25
font.pointSize: 11
minimumValue: 15
maximumValue: 60
value: 35
}
Button {
id : buttonOk
text: qsTr("Ok")
anchors.bottom: window.bottom
anchors.left: window.left
anchors.bottomMargin: 10
anchors.leftMargin: 50
isDefault: true
onClicked: {
curScore.startCmd();
placeTab(fontSize.value);
curScore.endCmd();
Qt.quit();
}
}
// c c# d d# e f f# g g# a a# b C C# D D# E F F# G G# A A# B c c# d
property variant fingerings : [ "A", "Z", "S", "X", "D", "F", "V", "G", "B", "H", "N", "J", "Q", "@", "W", "#", "E", "R", "%", "T", "^", "Y", "&", "U", "I", "(", "O"]
function placeTab(size){
var cursor = curScore.newCursor();
cursor.staffIdx = 0; // start on first staff
cursor.voice = 0; // hope that only one voice in score, for recorder :)
cursor.rewind(0); // set cursor to start of score
while (cursor.segment) { // in end segment is null
if (cursor.element._name() == "Chord") {
var pitch = cursor.element.notes[0].pitch;
var index = pitch - 53;
if(index >= 0 && index < fingerings.length){
var text = newElement(Element.STAFF_TEXT);
text.fontSize = size;
text.fontFace = "Recorder Font";
text.text = fingerings[index];
console.log(text.text);
text.offsetY = -10;
text.placement=Placement.BELOW;
cursor.add(text);
}// end if
}// end if
cursor.next();
}// end while
}
onRun: {
console.log("Hello from Recorder Woodwind Tablature");
if (typeof curScore === 'undefined')
Qt.quit();
}
}