@@ -3,8 +3,8 @@ function plugindef()
3
3
finaleplugin .Author = " Carl Vine"
4
4
finaleplugin .AuthorURL = " https://carlvine.com/lua/"
5
5
finaleplugin .Copyright = " https://creativecommons.org/licenses/by/4.0/"
6
- finaleplugin .Version = " 0.82 "
7
- finaleplugin .Date = " 2024/01/25 "
6
+ finaleplugin .Version = " 0.83 "
7
+ finaleplugin .Date = " 2024/01/27 "
8
8
finaleplugin .MinJWLuaVersion = 0.60
9
9
finaleplugin .Notes = [[
10
10
This script allows rapid creation of simple or complex
@@ -90,29 +90,29 @@ local config = {
90
90
}
91
91
configuration .get_user_settings (script_name , config , true )
92
92
93
- function blank_meter ()
93
+ local function blank_meter ()
94
94
return { -- empty composite meter record
95
95
main = { top = {}, bottom = {} },
96
96
display = { top = {}, bottom = {} }
97
97
}
98
98
end
99
99
100
- function dialog_set_position (dialog )
100
+ local function dialog_set_position (dialog )
101
101
if config .window_pos_x and config .window_pos_y then
102
102
dialog :StorePosition ()
103
103
dialog :SetRestorePositionOnlyData (config .window_pos_x , config .window_pos_y )
104
104
dialog :RestorePosition ()
105
105
end
106
106
end
107
107
108
- function dialog_save_position (dialog )
108
+ local function dialog_save_position (dialog )
109
109
dialog :StorePosition ()
110
110
config .window_pos_x = dialog .StoredX
111
111
config .window_pos_y = dialog .StoredY
112
112
configuration .save_user_settings (script_name , config )
113
113
end
114
114
115
- function user_chooses_meter (meter , rgn )
115
+ local function user_chooses_meter (meter , rgn )
116
116
local x = { 0 , 70 , 130 , 210 , 280 , 290 } -- horizontal grid
117
117
local label = { -- data type descriptors and (range right) horizontal offset
118
118
{ " PRIMARY" , 0 }, -- name, horiz (left) offset
@@ -238,7 +238,7 @@ function user_chooses_meter(meter, rgn)
238
238
return ok , choices
239
239
end
240
240
241
- function encode_current_meter (time_sig , sub_meter )
241
+ local function encode_current_meter (time_sig , sub_meter )
242
242
local function numerators_treble (top_table )
243
243
for j = 1 , # top_table do
244
244
top_table [j ] = top_table [j ] * 3
@@ -281,7 +281,7 @@ function encode_current_meter(time_sig, sub_meter)
281
281
end
282
282
end
283
283
284
- function copy_meter_from_score (measure_number )
284
+ local function copy_meter_from_score (measure_number )
285
285
local measure = finale .FCMeasure ()
286
286
measure :Load (measure_number )
287
287
local meter = blank_meter ()
@@ -292,15 +292,15 @@ function copy_meter_from_score(measure_number)
292
292
return meter
293
293
end
294
294
295
- function is_power_of_two (num )
295
+ local function is_power_of_two (num )
296
296
local current = 1
297
297
while current < num do
298
298
current = current * 2
299
299
end
300
300
return current == num
301
301
end
302
302
303
- function convert_choices_to_meter (choices , meter )
303
+ local function convert_choices_to_meter (choices , meter )
304
304
if choices [1 ] == " 0" or choices [1 ] == " " or choices [4 ] == 0 then
305
305
return " Primary time signature cannot be zero"
306
306
end
@@ -343,7 +343,7 @@ function convert_choices_to_meter(choices, meter)
343
343
return " " -- no error
344
344
end
345
345
346
- function new_composite_top (sub_meter )
346
+ local function new_composite_top (sub_meter )
347
347
local composite_top = finale .FCCompositeTimeSigTop ()
348
348
for count = 1 , 3 do
349
349
if not sub_meter [count ] or sub_meter [count ][1 ] == 0 then break end
@@ -356,7 +356,7 @@ function new_composite_top(sub_meter)
356
356
return composite_top
357
357
end
358
358
359
- function new_composite_bottom (sub_meter )
359
+ local function new_composite_bottom (sub_meter )
360
360
local composite_bottom = finale .FCCompositeTimeSigBottom ()
361
361
for count = 1 , 3 do
362
362
if not sub_meter [count ] or sub_meter [count ] == 0 then break end
@@ -367,8 +367,7 @@ function new_composite_bottom(sub_meter)
367
367
return composite_bottom
368
368
end
369
369
370
-
371
- function fix_new_top (composite_top , time_sig , numerator )
370
+ local function fix_new_top (composite_top , time_sig , numerator )
372
371
if composite_top ~= nil then -- COMPOSITE top
373
372
time_sig :SaveNewCompositeTop (composite_top )
374
373
else
@@ -380,7 +379,7 @@ function fix_new_top(composite_top, time_sig, numerator)
380
379
end
381
380
end
382
381
383
- function fix_new_bottom (composite_bottom , time_sig , denominator )
382
+ local function fix_new_bottom (composite_bottom , time_sig , denominator )
384
383
if composite_bottom ~= nil then -- COMPOSITE bottom
385
384
time_sig :SaveNewCompositeBottom (composite_bottom )
386
385
else
@@ -392,7 +391,7 @@ function fix_new_bottom(composite_bottom, time_sig, denominator)
392
391
end
393
392
end
394
393
395
- function create_new_meter ()
394
+ local function create_new_meter ()
396
395
local region = mixin .FCMMusicRegion ()
397
396
region :SetRegion (finenv .Region ()):SetStartMeasurePosLeft ():SetEndMeasurePosRight ()
398
397
0 commit comments