Putting Circle Frames on Particular Fingerings

• Feb 20, 2019 - 00:09

Hi all

I'm a newbie trying to learn how to write plugins for musescore. My goal is simple. Search the score for fingerings, and if there is a fingering that is labeled 1, put a circle frame on that fingering. I tried searching documentation on how to access the frame element, but can't seem to find any. Can anybody point me in the right direction?

Figure included is the desired behaviour.

Thank you in advance


Comments

нужно изменить стиль текста. если я правильно Вас понял, Вы хотите все единички в круглую рамку?
(need to change text style. if I understand you correctly, do you want all the ones in a round frame?)

function searchFingering(track, searchValue) {
    var segment = curScore.firstSegment();
    while (segment) {
        var element = segment.elementAt(track);
        if (element && element._name() == 'Chord') {
            for (var i = 0; i < element.notes.length; i++) {
                var note = element.notes[i];
                for (var ii = 0; ii < note.elements.length; ii++) {
                    var noteElement = note.elements[ii];
                    if (noteElement._name() === 'Fingering' && noteElement.text === searchValue) {
                        noteElement.textStyleType = 10;
                    }
                }
            }
        }
        segment = segment.next;
    }
}
  onRun: {
    if (curScore) {
        searchFingering(0, '1');

In reply to by Louis Cloete

Hi Louis,

Thanks for linking me the documentation. This will be very useful.

It says there that TextStyleType has been changed to Tid. When I tried noteElement.Tid , I'm still getting undefined. I tried investigating the noteElement object via Object.keys(noteElement), but I don't see a Tid property in there. I realize that Tid is an enum, but what properties do I use it against in noteElement?

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