[JW Lua] Copying PercussionNoteMods in layer copying

Jan Angermüller jan at angermueller.com
Wed Jan 22 12:47:37 CET 2014


Hi Jari,

sorry to bother you again...

When cloning a layer from a percussion staff,
is it on purpose that the FCPercussionNoteMods
are not cloned automatically ? Or is it a bug ?
This is my code which copies all note entries from layer 1 to layer 2,
but unfortunately without the FCPercussionNoteMods.

noteentrylayer = 
finale.FCNoteEntryLayer(0,region.StartStaff,region.StartMeasure,region.EndMeasure)
noteentrylayer:Load()
newnoteentrylayer = 
noteentrylayer:CreateCloneEntries(1,region.StartStaff,region.StartMeasure)
newnoteentrylayer:CloneTuplets(noteentrylayer)
newnoteentrylayer:Save()

When using the standard Finale Edit / Move/Copy Layers
functionality the percussion note mods are copied.

Now I tried to copy the PercussionNoteMods by hand with this function
within an "e in eachentrysaved()" loop:

percnotemod=finale.FCPercussionNoteMod()
percnotemod:SetNoteEntry(e)
percnotemod:SetNoteID(e:GetItemAt(i):GetNoteID())
percnotemod:SetNoteType(notetypes[pitch.LuaString])   --the notetypes 
table was created from the original layer 1 entries
percnotemod:Save()

But it seems like FCPercussionNoteMod.SetNoteID is not yet implemented,
so I always get an error message.

Thanks a lot any hints,
Jan






More information about the JWLua mailing list