[JW Lua] Problems with slur control point offsets

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Sat Jul 19 14:39:10 CEST 2014


Jan,

Regarding #1, you are probably right regarding the scaling of the x axis 
relative to the slur length. Sorry, I don't have any further info on 
this data structure at this point.

Regarding #2, I need to get back later on this issue to check if it's a 
documentation error or an implementation error.


Best regards,

Jari Williamsson


On 2014-07-17 21:27, Jan Angermüller wrote:
> Jari,
>
> I have two problems with ControlPointOffsets for smartshape slurs:
>
> 1.) When reading FCSmartShapeCtrlPointAdjust:GetControlPoint1OffsetX()
> and ...Y() (or Point 2)
> from a slur smartshape, the x and y values seem to be scaled differently.
> The y value is the correct EVPU value: it is the difference between the
> LeftEndpointOffsetY
> and the ControlPoint1Y respectively RightEndpointOffsetY and ControlPoint2Y.
> The x value seems to be scaled differently depending on the length of
> the slur.
> In short slurs (150-200 EVPUs) the x value has a factor of 15-20 of the
> EVPU value,
> in longer slurs (250-500 EVPUs) the x value has a factor 3-10 of the
> EVPU value.
> But I haven't found an exact correlation of the x value yet, it looks a
> bit logarithmic.
>
> I measured:
> slur width         factor to correct the x offset value
> in EVPU             to get the real x offset in EVPU
> 170                     1/17.9
> 256                      1/7.9
> 398                      1/5.5
> 476                      1/4.2
>
> Do you know anything about that ?
>
> This is the script to try out:
> (to evaluate the different the scales you would need also to compare
> with the
> smartshape:CalcLeftEntryMetricPos which is not included in the snippet)
>
> local region = finenv.Region()
> local marks = finale.FCSmartShapeMeasureMarks()
> marks:LoadAllForRegion(region, true)
> marks:KeepSlursOnly()
> for mark in each(marks) do
>    local smartshape = mark:CreateSmartShape()
>    local controlpoint=smartshape:GetCtrlPointAdjust()
>    local leftseg=smartshape:GetTerminateSegmentLeft ()
>    local rightseg=smartshape:GetTerminateSegmentRight ()
>    print("X:",controlpoint:GetControlPoint1OffsetX(),
>          leftseg:GetControlPoint1OffsetX(),
>          rightseg:GetControlPoint1OffsetX())
>    print("Y:",controlpoint:GetControlPoint1OffsetY(),
>          leftseg:GetControlPoint1OffsetY(),
>          rightseg:GetControlPoint1OffsetY())
> end
>
> The returned x value from the script is way too high.
>
> 2.) When reading FCSmartShapeSegment:GetControlPoint1OffsetX  (or Y or
> Point2) with a slur,
> I always get 0,0 values, no matter how much I shifted the control points,
> At the same time the
> FCSmartShapeCtrlPointAdjust:GetControlPoint1OffsetX()   (from 1.)
> always returns the correct values.
> It seems to me like FCSmartShapeSegment:GetControlPoint1OffsetX is not
> needed - at least for slurs,
> as FCSmartShapeCtrlPointAdjust returns the correct values.
> But in the online documentation, it says that
> FCSmartShapeSegment:GetControlPoint1OffsetX
> holds the offset values for slurs.
> A demonstration is also the script above which returns 0 for all shape
> segments.
>
> Jan
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>






More information about the JWLua mailing list