[JW Lua] Different results in RGP Lua/JW Lua with FCStemMod.HorizontalUpOffset

Jan Angermüller jan at angermueller.com
Fri Aug 19 12:00:26 CEST 2022


Hi Robert et al.,

I noticed an undocumented difference in RGP Lua/JW Lua.

FCStemMod.HorizontalUpOffset returns wrong values in JW Lua (signed byte 
problem) and RGP Lua returns the correct values.
It might have be fixed automaticaly because of a fix in the Fin26+ PDK.
We (Robert and I) had talked about FCStemMod issues some time ago and I 
wrote that I assume that there must have been some changes as another 
FCStemMod problem didn't occur anymore in Fin64bit either.

Test script which works with the attached file:

if finenv.IsRGPLua then require('mobdebug').start() end
local region=finale.FCMusicRegion()
region:SetFullDocument()
for entry in eachentry(region) do
     if entry and entry.StemDetailFlag then
         local stemmod=finale.FCStemMod()
         stemmod:SetNoteEntry(entry)
         if stemmod:LoadFirst() then
            print(stemmod.HorizontalUpOffset)     --probably the same 
with HorizontalDownOffset
         end
     end
end

In Finale 27 JW Lua returns: -125
In Finale 27 RGP Lua returns: -3 (which is correct)

In JW Lua I used this correction function,  but it took quite some time 
to find out, it wasn't necessary in RGP Lua anymore.

function jalib_CorrectStemOffsetForJWLua(offset)
     if not finenv.IsRGPLua then
         if offset<0 then
             offset=-offset-128
         elseif offset>128 then
             offset=-(256-offset)
         end
     end
     return offset
end

I don't know if it makes sense to correct this in RGP Lua  - maybe for 
compatibility reasons?
But as it is already like it and it actually fixes something, I think we 
should keep it and know that this leads to problems only in JW Lua.

Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220819/675127d9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spacingrgplua.mus
Type: application/octet-stream
Size: 98649 bytes
Desc: not available
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220819/675127d9/attachment.obj>


More information about the JWLua mailing list