[JW Lua] Added glissando smartshape always appears at the wrong position in the score - revisited

Jan Angermüller jan at angermueller.com
Mon May 18 18:16:43 CEST 2015


Jari,

I don't know if you have already looked into the glissando smart shape 
issues I posted in January/February.
One thing came to my mind as I just posted something on glissandos in 
the Powerusers group:
in FCSmartShape you have SetEntryBased and SetBeatAttached, but you 
don't have SetNoteheadBased as used in glissando and tab slide smartshapes.
That might be a reason why the created glissandos appear at the wrong 
position. They don't get attached to the notehead.
Just an idea...

All the best,
Jan


Am 16.01.2015 um 12:05 schrieb Jan Angermüller:
> Jari,
>
> I haven't succeeded yet in adding a glissando smartshape at the 
> correct position.
> Probably it's the following sentence from FCSmartShape:SaveNewEverything()
> that I am missing or that I don't understand:
> "For note-attached smart shapes, the frame collection that
> contains the entries need to be saved after the successful return from 
> this method."
>
> The code snippet is below. It creates a glissando between two half notes
> in measure 1 on staff 1. The glissando does appear in the score after 
> the execution,
> but at the wrong position (see screenshot: it's placed far above the 
> staff).
>
> I tried to set as many properties as possible (Endpoints, CtrlPoints, 
> etc. - not all of them are required here, I know).
> But the glissando always appears at the /same /wrong position -
> no matter which endpoint offsets I enter.
>
> I also tried it with FCNoteEntryCell and FCNoteEntryLayer instead of 
> eachentrysaved(),
> but that shouldn't and didn't make a difference.
> What's the possibly required call for "saving the frame collection" 
> after SaveNewEverything() ?
> Or is there a problem with the endpoint assignment ?
> I used JW Lua 0.29 / Finale 2014c / Windows 7.
>
> And another question in this context:
> I don't understand the meaning of "preset/custom" here.
> I thought that a glissando would be a preset shape as it is one of the 
> SMARTSHAPE_TYPES 
> <http://www.finaletips.nu/frameworkref/group__lua__classes.html#ga29b94a28426154f61cb5bf57d14a8b42>.
> But it only appears as a glissando in the score, if I also set the 
> correct LineID which
> is defined as "Returns the line style ID for /custom /smart shapes."
> So what is a preset / custom in this context ? And does 
> SetPresetShape(true) have any meaning here ?
>
> Thanks a lot for your hints in advance !
>
> Best regards,
> Jan
>
>
> for e in eachentrysaved(finenv.Region()) do
>     if (e.MeasurePos==0) and (e.Measure==1) then --first note on 
> measure pos 0 in measure 1
>         for e2 in eachentrysaved(finenv.Region()) do
>             if (e2.MeasurePos==2048) and (e2.Measure==1) then --second 
> note on measure pos 2048 in measure 1
>
>                 --create glissando smartshape and attach it to e and e2
>                 local smartshape = finale.FCSmartShape()
> smartshape:SetShapeType(finale.SMARTSHAPE_GLISSANDO)
>                 smartshape:SetEntryBased(true)
>                 smartshape:SetPresetShape(true)
>                 smartshape:SetVisible(true)
>                 smartshape:SetLineID(1)
>                 smartshape:SetEntryAttachedFlags(true)
>
>                 local leftseg = smartshape:GetTerminateSegmentLeft()
>                 leftseg:SetMeasure(e.Measure)
>                 leftseg:SetStaff(e.Staff)
>                 leftseg:SetEndpointOffsetX(0)
>                 leftseg:SetEndpointOffsetY(0)
>                 leftseg:SetControlPoint1OffsetX(0)
>                 leftseg:SetControlPoint1OffsetY(0)
>                 leftseg:SetControlPoint2OffsetX(0)
>                 leftseg:SetControlPoint2OffsetY(0)
>
>                 local rightseg = smartshape:GetTerminateSegmentRight()
>                 rightseg:SetMeasure(e2.Measure)
>                 rightseg:SetStaff(e2.Staff)
>                 rightseg:SetEndpointOffsetX(0)
>                 rightseg:SetEndpointOffsetY(0)
>                 rightseg:SetControlPoint1OffsetX(0)
>                 rightseg:SetControlPoint1OffsetY(0)
>                 rightseg:SetControlPoint2OffsetX(0)
>                 rightseg:SetControlPoint2OffsetY(0)
>
>                 smartshape:SaveNewEverything(e,e2)
>             end
>          end
>      end
> end
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu


-- 
Jan Angermüller
Jevenstedter Str. 80
22547 Hamburg
Tel. 040 - 28 94 84 82
www.angermueller.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20150518/646f467e/attachment-0002.html>


More information about the JWLua mailing list