New User could use some helpful info on creating PlugIns

• Dec 9, 2020 - 18:22

I am quite new to Musescore and would like to be able to make a selection in a score and display the interval values for the notes in that score relative to a reference note that I could specify for that selection. For example, C, D, E, F would display as 1,2,3,4 if the reference note was C but would display b7,1,2,b3 if the reference note was D.

I searched all the plugin sources that I could find and did not locate any that had that utility. The closest I came were note name plugins.

I was considering modifying one of those plugins to go from note names to interval names but I could not find any information on plugin coding.

So two questions:
1) Are there any plugins out there that could do what I wanted to do with displaying intervals
2) If not, could someone direct me to a source for musecore plugin coding references



In reply to by bazhenoff


I spent a day or so getting more familiar with Musescore and some of the existing plugins and put together a Project Scope document along with some other files. If you would kindly take a look at them when you get the time and let me know if this is still a project you might be interested in, I would appreciate it.

Thanks ...

p.s. - I looked at sending you a private message so as not to clutter the forum too much but I didn't see an option for sending attachments.

Attachment Size
Program Scope.odt 23.26 KB
Intervals.qml 12.65 KB
Modal_Tuning_2.qml 60.28 KB
Interval Algo.xls 37.5 KB

In reply to by Marr11317

Yes, that is pretty much what I would like to do. I would personally not go past 7ths into degrees beyond the octave but that is a small personal preference. I would also like the flexibility to assign the reference key myself over a number of bars and not just follow the changes. In some cases it's useful to follow the chord changes but in others - like playing a fixed minor pentatonic over an entire blues chorus, the local key would stay fixed over 12 bars even though the chords are changing. But following the changes is a nice option to have and I did mention that in the project scope. I would also like to specify scale degrees for diads and triads and maybe even more voices with some controllable options - that I did not mention in the project scope. I think the format of the Note_Names plugin is very nice and could be converted to Degree_Names with not too much work.

Have you automated this process for yourself or do you fill in the scale degrees manually? That's what I am doing now in guitar pro files. I use the lyrics for scale degree input - get's a bit tedious after awhile. Thus this project proposal.

In reply to by Quark46

If you can wait a week or two, I am super busy with concerts and finals until the holydays, but then, I'll gladly do it.
Meanwhile, what UI would you imagine for this? If you could make a mockup (a drawing, or anything really) it would save me some time.

In reply to by bazhenoff

Absolutely, whenever it's convenient for you! I am trying to take a look at your prototype but am having some difficulty getting it to show up in the PlugIn Manager. I double checked header files but can find no apparent problems. I'll explore a bit more tomorrow but thank you very much for your efforts so far. Best wishes for your finals and upcoming concerts.

Hi Quark46

>> Quark46 wrote >> l'd like to be able to make a selection in a score and display the interval values for the notes in that score relative to a reference note that I could specify for that selection. For example, C, D, E, F would display as 1,2,3,4 if the reference note was C but would display b7,1,2,b3 if the reference note was D.

I like this idea.

If you make a plug-in for it please announce it in the forum.



Greetings Bazhenoff,
I did some very careful clean-up this morning to make sure that the program was pointing at the right directories in order to pick up plugins and I'm still not able to get Note Numbers to appear in the Plugin Manager Window. There are only 2 files in my plugin directory - I can display one but not the other.

If you get time could you take a look at these 2 files and see if you can see anything that would make Modal_Tuning_J show up but not NoteNumberJ? Thanks ...

Attachment Size
Modal_Tuning_J.qml 60.26 KB
NoteNumber -J.qml 6.86 KB

In reply to by Quark46

Try a new version ... And write a version of the program. my version: OS: Ubuntu 20.10, Arch .: x86_64, MuseScore version (64-bit): 3.2.3 + dfsg1-5 (Ubuntu groovy / amd64), MuseScore build number not set, revision: d2d863f
try to replace import QtQuick 2.12 with import QtQuick 2.2
and in the plugin editor there is a debug window into which it writes errors

Attachment Size
NoteNumber.qml 6.72 KB

In reply to by bazhenoff

Tried the new program version and still no luck in having Plugin Manager recognize it. I completely wiped out my previous load of Musescore and reloaded the most current version this morning. I'm running Windows 10 on X86_64 as well. Musescore version is the latest

Suggest that we put this on hold for a bit and let you get prepped for your upcoming exams and performances. I'll keep poking around and see if I can find any major differences between your file and others that PlugIn does recognize.

Have a good weekend ...

In reply to by Quark46

there's two people here: marr11317 (me), the one having the exams and concerts, and bazhenoff, someone else who kindly spent some time making a plugin. I didn't do anything.

Otherwise, the only reason such a plugin will not load in the plugin manager is if it cannot be loaded. The easiest way to figure out what the problem is is to open the plugin creator (not manager) and paste the text from bazhenoff's plugin inside. When you'll click run, errors may appear in the console and you will be able to paste them here so we see what the error is.

On another note, I tried it that way (didn't try from plugin manager) and it worked like a charm. I'm on windows ten too. Good job bazhenoff.

In reply to by Marr11317

That helped - thanks. It identified the problem as

Creating component failed
line 1: module "QtQuick" version 2.12 is not installed

I tried stepping down to 2.1 and got the same "not installed" message and stepping down again to 2.0, I got this message

Creating component failed
line 62: "Row.padding" is not available in QtQuick 2.0.

I searched around a bit and couldn't find any hints about how to import 2.12 into Musescore. I do have the lastest version of Musescore installed. Any ideas how to upgrade QtQuick to 2.12? Thanks ...

In reply to by Marr11317

Yep ... commented out the padding as well as a few other problematic lines. It runs and it's pretty cool. Need to spend some time working with it to understand the initial fill form but the plugin does the job. Don't know if either of you are interested in developing it any further (not even sure what that might mean), so we may be good at this point.
Thank you both for helping out a newbee - very friendly and extremely helpful forum.

In reply to by bazhenoff

Okay, will do.

The basic functionality that I was thinking of was a form with 15 lines, one for each key (“Eb”, “Bb”,”F”,”C”,”G”,”D”,”A”,”E”,”B”,”Cb”,”F#”,”Gb”,”C#”,”Db”,”Ab”) and then next to each keyname would be a fill-in box where the user could put in text like 2, 4-6, 8-11, 23, ... to indicate which bars the local reference key for determining intervals would apply.

Being able to specify a starting point within the bar other than the beginning would be an important feature.

Perhaps also putting in "All" could be used to apply the same key over the entire score and then a more advanced option might be "Chords" where the local key was determined by the local chord. It would be nice if Chord could be the 16th line in the fill form and the same type of bar specifications would tell the program to use the local chord as the reference for those bars. That could be more complicated and is not what I would call an essential feature but it would be nice.

Just some of my thoughts, I'm sure that whatever you come up with will be great. Thanks.

In reply to by Quark46

I already wrote about major and minor. The steps are different: 3, 6, 7. And in general I don't like it. Sorry for the user
it may be more elegant to type in the letter designations of harmony and calculate from them. They already contain major and minor

In reply to by bazhenoff

Not sure if we see things differently here or not. The way I think of it when you read a chart, you never think about whether the music itself is ionian, aeolean, lydian, locrian, or any other mode or strange scale. All you need to know is the major key signature which defines the prevailing sharps and flats in that key signature.

There are 15 distinct key signatures containing various combinations of sharps and flats and they all refer to the intervals of a major scale which are always designated as 1, 2, 3, 4, 5, 6, 7 irrespective of the notes. Every note in a piece of music is notated with respect to the prevailing major key for that section of music.

So if you set in your program that the prevailing key (harmony, tonality) for a section is G, that sets up the the following note-scale degree relationship G=1, A=2, B=3, C=4, D=5, E=6, F#=7. So any notes that you come across are compared to the G group and notated accordingly.

If the notes were G,B,D (Gmaj chord) they would be 1,3,5. If they were G, Bb, D (Gmin chord) they would be 1, b3, 5, if they were G, Bb, Db (Gdim chord) they would be 1, b3, b5 and if they were G, B, D# they would be 1, 3, #5 (Gaug). If they were A, C#, E they would be 2, #4, 6. If they were A, C, E they would be 2, 4, 6. You never have to ask whether the piece is major/minor/or some other mode. You just look at the notes and compare them to the prevailing key signature.

So if we return to the G, B, D example above, if your program had set the prevailing harmony for that section to be A instead of G, then you would setup the following note-scale degree relationship A=1, B=2, C#=3, D=4, E=5, F#=6, G#=7. With that setup then G,B,D->b7,2,4, G,Bb,D->b7,b2,4, G,Bb,Db->b7,b2,b4, G,B,D#= b7,2,#4, A, C#, E = 1, 3, 5 and A, C, E = 1, b3, 5.

As I see it, you just specify the tonality for the section to be one of the 15 major keys. Once you've done that you've implicitly assigned notes to the sequence 1 ,2, 3, 4, 5, 6, 7 and then you compare all the notes in that section to the note-scale degree relationships you set up with the prevailing key for that section.

So perhaps I'm still missing something in the way you are approaching it. If so and you still find problems with the above, then please give me a specific example so that I could understand it better.

By the way, the reason for doing this is that I am a guitar player and the guitar is very pattern oriented. I use scale degrees to orient myself on the neck. The scale degree pattern 1,3,5 is always the same on the neck, so if I'm asked to play 1,3,5 in G, I just need to locate a G note and then run the 1,3,5 pattern. If I'm told to play b7, 2, 4 in A, then I just locate A and play the b7,2,4 pattern. A is obviously not the best reference choice here but it still works so that when I play b7,2,4 in A, I'd still be playing a G maj chord.

So approaching music from a scale degree viewpoint is very slick for a guitar player and your program will make that a lot easier for us string guys. Thanks ...

In reply to by bazhenoff

It's amazing that you can do that. My compliments to you!

I think you can eliminate the check box with ALL. The idea was that if we want one key to apply to the entire score we could just put the word "ALL" in that keys slot on the left. So if we wanted to use the key of D over the entire score then instead of 20-22 in the D slot as you have it now you would just put in "ALL" and that would override everything else and save you from having to put in the exact number of bars for the piece.

I think you can also eliminate the Local Chord and Starting Point on the right side as well. Unless you have something in mind for them, I don't see a use for them.

The only other option to consider is adding the slot CHORD on the left hand side in addition to the 15 keys and letting the user put in numbers like 5-8, 9-11,16,20-23. This would tell the program to use the key specified by the prevailing chord for those bars. The translation would follow the key changes. So if a section had the chords G, Amin and D then the program would use G as the local key for the notes in the section where the G chord was active, it would use A for the local key over the section where the Amin chord was active, and would use D over the section where the D chord was active.

I'm not even sure if this is possible. It would only be possible if Musescore knew what chord was active independently of the notes. If Musescore only knows chords based on the notes, then I'm not sure how this would work. Maybe best to leave this for something down the road.

Okay, thanks bazhenoff .. talk with you later. (If this is still not clear after translation, we can try again.)

In reply to by bazhenoff

Гаразд, це працює - інший варіант - поставити слово «ВСЕ» у полі для цього ключа, але, на мою думку, ви робите це більш чітким. Як переклад? Я ніколи раніше не користувався перекладачем Google. Ваша мова має прекрасний звук і прекрасний алфавіт.
(Okay, that works - the other option is to put the word "ALL" in the box for that key but I think you make it more explicit. How's the translation coming? I never used Google translator before. Your language has a beautiful sound and beautiful alphabet.

In reply to by Quark46

The translation is excellent. Only my language is Russian. You can write the word everything on each line, but you cannot select several lines. Email me 15 keys. 2, 4-6, 8-11, 23 - these numbers, numbers of measures? the key acts per measure or there can be several keys per measure
if the work has 16 measures, all measures must be specified in lines?

In reply to by bazhenoff

Here are the 15 keys F, C, G, D, A, E, B, Cb, F#, Gb, C#, Db, Ab, Eb, Bb

The numbers 2,4-6,8-11,23 in the slot for the key of F means that the user would like F to be the local key for bar #'s, 2,4,5,6,8,9,10,11,23. So if the notes F, A, C, E, B were in any of those bars, they would translate to 1, 3, 5, #4 or b5. (I think I would choose the b5 over the #4 when dealing with enharmonics- but either would work)

As mentioned, it would be nice if there was some way that the user could indicate that local key could start or end somewhere within a bar. Not sure how Musescore would be able to handle that. So the answer to your question about whether there could be more than one local key per measure would be yes, if there was some notation that would allow something like 2, 4.5-6.75, 8-11,23 to be used. It could be fractions or beats or whatever unit that Musescore could use to indication a section within a bar.

In terms of the word "ALL" (which Google translated as "EVERYTHING"). You would only put that in one slot. So if I put "ALL" in the slot for the local key F, it would mean the local key F would apply to the entire score. You would not put it anywhere else nor would you put anything else in any other slot
If you don't have a method yet for setting scale degrees based on the notes and the local key, you could check out a suggestion made in the "Program Scope.odt" file sent early on in this thread. It might work for you.

Let me know if all this comes through OK and makes sense after translation.

In reply to by Quark46

Let's go further ... I pressed start (he said let's go) expanded the indicated in bars and found that nothing was specified for bar # 4. And measure 5 has too many chords. What are we doing?
you can omit the range. then the input will be much easier
e.g. 12 bar blues circuit: 1C, 5F, 7C, 9G, 10F, 11C
in our case 1-4C, 5-6F, 7-8C, 9G, 10F, 11-12C

In reply to by bazhenoff

Sure, that will work just fine ... definitely use your best judgement on what makes sense in terms of program logic and ease of coding. If a bar doesn't have a local key assigned to it, then I would interpret that to mean skip that bar. I just randomly threw some numbers out there just to illustrate possible formatting and didn't take any care to see if they made sense. Use whatever method you think would work best to specify which bars get which local key.

In reply to by bazhenoff

Greeting bazhenoff,

Program is looking very good - you obviously have put a lot of hard work into it ... thank you very much.

1) I had to comment out some lines in your code to get it to run on my system. I attached that modified code as NoteNumber2-Run. In this code, the Qt imports were dropped down to 2.0, and the following lines were commented out but the program still ran.
// headerPositioning: ListView.OverlayHeader
// if(listView.model[i] === "") { continue }

2) I noted that the program did not pick up sharps and flats as scale degrees. I ran a small test on the file Test-1.xml and stored the output in Test-1-Result.xml - all attached. I ran the program and specified that bar 1 should be C, bar 2 should be D, and bar 3 should be E. The Test file had the notes D, D#, D, Db in each of the 3 bars. When the program ran, it told me the scale degrees were 2,2,2,2 for the first bar, 1,1,1,1, for the 2nd bar, and 7,7,7,7 for the third bar. Pretty close but it missed the sharps and flats.

3) The input syntax worked well.
I noted that I had to click back into the input box after each character was input instead of continuously typing - a minor inconvenience.
I also noted that if I don't specify something for a specific bar it returns NaN. It would be better to just skip over a bar, if nothing is specified for that bar and not print NaN(IMO).
And finally, I guess I don't understand how "only selected" is supposed to work. When I select it, I get incorrect results and don't really understand what I would use it for. Seems like you have everything covered without it.

Do you think specifying that a local key should start/stop within a bar rather than just be applied to the entire bar is going to be difficult? If so, let it go, what you have so far is more than I could have hoped for.

It's a pretty awesome piece of work from my point of view and will be an extremely useful tool for those of us who approach music through intervals.

Attachment Size
NoteNumber2-Run.qml 8.09 KB
Test-1.xml 11.51 KB
Test-1-Result.xml 18.61 KB

In reply to by Quark46

fixed minor bugs. The alteration (#2) is not ready yet ...
only the selected one works 1 chord for the entire score. First you need to select the Chord. Selected in the list is grayed out
ps this is not a job, this is a hobby
ps everything is theoretically possible. There is a measure (time signature) and a duration for each note or rest. Additionally, the items contain a timestamp

Attachment Size
NoteNumber2.qml 7.74 KB

In reply to by bazhenoff

Gave it a quick run through ... awesome piece of work! ... works like a charm ... thanks so much for putting the time into this. I am going to be spending time ( already have ), in going through your code for this project. I am learning a lot from it ... thanks again ...

In reply to by Quark46

Hi bazenhoff,

Just wanted to let you know that I use your program nearly every day and it works like a charm. It has saved me a lot of work and provides a lot of insight into relating melodies and solos to the underlying harmony. Thanks again for putting the effort into it ... be safe, stay well.

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