[JW Lua] Calling FCNote:GetString(pitch, key) on a percussion staff

Jan Angermüller jan at angermueller.com
Wed Jun 11 20:34:35 CEST 2014


Jari,

I have a document in C minor. When I run an eachentrysaved loop on the 
drums staff which is set to percussion notation and thus doesn't show 
have accidentals, the GetItemAt(i):GetString(pitch,key) returns a nil 
value for key instead of an FCKeySignature class.
Is this what is to be exptected ?

But when I change the document key signature to C major, the drum staff 
returns different pitches than in the C minor version, which should not 
be. In the C major version it returns the correct pitches, in the C 
minor version it returns false pitches on the note lines where C minor 
has its accidentals.

Is it a bug ? Or what do I have to do, to get the correct note pitch 
from a percussion staff in a document that is not in C major ?

Code snippet:

  for e in eachentrysaved(finenv.Region()) do
      local i=0
      while i < e:GetCount() do
         e:GetItemAt(i):GetString(pitch,key)     -- key returns nil in a 
C minor song, pitch only returns correct percussion values in C major
  ...

Thanks for any hints,
Jan




More information about the JWLua mailing list