Why is Element.symbol undefined

• Dec 13, 2023 - 17:53

I want to get the kind of clef/time signature/key signature from an element class like this:

if (e.type == Element.CLEF || e.type == Element.KEYSIG || e.type == Element.TIMESIG) {
console.log("symID " + e.symbol);
}
Despite having this property according to the docs, this always reads "undefined"


Comments

In reply to by harmony8

following is my understanding, if the main plugin dev dmitrio95 were here, you could have a reliable answer.

clef is drawn, but is not technically symbol. symbols are Master palette > symbols category objects

e.symbol shows symID
API_PROPERTY( symbol, SYMBOL )
https://github.com/fp22june/MuseScoreTag362/blob/3b5857f0761c42574e8cb5…

which is valid for symbol objects
https://github.com/fp22june/MuseScoreTag362/blob/3b5857f0761c42574e8cb5…
https://github.com/fp22june/MuseScoreTag362/blob/3b5857f0761c42574e8cb5…

the info of clef OP want should be CLEF_TYPE
https://github.com/fp22june/MuseScoreTag362/blob/3b5857f0761c42574e8cb5…
but it is not exposed
https://github.com/fp22june/MuseScoreTag362/blob/3b5857f0761c42574e8cb5…

a snippet for adding symbol object
https://musescore.org/en/node/320673#iconsym

can't find a way to get clef info yet, added to https://musescore.org/en/handbook/developers-handbook/plugins-3x

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