[JW Lua] Copying PercussionNoteMods in layer copying
Jari Williamsson
jari.williamsson at mailbox.swipnet.se
Wed Jan 22 16:02:12 CET 2014
Jan,
It's by design (and documented) that
FCNoteEntryLayer::CreateCloneEntries() doesn't save any entry detail
info to the clone, since the entry ID is 0 for all note entries until
the layer is saved.
FCNoteEntry:CopyEntryDetails() can copy entry details from one entry to
another entry. That method will work if the FCNoteEntry has been saved,
and it can clone the tuplets as well.
HOWEVER, it does NOT support percussion note detail, mainly since it
doesn't make sense when cloned to another percussion layout.
I'll probably need to add another method to FCNoteEntry for copying
percussion details separately. I'll look into it!
Best regards,
Jari Williamsson
On 2014-01-22 12:47, Jan Angermüller wrote:
> 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
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
More information about the JWLua
mailing list