How to add two pitches in one cursor place ?

• Dec 28, 2023 - 11:15

This code adds two in a row not in one place any help ?

// Import necessary modules
import QtQuick 2.0
import MuseScore 3.0

// Define the MuseScore plugin
MuseScore {
menuPath: "Plugins.pluginName"
description: "Description goes here"
version: "1.0"

onRun: {
    var cursor = curScore.newCursor();
    cursor.rewind(1);

    // Add the first note
    cursor.setDuration(1, 2);
    cursor.addNote(75);  // Change the pitch as needed
    console.log(cursor.tick);

    // Move the cursor to the same position for the second note
    cursor.rewind(1);

    // Add the second note
    cursor.setDuration(1, 2);
    cursor.addNote(70);  // Change the pitch as needed
    console.log(cursor.tick);

    Qt.quit();
}

}

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