[JW Lua] Modifying beams

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Tue Sep 22 13:10:20 CEST 2015


Thomas/Jan,

One of the reasons why SetNoteEntry() is required for all "Special 
Tools" data, and why the connected entry needs to be resaved (as in 
eachentrysaved), is because the note entry contains flags that signals 
the availability of some types of data.

You can examine those note entry flags if you use the Speedy Frame 
dialog box for a note entry.

In general, I would use this approach for handling any kind of Special 
Tools data. Using SaveNew() when data already exists could stack 
unneeded data for some data types.

d:SetNoteEntry(noteentry)
if d:LoadFirst() then  -- Or LoadAt() for note-connected data
    d.SomeProperty = 99
    d:Save()
else
    d.SomeProperty = 99
    d:SaveNew()
end


Best regards,

Jari Williamsson


On 2015-09-09 23:41, Thomas Weber wrote:
> Thanks a lot for that feedback, Jan.  It turns out two things were missing to actually conjure up an effective beam mod:  a SaveNew(), and the note entry has to be saved as well.  So, this does the job:
>
>
> for noteentry in eachentrysaved(finenv.Region()) do
>      local bm = finale.FCBeamMod()
>      bm:SetNoteEntry(noteentry)
>      bm:SaveNew()
>      if bm:LoadFirst() then
>          bm.LeftVerticalOffset = 100
>          bm:Save()
>      end
> end
>
>
> Am 09.09.2015 um 18:23 schrieb Jan Angermüller:
>> Have you tried the other Save-functions from FCBeamMod ?
>> Save() usually only works with elements that already exist.
>> A beam mod probably only exists when it was touched manually.
>>
>> Jan
>>
>> Am 09.09.2015 um 18:19 schrieb Thomas Weber:
>>> Dear experts,
>>>
>>> I tryed using a snippet from the class browser (a value and bm:Save() was added):
>>>
>>>
>>> for noteentry in eachentry(finenv.Region()) do
>>>       local bm = finale.FCBeamMod()
>>>       bm:SetNoteEntry(noteentry)
>>>       if bm:LoadFirst() then
>>>           bm.LeftVerticalOffset = 100
>>>           bm:Save()
>>>       end
>>> end
>>>
>>>
>>> Interestingly, this does only have a visible effect if the beam has been touched manually with a special tool beforehand.
>>>
>>> I found that in order to make FCSmartShapeSegment::SetEndpointOffsetX have an effect, one has to flag the FCSmartShapeSegment with FCSmartShapeSegment::|SetCustomOffset||| first.  I wondered whether something similar was needed to work with FCBeamMod, but I didn't see a member that seemed to have a similar purpose to |SetCustomOffset||.
>>>
>>> What am I missing?
>>>
>>> Thanks!
>>> Thomas Weber
>>> |
>>>
>>> [1] http://www.jwmusic.nu/jwplugins/wiki/doku.php?id=jwlua:harpglisssample
>>>
>>> _______________________________________________
>>> JWLua mailing list
>>> JWLua at jwmusic.nu
>>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>>>
>>
>>
>> _______________________________________________
>> JWLua mailing list
>> JWLua at jwmusic.nu
>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>>
>>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>






More information about the JWLua mailing list