[JW Lua] Calling FCNote:GetString(pitch, key) on a percussion staff
Jari Williamsson
jari.williamsson at mailbox.swipnet.se
Fri Jul 4 08:06:07 CEST 2014
Jan,
FCNote:GetString() takes the key parameter as input to convert to the
string. Reusing an existing key signature object as the input is faster
than using nil (which would re-read the entry's key signature info at
each call).
If you need a key signature object, you can get it from
FCCell:GetKeySignature() or FCMeasure:GetKeySignature(). The FCMeasure
version uses the global/vertical key signature for the measure, while
the FCCell version looks at independent key signatures.
Best regards,
Jari Williamsson
On 2014-06-11 20:40, Jan Angermüller wrote:
> 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
>>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
More information about the JWLua
mailing list