Couting notes
Hello,
I have tried using the CountNotes plugin available on the forum, but it seems it is working only with MuseScore 1.x.
This said, I have tried writing one (see attachment). This is a very 1st sketch but it works under the "Plugin creator".
I am not very familiar with QML syntax, but I am not 100% happy with the 2 parallel arrays, wiz.
property variant noteNames: [
"B#", "C", "Dbb",
...
"A##", "B", "Cb",];
property variant pitchIndex: [
26, 14, 2,
...
31, 19, 7,];
Being used to C/C++, I'd rather have an array of a structure made of a string and an integer, but I don't know how to do this. Anyone can help? Thx.
So far, I am only interested in knowing how many notes there are for a given pitch whatever the octave is.
I just have to add the output to a file and to polish it w.r.t. the 2 parallel arrays.
Attachment | Size |
---|---|
countNotes.qml | 3.91 KB |
Comments
You can use a 2D array by declaring
Have I understood what you want? Note that "variant" is deprecated in favor of "var" (http://doc.qt.io/qt-5/qml-variant.html -- http://doc.qt.io/qt-5/qml-var.html).
In reply to You can use a 2D array by… by PaulSC
Thanks for the tip. I was too much used to strongly-typed languages that I missed the simplicity of QML!
Actually, I wrote something like:
which works fine.