[JW Lua] FCNote:GetString() returns wrong value on low pitches on transposed staves

Jan Angermüller jan at angermueller.com
Wed Feb 10 23:08:59 CET 2016


Jari,

FCNote:GetString() returns wrong values on very low pitches. When 
running a GetString directly followed by SetString it changes the 
pitches magically.

If you open the attached file and run the script at the very bottom 
which just reads the pitch and then saves it again (so no changes !), it 
should print the note pitches:
E1 D1 C#1 B0
but it changes the last note and prints:
E1 D1 C#1 B*1

*In a different key than A major with the same notes pitches (e.g. C 
major) I get other results (in C Major it's correct: E1 D1 C#1 B0), so I 
think must have to do with the change from 1-octave to the 0-octave AND 
with the difference between ScaleRootIndex which goes from A to G and 
the RootRelationIndex from C to B.

Jan

Code snippet: (select the measure from the attached file before running 
the script)

local region=finenv.Region()
local measure=finale.FCMeasure()
measure:Load(region.StartMeasure)
key=measure:GetKeySignature()
for e in eachentrysaved(region) do
     for g in each(e) do
         local pitch=finale.FCString()
         g:GetString(pitch,key)
         print(pitch.LuaString)
         g:SetString(pitch,key,false)
     end
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160210/f30ae3a9/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrong pitch.mus
Type: application/octet-stream
Size: 18366 bytes
Desc: not available
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160210/f30ae3a9/attachment.obj>


More information about the JWLua mailing list