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

Robert Patterson robert at robertgpatterson.com
Fri Aug 19 13:51:09 CEST 2022


Please confirm that your Finale 25 setup is actually using RGP Lua. I have
run tests here and my script exhibits the problem (for all Finale versions)
with JW Lua, but it does not exhibit the problem for any version of Finale
with RGP Lua.

Furthermore, the code is exactly the same for Finale 25 as for 26/7. (The
bug fix was in PDK Framework code, not Finale.) All this leads me to think
your F25 menu item hooked up to JW Lua rather than RGP Lua.

On Fri, Aug 19, 2022 at 5:07 AM Jan Angermüller <jan at angermueller.com>
wrote:

> We should think about a fix:
> I have just noticed that RGP Lua in Finale 25 returns -125 and only in
> Finale 26/27 returns -3.
> JW Lua returns -125 in all Finale versions.
>
> Jan
>
>
> Am 19.08.2022 um 12:00 schrieb Jan Angermüller:
>
> 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
>
> _______________________________________________
> JWLua mailing listJWLua at jwmusic.nuhttp://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
> --
> Jan Angermüller
> Orchideenstieg 13
> 22297 Hamburg
> Tel. 040 - 28 94 84 82
> Mobil 0173 - 99 33 904www.elbsound.studio
>
> _______________________________________________
> 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/20220819/27477792/attachment.htm>


More information about the JWLua mailing list