Chord problem

• Jan 2, 2024 - 16:45

Hi guys this time I use different method but I cannot still add a second note the same length as first even in a boiler plate codes a snippets when the chord is longer than one measure it creates problems.

import QtQuick 2.0
import MuseScore 3.0

MuseScore {
menuPath: "Plugins.pluginName"
description: "Description goes here"
version: "1.0"

function createNote(pitch) {
    var note = newElement(Element.NOTE);
    note.pitch = pitch;

    return note;
}

onRun: {
    var cursor = curScore.newCursor();
    cursor.rewind(0);
    cursor.setDuration(2, 1);
    cursor.addNote(80);
    cursor.rewind(0);
    var chord = cursor.element;


    var newNote = createNote(70);
    chord.add(newNote);
    Qt.quit();
}

}

Attachment Size
chordProblem.png 6.42 KB

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