How do I set duration easily ?
Hello,
My question is. Is there any other way to set duration of a note besides giving two input argument into cursor.duration ?
I want to store duration of a note in single variable so I can later use it and add it to a score.. but if I want to do that I have to store the numerator and denominator. Is there any way to store in and later use it as one variable and add it to a Score ?
Thank you
import QtQuick 2.0
import MuseScore 3.0
MuseScore {
menuPath: "Plugins.pluginName"
description: "Description goes here"
version: "1.0"
onRun: {
var all = [];
var cursor = curScore.newCursor();
cursor.rewind(0);
all.push(cursor.element.duration);
var a = all[0];
console.log("a", a.str)
cursor.setDuration(a)
cursor.addNote(80)
Qt.quit()
}
}
Comments
[Deleted] Sorry, I've just been working with PlayEvents and mis-answered your question.
My advice : compute all your durations into a common denumerator (I use 64) and store the numerator.
EDIT: removed the
Qt.quit()
which is part of the default template, but incorrect.In reply to My advice : compute all your… by parkingb
Drop the Qt.quit()