Couting notes

• Jul 15, 2018 - 21:29

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

In reply to 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:

      for (var i = 0; i <= 34; i++) {
    if (notesCount[pitchNameIndex[i][1]] != 0 ) {
      console.log(pitchNameIndex[i][0] + " : " + notesCount[pitchNameIndex[i][1]]);
    } 

which works fine.

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