[JW Lua] FCNote:GetString doesn't work anymore on pitches that worked before (starting in v0.53)
Jan Angermüller
jan at angermueller.com
Wed Oct 4 17:02:09 CEST 2017
Jari,
in version 0.53 you changed the handling of pitch reading
("Fixed a bug where FCNote::GetString() and FCNote::CalcOctave()
returned wrong values on very low notes.").
It somehow must have introduced a new error, because other pitches that
worked fine before now return the wrong value.
Attached is a very simple score, no transposition, no key sigs and the
script below now messes up the octave.
for e in eachentry(finenv.Region()) do
local str=finale.FCString()
if not e:IsRest() then
e:GetItemAt(0):GetString(str,nil)
print(str.LuaString)
end
end
Correct result until v0.52
Running [Unnamed Script] ======>
C4
<======= [Unnamed Script] succeeded (Processing time: 0.001 s).
Incorrect result in v.0.53 and 0.54
Running [Unnamed Script] ======>
C0
<======= [Unnamed Script] succeeded (Processing time: 0.000 s).
It seems to be related to the second parameter of GetString which is nil
in the example code above.
Your function description says:
*pKey: If this is NULL, the key signature from the current entry's
position will be used.
*This used to work fine until 0.52. Seems like "nil" isn't supported
anymore in 0.53.
If I add the key parameter and update the script as below, it seems to
work -
though I have only tested a few measures and can't say that it always
works like this.
for e in eachentry(finenv.Region()) do
local str=finale.FCString()
if not e:IsRest() then
local measure=finale.FCMeasure()
measure:Load(e.Measure)
local key=measure:GetKeySignature()
e:GetItemAt(0):GetString(str,key)
print(str.LuaString)
end
end*
*
Maybe it's only the function description that is not valid anymore?
I don't know. At least the first script above worked fine until v0.52.
Best,
Jan*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20171004/cc314ee3/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pitchtest.mus
Type: application/octet-stream
Size: 33967 bytes
Desc: not available
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20171004/cc314ee3/attachment.obj>
More information about the JWLua
mailing list