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

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


Ah, according to the documentation it seems to be ok to have key = nil.
Then I only need to find a good solution on how to get the correct key 
signature at that point.

Jan

Am 11.06.2014 20:34, schrieb Jan Angermüller:
> 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
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>





More information about the JWLua mailing list