[JW Lua] Artificial Harmonics script
Jari Williamsson
jari.williamsson at mailbox.swipnet.se
Fri Aug 9 16:07:02 CEST 2013
Hello All!
Here's a script that you can use in the next JW Lua beta. It will create
visual string harmonics on all perfect 4ths in the selected region. One
difference compared to Finale's built-in solution is that it makes the
diamond notehead a little larger (110%) to better match the normal
notehead.
---
for entry in eachentrysaved(finenv.Region()) do
-- Only process 2-note chords
if (entry.Count ~= 2) then goto continue end
-- Only process (enharmonically) perfect 4ths
local highestnote = entry:CalcHighestNote(nil)
local lowestnote = entry:CalcLowestNote(nil)
local mididiff = highestnote:CalcMIDIKey() - lowestnote:CalcMIDIKey()
if mididiff ~= 5 then goto continue end
-- Create a notehead modification object
local notehead = finale.FCNoteheadMod()
-- Remove any old notehead data for this entry
notehead:EraseAt(lowestnote)
notehead:EraseAt(highestnote)
-- Create a diamond character that is 110% of the default size
notehead.CustomChar = 79
notehead.Resize = 110
notehead:SaveAt(highestnote)
-- Jump label here:
::continue::
end
---
More notes about this script are available on the script sample page on
the Wiki:
http://jwmusic.nu/jwplugins/wiki/doku.php?id=jwlua:quickscripts
Best regards,
Jari Williamsson
More information about the JWLua
mailing list