What does note.accidentalType return for naturals?
Hi, I'm hoping someone can tell me what note.accidentalType returns for naturals. I found via testing that it returns 1 for sharps and 2 for flats, but I'm having trouble figuring out what it returns for naturals.
Thanks so much!
Comments
https://musescore.org/en/handbook/accidental#add-accidental
or click and Delete?
In reply to https://musescore.org/en/hand by Shoichi
This is a question about code for a plugin. ;-)
In reply to https://musescore.org/en/hand by Shoichi
Thank you so much, but actually sorry, I should have specified--I am talking about the qml code for developing plugins. There is a function for note called accidentalType that returns an int, but I couldn't find documentation for what the value of that int corresponds to. Through testing different values for the int I figured out that note.accidentalType returns 1 if the note is sharp and 2 if the note is flat, but I am not sure what it returns if the note is natural (as in it has a natural sign by it, indicating it used to be flat or sharp). I am hoping to use it in this manner:
if (note.accidentalType == 1)
//something happens when it's sharp
else if (note.accidentalType == 2)
//something else happens when it's flat
else if (note.accidentalType == ?)
//something else happens when it's natural
else
//or something else happens
where ? is whatever value note.accidentalType returns when the accidental is natural.
Thank you!!
In reply to Thank you so much, but by katie07
Probably 5.
See https://github.com/musescore/MuseScore/blob/2.0.3/libmscore/accidental…
In reply to Probably 5. See by [DELETED] 5
Yep that was it! Thank you so much!!!!