[JW Lua] FCPage:CalcLastMeasure() can very slow

Jan Angermüller jan at angermueller.com
Sun May 15 14:11:58 CEST 2016


Jari,

I noticed that FCPage:CalcLastMeasure() can be extremely slow on huge 
and crowded scores.
The code snippet below that only calculates the last measure of a page 
on an 80 pages score*took about 5 seconds* on a very fast PC. The 
orchestra score had about 16000 frame assignments and more than 60000 
entries.

Workaround:
I use FCPage:GetFirstSystem() instead, then retrieve the first measure 
and calculate the last measure on the last page where a measure was 
found. This is calculated instantly (0.000s).

Best,
Jan

local pages=finale.FCPages()
pages:LoadAll()
print(pages.Count)
for page in each(pages) do
     local i=page:CalcLastMeasure() --calculate last measure number
end

Running [Unnamed Script] ======>
80
<======= [Unnamed Script] succeeded (Processing time: *5.056 s*).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160515/0dfa9875/attachment.htm>


More information about the JWLua mailing list