[JW Lua] Calculating the slur metrics when a slur goes over several staff systems

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Thu Jul 27 20:30:19 CEST 2017


Jan,

Smartshapes over multiple systems creates additional data objects of the 
FCSmartShapeSegment class.

I don't have good documentation on smartshapes on my end, so it's lots 
of trial-and-error for me.


Best regards,

Jari Williamsson


On 2017-07-26 12:24, Jan Angermüller wrote:
> Jari et al,
> 
> when calculating the metrics of a slur that goes over several staff 
> systems, the metrics are only calculated correctly for the first staff 
> system.
> This was reported as a bug in 2014 (mail from 2014-06-28), but has 
> never  been replied.
> 
> 
> 
> The test script below returns these metric values for the slur start 
> positions in measure 3 and 4.
> 
> Running [Unnamed Script] ======>
> Measure: 3 Calculation ok? true X: 2020 Y: 2976
> Measure: 4 Calculation ok? true X: 2020 Y: 2976    ---> wrong values, 
> it's not from measure 3, but from measure 4.
> <======= [Unnamed Script] succeeded (Processing time: 0.001 s).
> 
> Has anybody found a workaround?
> Or, Jari, have you had time to look in this issue? Is it a bug in the 
> Finale PDK?
> 
> Best,
> Jan
> 
> function GetEntryToSmartshape(id,measure,staff)
>      local notecell=finale.FCNoteEntryCell(measure,staff)
>      notecell:Load()
>      for e in each(notecell) do
>         if (e.EntryNumber == id)then
>             return e,e.EntryNumber
>         end
>      end
>      return nil,-1
> end
> 
> local region = finale.FCMusicRegion()
> region:SetFullDocument()
> local marks = finale.FCSmartShapeMeasureMarks()
> marks:LoadAllForRegion(region)
> for mark in each(marks) do
>      local smartshape = mark:CreateSmartShape()
>      if smartshape:IsSlur() then
>          local leftpoint=finale.FCPoint(1,1)
>          local leftseg=smartshape:GetTerminateSegmentLeft()
>          local 
> entry=GetEntryToSmartshape(leftseg.EntryNumber,leftseg.Measure,leftseg.Staff)
>          print("Measure:",mark.Measure,"Calculation 
> ok?",smartshape:CalcLeftEntryMetricPos(entry,leftpoint),
>                    "X:",leftpoint.X,
>                    "Y:",leftpoint.Y)
>     end
> end
> 
> 
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
> 






More information about the JWLua mailing list