Skip to content

Commit 76e3b32

Browse files
authored
Merge pull request finale-lua#554 from cv-on-hub/cv_meter_numeric
Update meter_set_numeric.lua
2 parents b1ccba6 + 9fb820a commit 76e3b32

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

src/meter_set_numeric.lua

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
function plugindef()
22
finaleplugin.RequireSelection = true
33
finaleplugin.Author = "Carl Vine"
4-
finaleplugin.AuthorURL = "https://carlvine.com/?cv=lua"
4+
finaleplugin.AuthorURL = "https://carlvine.com/lua/"
55
finaleplugin.Copyright = "https://creativecommons.org/licenses/by/4.0/"
6-
finaleplugin.Version = "0.68"
7-
finaleplugin.Date = "2023/06/12"
6+
finaleplugin.Version = "0.70"
7+
finaleplugin.Date = "2023/07/25"
88
finaleplugin.MinJWLuaVersion = 0.60
9-
finaleplugin.Notes = [["Meter Set Numeric" provides rapid entry of simple or complex
10-
time signatures with a few keystrokes.
11-
It supports composite numerators like [3+2+3/16] and can join
12-
with further composites (e.g. [3+2+3/16]+[1/4]+[5+4/8]).
13-
"Display only" time signatures can be equally complex and set without using a mouse.
14-
At startup the time signature of the first selected measure is shown.
15-
Click the "Clear All" button to revert to a simple 4/4 with no other options.
9+
finaleplugin.Notes = [[
10+
This script provides rapid entry of simple or complex
11+
time signatures with a few keystrokes.
12+
It supports composite numerators like [3+2+3/16] and can join
13+
with further composites (e.g. [3+2+3/16]+[1/4]+[5+4/8]).
14+
"Display only" time signatures can be equally complex and set without using a mouse.
15+
At startup the time signature of the first selected measure is shown.
16+
Click the "Clear All" button to revert to a simple 4/4 with no other options.
1617
17-
All measures in the current selection will be assigned the new time signature.
18-
If just one measure is selected only it will be changed.
18+
All measures in the current selection will be assigned the new time signature.
19+
If just one measure is selected only it will be changed.
1920
20-
"Bottom" numbers (denominators) are the usual "note" numbers: 2, 4, 8, 16, 32, 64.
21-
"Top" numbers (numerators) are integers, optionally joined by '+' signs for composite meters.
22-
Multiples of 3 automatically convert to compound signatures so [9/16] will
23-
convert to three groups of dotted 8ths.
24-
To prevent automatic compounding, instead of the bottom 'note' number enter its EDU value
25-
(quarter note = 1024; eighth note = 512 etc).
21+
"Bottom" numbers (denominators) are the usual "note" numbers: 2, 4, 8, 16, 32, 64.
22+
"Top" numbers (numerators) are integers, optionally joined by '+' signs for composite meters.
23+
Multiples of 3 automatically convert to compound signatures so [9/16] will
24+
convert to three groups of dotted 8ths.
25+
To prevent automatic compounding, instead of the bottom 'note' number enter its EDU value
26+
(quarter note = 1024; eighth note = 512 etc).
2627
27-
Empty and zero "Top" numbers will be ignored.
28-
If "Secondary" numbers are zero then "Tertiary" values are ignored.
28+
Empty and zero "Top" numbers will be ignored.
29+
If "Secondary" numbers are zero then "Tertiary" values are ignored.
2930
]]
3031
return "Meter Set Numeric", "Meter Set Numeric", "Set the Meter Numerically"
3132
end
@@ -113,8 +114,9 @@ function user_chooses_meter(meter, rgn)
113114
cstat(1, y, x[3], "DISPLAY SIGNATURE")
114115
cstat(3, y, 150, "(set to '0' for none)")
115116
dialog:CreateButton(x[5] + 60, y):SetText("?"):SetWidth(20)
116-
:AddHandleCommand(function() finenv.UI():AlertInfo(finaleplugin.Notes:gsub(" \n", " "), "INFO: Meter Set Numeric") end)
117-
117+
:AddHandleCommand(function()
118+
finenv.UI():AlertInfo(finaleplugin.Notes:gsub(" %s+", " "), "About " .. plugindef())
119+
end)
118120
-- USER EDIT BOXES
119121
y = 0
120122
local box = {} -- user's edit-box entry responses
@@ -127,7 +129,7 @@ function user_chooses_meter(meter, rgn)
127129
:SetText(join(t_sig.top[group])):SetWidth(65)
128130
box[id + 3] = dialog:CreateEdit(x[4], y - offset, tostring(id + 3))
129131
:SetInteger(t_sig.bottom[group] or 0):SetWidth(65)
130-
cstat(x[2] + label_off[group], y, 95, label[group])
132+
cstat(x[2] + label_off[group], y, 56 - label_off[group], label[group])
131133
end
132134
y = y_middle
133135
end
@@ -154,6 +156,7 @@ function user_chooses_meter(meter, rgn)
154156
for group = 1, 3 do
155157
local id = count + group
156158
choices[id] = self:GetControl(tostring(id)):GetText() or "0"
159+
if choices[id] == "" then choices[id] = "0" end
157160
choices[id + 3] = math.abs(self:GetControl(tostring(id + 3)):GetInteger()) or 0
158161
end
159162
end

0 commit comments

Comments
 (0)