[JW Lua] Negative heights in FCStaffSystem:CalcHeight - a bit more info and probably the solution

Jan Angermüller jan at angermueller.com
Thu Aug 3 11:09:08 CEST 2017


Jari,

here is a bit more info on that one.
When I print the "Distance"  of the system staves (multiplied with the 
page percentage), I get this list (test script at the bottom):

0
183.6
403.8
624
904.8
1125
1344.6
1564.8
...
3970.2
4148.4
4324.8    (expected height of staff system)
-1455.6    (!!!!)

It looks fine until the very last value. That comes from a*hidden staff 
*(after the double basses) which seems to be taken into account for 
CalcHeight, although it's set to "Cutaway".
So probably a JW Lua problem indeed.

Best,
Jan




local staffsystemslookup=finale.FCStaffSystemsLookup ()
local staffsystems = staffsystemslookup:GetCurrentPartStaffSystems ()
for s in each(staffsystems) do
print(s:CalcHeight(false),s:CalcHeight(true),s.TopMargin,s.UseStaffResize,s.Resize,s.StaffHeight/64)
     local sysstaves=s:CreateSystemStaves()
     for ss in each(sysstaves) do
         print(ss.Distance*0.6)
     end
end

Am 03.08.2017 um 10:58 schrieb Jan Angermüller:
> Jari,
>
> I sometimes get weird results in staff height calculations when 
> changing staff distances through JW Lua:
>
> The score / staff distances looks fine on the screen after the change, 
> but when I call FCStaffSystem:CalcHeight afterwards it returns wrong 
> values, even negative staff system heights!
>
> Test script below and test score attached. The test score has a page 
> height of 4761 EVPU and a staff system slightly smaller, so one would 
> expect a staff height of approximately 4200 EVPU.
> *But JW Lua calculates  -2156EVPU (minus!).*
> The score is a first page excerpt of a large orchestra score created 
> in 2014.5. For file size reasons I attached in the Fin2012 format - 
> the problem remains.
>
> I tested with JW Lua 0.49/Windows/2014.5, but the problem is older and 
> also occured in 0.45.
>
> Best,
> Jan
>
> local staffsystemslookup=finale.FCStaffSystemsLookup ()
> local staffsystems = staffsystemslookup:GetCurrentPartStaffSystems ()
> for s in each(staffsystems) do
> print(s:CalcHeight(false),s:CalcHeight(true),s.TopMargin,s.UseStaffResize,s.Resize,s.StaffHeight/64)
> end
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20170803/510b2f35/attachment.html>


More information about the JWLua mailing list