Access the notes in MuseScore 3 plugin API

• Dec 24, 2018 - 12:41

Hello everyone,
I'm a playing around with the plugin creator and looking at existing plugins to discover what the API can do. However, some of the built-in plugins don't work anymore in 3.x (notenames for instance) and I'm wondering how I can get (and modify) the notes pitches from an Element. For example :

while (cursor.segment() && cursor.tick < endTick) {
  var element = cursor.element();
  if (element) {
    console.log("element: " + element);
    console.log("element json: " + JSON.stringify(element));
 
    if (cursor.element().type == Ms.CHORD) {
      console.log("notes: " + element.notes);
    }
  }
  cursor.next();
}

outputs :

Debug: element: Ms::ElementW(0x7129850)
Debug: element json: {"objectName":"","type":92,"name":"Chord","tick":0}
Debug: notes: undefined
Debug: element: Ms::ElementW(0x7141290)
Debug: element json: {"objectName":"","type":92,"name":"Chord","tick":480}
Debug: notes: undefined

Did I miss something in the manual?


Comments

The release notes should have said that the plugins are not working properly for the initial release and are expected to be enabled in about a month. This is because they are still in the process of being rewritten for version 3.

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