[JW Lua] createAccidentalMods method does not exist
Mr.Pat
Mr.Pat at pdreditions.com
Mon May 30 20:30:48 CEST 2016
Here's the code that I wrote to move an accidental from beside the note to
above the staff, something that is commonly done in Renaissance music.
--
-- Plugin starts here
-- Capture the selected region
--
for noteentry in eachentrysaved(finenv.Region()) do
local accmod = finale:FCAccidentalMod()
accmod:SetNoteEntry(noteentry)
if noteentry.IsNote then
for note in each(noteentry) do
if note.Accidental then
-- Figure out where the accidental will go
-- Default is 42 EVPu above the note
vertpos = 42
-- Find where the note sits relative to the top line of
the staff
notepos = note:CalcStaffPosition()
if notepos < 0 then
-- The note is below the top line. Move the
accidental up by that many spaces.
vertpos = vertpos + -12 * notepos
else
-- Note is on or above the top line.
vertpos = 54
end
-- Apply the settings and save
local noteid = note.NoteID
accmod:LoadFirst()
accmod.UseCustomVerticalPos = true
accmod.Resize = 80
accmod.VerticalPos = vertpos
accmod.HorizontalPos = 32
accmod:SaveAt(note)
end
end
end
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160530/7ec1b264/attachment.htm>
More information about the JWLua
mailing list