How to get number of sharps from a key signature Element?

• Oct 19, 2024 - 22:24

Hi there — I have an array of KeySig elements (from cursor.filter), but I don’t understand then how I get the number of flats/sharps in them. The Element definition doesn’t seem to include any function or property that would give me that, at least not obviously.

On the other hand, I see that the Score object has a keysig property (for the very first key signature), and also the cursor object can tell you the key signature at any tick pos, but I was wondering if there was an easy way to query the Element object itself, without having to go through a cursor loop?

Do you still have an unanswered question? Please log in first to post your question.