-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd.qml
148 lines (132 loc) · 4.74 KB
/
add.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
//==============================================
// Cautionary Accidentals v4.0
// https://github.com/XiaoMigros/Cautionary-Accidentals
// Copyright (C)2023 XiaoMigros
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// 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, see <http://www.gnu.org/licenses/>.
//==============================================
import QtQuick 2.0
import MuseScore 3.0
import Qt.labs.settings 1.0
import "assets/defaultsettings.js" as DSettings
import "assets/accidentals.js" as Accidentals
MuseScore {
title: qsTr("Add Cautionary Accidentals")
version: "4.0"
description: qsTr("This plugin adds cautionary accidentals to the score")
categoryCode: "composing-arranging-tools"
thumbnailName: "assets/logo.png"
requiresScore: true
// TODO:
// Add option to restate accidentals coming from chromatic runs
//===============================================================================
// Settings
//===============================================================================
// Cancel single accidentals when preceded by double
property var setting0: {
"addNaturals": false
}
// Notes in same measure at different octave
property var setting1: {
"addAccidentals": true, // If to cancel, bracket type
"bracketType": 0, // 0 = no brackets, 1 = round, 2 = square
"parseGraceNotes": true, // Include grace notes in calculations and adding
"durationMode": 0 // How to parse durations (0": not before, 1": instantaneous, 2": during)
}
// Notes in same measure in different staves (of same instrument)
property var setting2: {
"addAccidentals": true,
"bracketType": 0,
"parseGraceNotes": true,
"durationMode": 0
}
// Notes in same measure, different octave, different staves
property var setting3: {
"addAccidentals": true,
"bracketType": 0,
"parseGraceNotes": false,
"durationMode": 0
}
// Notes in different measures
property var setting4: {
// same octave
"a": {
"addAccidentals": true,
"bracketType": 0,
"parseGraceNotes": true
},
// different octaves
"b": {
"addAccidentals": true,
"bracketType": 0,
"parseGraceNotes": false
}
}
// Notes in different measures & different staves
property var setting5: {
"a": {
"addAccidentals": true,
"bracketType": 0,
"parseGraceNotes": false
},
"b": {
"addAccidentals": false,
"bracketType": 0,
"parseGraceNotes": false
}
}
// (same) Notes after grace notes that add accidental
property var setting6: {
"a": {
"addAccidentals": true,
"bracketType": 0
},
// add to notes in different staves
"b": {
"addAccidentals": true,
"bracketType": 0
}
}
// Notes over a key change (new bar)
property var setting7: {
"addAccidentals": true, // If to run
"bracketType": 0, // Bracket type
"cancelOctaves": false, // Cancel in different octaves
"parseGraceNotes": true, // Include grace notes in calculation and adding
"cancelMode": true // Excessive cancelling mode (see setting9)
}
// Notes over a key change (mid bar)
property var setting8: {
"addAccidentals": true,
"bracketType": 0,
"cancelOctaves": false,
"parseGraceNotes": true,
"cancelMode": true
}
// How to handle excessive cancelling
property var setting9: {
"a": true, // In same measure
"b": true // In different measures
}
//option true: add accidentals as needed until cancelled in original octave
// notes of same tick get cancelled
// cancelling has to happen in original staff
//option false: continue to add accidentals as needed if not previously cancelled in same octave
onRun: Accidentals.runPlugin("add")
Settings {
id: options
category: "Cautionary Accidentals Plugin"
property var uSettings
}
}