Match musicxml code with MuseScore objects

• Aug 9, 2024 - 16:17

Hello,

If I export a musescore file to xml, one of the notes has the following description:

  <note default-x="101.91" default-y="-30.00">
        <pitch>
          <step>G</step>
          <octave>4</octave>
          </pitch>
        <duration>4</duration>
        <voice>5</voice>
        <type>half</type>
        <stem>down</stem>
        <staff>1</staff>
        </note>

So the note has voice 5 and exists on staff 1.

How do I get to this information in a plugin?

Thanks!
Luc.


Comments

In reply to by M.Thum

Thanks.

I think that the walk.qml plugin contains a bug.
The output says:
Debug: type: Chord at tick: undefined color #000000
Debug: type: Chord at tick: undefined color #000000
Debug: type: Chord at tick: undefined color #000000
Debug: type: Chord at tick: undefined color #000000
Debug: type: Chord at tick: undefined color #000000

The code says:
var e = cursor.element;
if (e) {
console.log("type:", e.name, "at tick:", e.tick, "color", e.color);

tick is a property of the cursor, not the element, so the log statment above should be:
console.log("type:", e.name, "at tick:", cursor.tick, "color", e.color);

That generates output:
Debug: type: Chord at tick: 0 color #000000
Debug: type: Chord at tick: 240 color #000000
Debug: type: Chord at tick: 720 color #000000
Debug: type: Chord at tick: 960 color #000000
Debug: type: Chord at tick: 1440 color #000000

Best Regards,
Luc.

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