Script to add a whole rest with fermata
Moderators: Peter Thomsen, miker
- motet
- Posts: 8292
- Joined: Tue Dec 06, 2016 8:33 pm
- Finale Version: 2014.5,2011,2005,27
- Operating System: Windows
I often need to add a whole rest with a fermata to an empty measure and would like to automate it. I can call the plug-in "Change to real whole rests" from FinaleScript, but how to apply the fermata? Utilities/Apply articulation doesn't work with rests. Any JW Lua experts out there?
But as Expression?motet wrote:I often need to add a whole rest with a fermata to an empty measure and would like to automate it. I can call the plug-in "Change to real whole rests" from FinaleScript, but how to apply the fermata? Utilities/Apply articulation doesn't work with rests. Any JW Lua experts out there?
www.notat.io - A Forum devoted to the Practice of Music Notation
- motet
- Posts: 8292
- Joined: Tue Dec 06, 2016 8:33 pm
- Finale Version: 2014.5,2011,2005,27
- Operating System: Windows
If you mean a centered expression, I've done that in the past, but discovered long ago I prefer a real rest because it automatically breaks a multi-measure rest before and after. You can set the expression to break a multimeasure rest, but you would have to also set the measure attribute to break after, which would be an extra step, or else you get something like this:
- motet
- Posts: 8292
- Joined: Tue Dec 06, 2016 8:33 pm
- Finale Version: 2014.5,2011,2005,27
- Operating System: Windows
Interesting, but I'd like it to work in 2/4, say, and Simple entry, which can do articulations, will turn a whole note into a half tied to a half in the next bar. With Speedy, I don't know how to add the articulation.
It looks like I can instead position the mouse over the default whole rest, then:
I was hoping some JW Lua ace would happen along. Then you could select several measures or staves and do them all at once. Maybe I'll try my luck with JW Lua; there's barely any documentation, though.
It looks like I can instead position the mouse over the default whole rest, then:
- Selection tool
- Click to select the measure
- Run real-rest plug-in
- Articulation tool
- Click to go to the measure
- F metatool+click to add the fermata
I was hoping some JW Lua ace would happen along. Then you could select several measures or staves and do them all at once. Maybe I'll try my luck with JW Lua; there's barely any documentation, though.
- zuill
- Posts: 4418
- Joined: Sat Dec 10, 2016 9:35 pm
- Finale Version: Finale 2011-v26.3.1
- Operating System: Windows
You can copy/paste. If you don't want to waste the ctrl-v, then save to a clip file instead. Then, select the measure, and do Alt/E/P to paste from the clip file. Probably as easy, if not easier, than a Lua Script, or anything else.
Zuill
Zuill
Windows 10, Finale 2011-v26.3.1
"When all is said and done, more is said than done."
"When all is said and done, more is said than done."
- motet
- Posts: 8292
- Joined: Tue Dec 06, 2016 8:33 pm
- Finale Version: 2014.5,2011,2005,27
- Operating System: Windows
The clipboard is transitory and I don't want to set it up every time (this is something I do a lot).
I've never used clip files--finally found them in the manual. It looks to me like you need to click the edit menu while holding down Ctrl, then continue to hold down Ctrl while clicking "paste from clip file" (P doesn't work--if Ctrl is held down nothing happens; if you release Ctrl and type P it pastes from the clipboard).
I'm looking for a hotkey solution. Perhaps FinaleScript can do the clip-file pasting--I don't know.
The FinaleScript scheme in the posting above almost works, but I can't find out how to get FinaleScript to use a metatool. If I put the fermata first in the list of articulations, then I can have FinaleScript double-click and get it, but I would like it to work with the default articulation order.
I've never used clip files--finally found them in the manual. It looks to me like you need to click the edit menu while holding down Ctrl, then continue to hold down Ctrl while clicking "paste from clip file" (P doesn't work--if Ctrl is held down nothing happens; if you release Ctrl and type P it pastes from the clipboard).
I'm looking for a hotkey solution. Perhaps FinaleScript can do the clip-file pasting--I don't know.
The FinaleScript scheme in the posting above almost works, but I can't find out how to get FinaleScript to use a metatool. If I put the fermata first in the list of articulations, then I can have FinaleScript double-click and get it, but I would like it to work with the default articulation order.
- motet
- Posts: 8292
- Joined: Tue Dec 06, 2016 8:33 pm
- Finale Version: 2014.5,2011,2005,27
- Operating System: Windows
Got it to work with AutoHotkey. It's very fast--less than a second.
Code: Select all
; Ctrl-Shift-F: Add a whole rest with fermata. Run with the mouse cursor on the default rest
^+f::
Send !tt ; selection tool
Click ; select measure
Send !inccc{Enter} ; real-rests plug-in
Send !ta ; articulation tool
Click ; go to measure
Send {f down} ; F key down--fermata metatool
Click ; add fermata
Send {f up} ; F key up
Send !tt ; selection tool
Return
- Peter Thomsen
- Posts: 6627
- Joined: Fri Jul 25, 2003 6:47 pm
- Finale Version: Finale v27.4
- Operating System: Mac
If I Recall Correctly, AutoHotkey is automation software for Windows (motet is using Windows).
Fortunately there is automation software for Mac OS, too.
What automation do you need?
Depending on your actual needs, take a look at Automator, or Keyboard Maestro.
Fortunately there is automation software for Mac OS, too.
What automation do you need?
Depending on your actual needs, take a look at Automator, or Keyboard Maestro.
Mac OS X 12.6.9 (Monterey), Finale user since 1996
- motet
- Posts: 8292
- Joined: Tue Dec 06, 2016 8:33 pm
- Finale Version: 2014.5,2011,2005,27
- Operating System: Windows
With great effort and help from Jan Angermüller and others, I was able to write a JW Lua script to accomplish this. After filling in the measure for those instruments which play, you can double-click to select the whole measure stack, then run the plug-in, which will put whole rests with fermatas in the staves with no music.
I suppose even better would be something that looks through the entire document for fermatas and adds whole rests with fermatas where needed, but this will have to do for now since I need to get back to work.
Here's the script for those interested:
I suppose even better would be something that looks through the entire document for fermatas and adds whole rests with fermatas where needed, but this will have to do for now since I need to get back to work.
Here's the script for those interested:
Code: Select all
-- Add whole rests with fermatas to empty measures --
function plugindef()
-- This function and the 'finaleplugin' namespace
-- are both reserved for the plug-in definition.
finaleplugin.RequireSelection = true
finaleplugin.Author = "Motet"
finaleplugin.Copyright = "none"
finaleplugin.Version = "1.0"
finaleplugin.Notes = [[
Assumes the F metatool is mapped to Finale's default fermata articulation.
Altered fermata articulations may not work.
]]
finaleplugin.Date = "September 30, 2018"
return "Fermatas", "", "Add whole rests with fermatas to empty measures"
end
local metakey = string.byte("F")
local fermatadef = finale.FCArticulationDef()
local metatools = finale.FCMetatoolAssignments()
metatools:SetMode(finale.MTOOLMODE_ARTICULATION)
metatools:LoadAll()
for metatool in each(metatools) do
if metatool.Keystroke == metakey then
fermatadef:Load(metatool:GetDefID())
break
end
end
if fermatadef.ItemNo == 0 then
finenv.UI():AlertError("Fermata metatool not found", "Fermatas")
return
end
for m, s in eachcell(finenv.Region()) do
local cell = finale.FCCell(m, s)
notecell = finale.FCNoteEntryCell(m, s)
notecell:Load()
if notecell:IsEmpty() then
entry = notecell:AppendEntriesInLayer(1, 1)
if entry then
entry.Duration = finale.WHOLE_NOTE
entry.Legality = true
entry:MakeRest()
notecell:Save()
local index = notecell:GetIndexOf(entry)
notecell:Load()
entry = notecell:GetItemAt(index)
local fermata = finale.FCArticulation()
fermata:SetArticulationDef(fermatadef)
fermata:SetNoteEntry(entry)
fermata:ResetPos(fermatadef)
fermata.HorizontalPos = -14
fermata:SaveNew()
notecell:Save()
end
end
end