Skip to content

Commit 5651fc2

Browse files
committed
Merge branch 'master' of https://github.com/jwink75/lua-scripts
2 parents d091a3f + 2de1a28 commit 5651fc2

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed

Diff for: dist/expression_scale_noscale.lua

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
function plugindef()
2+
finaleplugin.RequireSelection = true
3+
finaleplugin.Author = "Jacob Winkler"
4+
-- finaleplugin.AuthorURL = "http://"
5+
finaleplugin.Copyright = "CC0 https://creativecommons.org/publicdomain/zero/1.0/"
6+
finaleplugin.Version = "v1.0"
7+
finaleplugin.Date = "2022/07/30"
8+
finaleplugin.ScriptGroupName = "Expressions: Scaling"
9+
finaleplugin.ScriptGroupDescription = [[
10+
Sets the scaling parameter of any expressions in a selection to on or off.
11+
12+
By default, if you resize a note or rest, any attached expressions will get scaled by the same amount. By turning scaling to 'off' you can override this behavior and always keep the expression at the defined size.
13+
14+
Note that these scripts do not work on expressions assigned to a staff list, such as those found in the Tempo Marks or Tempo Alterations categories.
15+
]]
16+
finaleplugin.AdditionalMenuOptions = [[
17+
Expressions: Scaling ON
18+
]]
19+
finaleplugin.AdditionalUndoText = [[
20+
Expressions: Scaling ON
21+
]]
22+
finaleplugin.AdditionalDescriptions = [[
23+
Turns on expression scaling in the selected region.
24+
]]
25+
finaleplugin.AdditionalPrefixes = [[
26+
scale_bool = true
27+
]]
28+
-- finaleplugin.MinJWLuaVersion = 0.63
29+
-- finaleplugin.ScriptGroupName = ""
30+
finaleplugin.Notes = [[
31+
This plug-in will set or clear the option to scale with entries in the selected region. It will not work on expressions that are assigned to staff lists, such as tempo marks and tempo alterations.
32+
]]
33+
return "Expressions: Scaling OFF", "Expressions: Scaling OFF", "Turns off expression scaling in the selected region."
34+
end
35+
36+
scale_bool = scale_bool or false
37+
38+
function expressions_scale(scale_bool)
39+
local expressions = finale.FCExpressions()
40+
expressions:LoadAllForRegion(finenv.Region())
41+
42+
for exp in each(expressions) do
43+
exp:SetScaleWithEntry(scale_bool)
44+
exp:Save()
45+
end
46+
end
47+
48+
expressions_scale(scale_bool)

Diff for: docs/library/smartshape.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SmartShape
2+
3+
## Functions
4+
5+
- [smartshape_entrybased(start_note, end_note, type)](#smartshape_entrybased)
6+
7+
### smartshape_entrybased
8+
9+
```lua
10+
smartshape.smartshape_entrybased(start_note, end_note, type)
11+
```
12+
13+
[View source](https://github.com/finale-lua/lua-scripts/tree/master/src/library/smartshape.lua#L-1)
14+
15+
Creates an entry based SmartShape based on two input notes. If a type is not specified, creates a slur.
16+
17+
| Input | Type | Description |
18+
| ----- | ---- | ----------- |
19+
| `start_note` | `FCNoteEntry` | Starting note for SmartShape. |
20+
| `end_note` | `FCNoteEntry` | Ending note for SmartShape. |
21+
| `type` | `SMARTSHAPE_TYPES or string` | |

Diff for: src/library/smartshape.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ local smartshape = {}
3434
"bend" = finale.SMARTSHAPE_BEND_HAT,
3535
"bendcurve" = finale.SMARTSHAPE_BEND_CURVE,
3636
"bend_curve" = finale.SMARTSHAPE_BEND_CURVE
37-
}
38-
37+
}
38+
3939
--[[
4040
% smartshape_entrybased
4141
@@ -71,6 +71,7 @@ function smartshape.add_entry_based_smartshape(start_note, end_note, shape_type)
7171
right_segment:SetStaff(end_note.Staff)
7272
right_segment:SetMeasure(end_note.Measure)
7373

74+
7475
if (shape == finale.SMARTSHAPE_TABSLIDE) or (shape == finale.SMARTSHAPE_GLISSANDO) then
7576
if shape == finale.SMARTSHAPE_GLISSANDO then
7677
smartshape.LineID = 1
@@ -81,6 +82,7 @@ function smartshape.add_entry_based_smartshape(start_note, end_note, shape_type)
8182
left_segment.NoteID = 1 -- If there is more than 1 note in the entry, shape will be attached to the first one entered
8283
right_segment.NoteID = 1
8384
right_segment:SetCustomOffset(true)
85+
8486
local accidentals = 0
8587
local start_note_staff_pos = 0
8688
local end_note_staff_pos = 0

0 commit comments

Comments
 (0)