[JW Lua] Single Pitch script

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Sat Aug 3 15:44:57 CEST 2013


Hello All!

My first real post to the JW Lua e-mail group.

Still no JW Lua plug-in for you to download and test, but here is an 
example some functionality I just added, more specifically the 
"eachentrysaved()" iterator and the "finenv" namespace.

Here's a script that basically does the same as Finale's "Single Pitch" 
plug-in:

---
pitchstring = finale.FCString("A#5")
writtenpitch = true
for e in eachentrysaved(finenv.Region()) do
    if e:IsNote() then
       -- Quick trick to assure single notes at chords
       e:MakeRest()
       e:MakeNote()
       -- Set the pitch of the single note
       e:GetItemAt(0):SetString(pitchstring, nil, writtenpitch)
       e.CheckAccidentals = true   -- Assure proper accidental refresh
    end
end
---

A deeper explanation of how this script work can be found on this Wiki page:
http://jwmusic.nu/jwplugins/wiki/doku.php?id=jwlua:quickscripts

More info about how "eachentrysaved()" and "finenv" work on this Wiki page:
http://jwmusic.nu/jwplugins/wiki/doku.php?id=jwlua:development


Best regards,

Jari Williamsson





More information about the JWLua mailing list