ColorNotes v2 ( colors also stem and beam)

• Jul 30, 2015 - 09:13

Just did a review on the Musescore's 2 standard plugin Color Notes ( colornotes.qml ).
You'll normally find it here:
Plugins/Notes/Color Notes .
(or may need to enable in Plugins/Plugin Manager .)
Cleaned up and optimized source code.
Added some more comments and just for fun made it even more colorful by also including the stem and beam of the notes when applying the colors. As you see on the picture:
Color Notes v2.png

Well delete or uncomment the following piece of code if you don't like this / want the default behavior back:

//
// color also the stem and beam of the Note
//
var the = cursor.element;
applyColorOn( the.stem );
applyColorOn( the.hook);
applyColorOn( the.beam);
applyColorOn( the.stemSlash);

so I'll look again like this:
Color Notes v1.png
Note uncommenting can be done like this


/* var the = cursor.elem...

applyColorOn( the.stemSlash);
/*

via /* .. */ or by adding // at the beginning of each line.

Installation:

To install this download attached colornotes.qml and copy it to
%ProgramFiles%\MuseScore 2\plugins\colornotes.qml
... and make it readonly. (right click properties Attribute read only)
So it'll may survive/resist an update to a new version.

or better & cleaner
1. copy it to %USERPROFILE%\.musescore\plugins\colornotes.qml
2. and disable the old + add & enable it via Plugins/Plugin Manager

// History:
//
// 2.1 Jul 2015 by Djamana
// * Rainbow scale applied to circle of fifth┤s
//
// 2.0 Jul 2015 by Djamana
// * cleaned up & reordered source code
// * #,b and . color is now always linked to the note
// * color also the stem and beam of the notes
//

Attachment Size
colornotes.qml 6.34 KB

Comments

Thank you for the review.

However, it's a bad idea to change files in the MuseScore installation directory. You can just copy the file in Documents/MuseScore 2/Plugins and it will survive between updates.

In reply to by Nicolas

Oh yes good point - else the file will get killed by the update.
However maybe the intentions was that one of the Musecore developer may review it and put it partly or full inside Musecore 2 so it'll be in the next update. *smile*

Someone of them in here reading reading this?
Or how to contact them make a contribution to the source?

However path should be:
%USERPROFILE%\.musescore\plugins\
It'll get expanded to somewhat like
c:\Users\Alpenmilch\.musescore\plugins\

I'll edit the initial post.

As that plugin colors notes as per their pitch, to make it easier to play them, it probably isn't a good idea to color stems and flags too, as these belong to the chords, of which the note is just one of potentially several. For beams it is even worse, they most likely connect chords of different pitches, so these changes would cause confusion rahter than clarity, IMHO.

In reply to by Jojo-Schmitz

Of course it's a compromise
even the implementation is a little hackish.
But i got the idea when searching this forum for 'ColorNotes' before creating a new thread.
Crossreading the posts I saw that there were somewhere the need to also color the stem and beams of to notes. I a thought hmm maybe nice to 'prepare' try out this ability.
And I kinda liked it so I keeped it in.

And of course I'm award of the clash
Mostly there are single notes with on head + stems.

  • If not the color from the highest note is applied.
    The highest note is what leads the melody
  • The beam connection notes get's the color from the last note in it.
    So you may see where the melody heading. Kinda of it's edges, turning points.

But so far to the theory in practice I confess it'll also look kind da mess to me:
SuperMario_2.png
compared to:
SuperMario_1.png
btw that's the score http://musescore.com/user/589901/scores/393171

However one a second glance I start liking the first, even more colorful scope - I'll follow some rules and if you can intuitively grab it - it's helping you digesting the notes easier.

But if not - don't hesitate to drop/ disable the too colorful part of the code (mentioned in the initial post).

The only thing that really disturbs me here is the tone of the yellow. it has a really bad contrast on white.

So and why a little hackish? (Sorry for offtopic)

property variant cursor : curScore.newCursor();
function applyToNotesInSelection() {
...

putting cursor out of the function 'applyToNotesInSelection'
and later also using it in the function colorNote

var the = cursor.element;

What is not so good is the tendency of 'cursor' becaming a 'global variable'.
Better/cleaner style maybe to pass it as parameter like:
colorNote(TheNote, cursor.element)
or the use of closures

function applyToNotesInSelection() {
var cursor = curScore.newCursor();
function colorNote( TheNote ) {
...
var the = cursor.element;
...

}
...
}
so the scope of cursor get's more tight and close to it's use.

Just notice that the color plugin CRASHes
Musescore 2.0.3 Rev(3c7a69d)

It's a known bug #115971: Regression: Qml access to annotations leads to crash
and already fixed in Musescore 3 that is currently only available via Freelinking: Unknown plugin indicator

So to fix just get a newer (or maybe older also works) version
OR
Edit colornotes_0.qml. Look and delete these lines:

// color Harmony (= chords )
forEach(cursor.segment.annotations, colorNote)
// C O N F I G  #2: (un)comment line above to enable / disable coloring of chords 

That will avoid triggering the bug. But now the script doesn't color chord symbols anymore.

hi, I tried this plugin, but the colors of the stems are not preserved if exported and then imported as MusicXML, is there a way to provide colors to the stems in that xml format? Specifically I need a transparent alpha channel to the stems. Regards!

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