How can I color stem for each note (with colors depending of string and/or pitch)
Morning, I would like create a plugin for violin score in order to color the stem of note related to the violin string (1rst position) , and not related to the head color of note ( head color could be related to fingers or other).
I saw plugins related to change colors, shape of the head note or to set finggering table in text, upon scorse;
But I didn't see how to access to the stem object or properties , to change color or thickness of it:
Could you help me on stem description langage ?
It is to help children with a kind of "musical dislecsy" in score reading
Best regards
Comments
Please explain 'hamp' and 'scorse', do you mean 'stem' and 'score'?
In reply to Please explain 'hamp' and by Jojo-Schmitz
Yes it's wright : hamp is stem where you can see if the note is a semiquaver and so on ...
and scorse is score ....
Sorry ; the correct words facilate the correct solution :-)
So may be I didn't find because of that ...
And so I set the correct words on my first post
In reply to Yes it's wright : hamp is by zenplus
The stems belong to the chords, not the notes, as they relate to the length, where as the note relates to the pitch, so maybe changing the chords color works?
In reply to The stems belong to the by Jojo-Schmitz
I saw in chord objet concerning stem only this:
"noStem boolean whether the chord has a stem or not. The chord needs to be retrieved from a cursor first "
But nothing about color of stem of the chord , could you indicate which object I have to manipulate , in order to make an equivalent action to the "right click" on a stem and then a little window appears and Inside it, we can change the color of stem in the musecore application (without plugins)
I hope to well explain my goal
In reply to I saw in chord objet by zenplus
I'm affraid the current plugin frameworks (neither 1.x nor 2.0) don't allow access to that. The Inspector (in 2.0) however should. As does right-click in 1.x.
Edit:
Actually in 2.0 it should work, it should inherit the color property from Element, and I think this is also use in the (2.0 version of the) ColorVoices plugin
In reply to I'm affraid the current by Jojo-Schmitz
I download beta version 2 with Inpector :
Moreover with "pluggin creation mode", I guess I saw a way to create on-line pluggin, exactly like you can create vba macro with vba excel through actions which are automatically translated to code lines in a new vba macro. (I refer to what I know)
But If it is, I didn't manage to transform my action on stem color on score in a line of code in pluggin within the creation pluggin mode.
Neither any other action: how can I act to do that ?
thanks for your help
An other point should be not in this section, it is like a "change request"
For getting more confortable score reading for children, from my expérience, color graphic possibilities are very powerfull for them: and possibilities on head note are very well-done for that in musescore;
unfortunately, stem are very thin ; is it possible to add possibilities to adjuste Thickness and color of stem through parameters , drived in pluggin ?
Best regards
In reply to I download beta version 2 by zenplus
I don't know about the possibility of changing stems through plugins. But you can change this and dozens of other settings via Style / General.
In reply to I download beta version 2 by zenplus
Check how it is done in the color voices plugin.
Thanks.
I saw now how to modify the stem thickness in Style/ Général
And I will explore the voice color pluggin to understand how color is inherit from Element
Best Regards
In reply to Thanks. I saw now how to by zenplus
Until very recently there was no way to access stem or hook of the chord. I added it in 4bacb66aaa, so you will need a recent nightly or wait for 2.0RC that should be out today if everything goes well.
In reply to Until very recently there was by [DELETED] 5
But that is read-only access, isn't it?
In reply to But that is read-only access, by Jojo-Schmitz
Yes, it means you can't write a new Hook in the Chord. But the Hook itself should be editable. Note that I didn't try it. Something like this should work
var chord = ...
if (chord.hook)
chord.hook.color = "#546734"
if (chord.stem)
chord.stem.color = "#546734"
In reply to Yes, it means you can't write by [DELETED] 5
sorry but what is exactly the "hook" of chord : is it the way to indicate in addition to the hamp a chord during less than one time (less than a black note) ?
In reply to sorry but what is exactly the by zenplus
See http://en.wikipedia.org/wiki/Note_value#/media/File:Parts_of_a_note.svg
"Hook" is another name for "flag".
In reply to See by Marc Sabatella
Thanks I understand hook now (what I guessed)
In reply to Yes, it means you can't write by [DELETED] 5
var chord = ...
if (chord.hook)
chord.hook.color = "#546734"
if (chord.stem)
chord.stem.color = "#546734"
this works Under betaversion of musecore ?
If it is: How can I adapt plugin in *.js format into *.qml format
I tried but I think I don't understand the qml structure file compared to js one: (syntax error)
Do you know URL where It is explained ?
Or maybe an simple example of a same pluggin in these two formats to understand how translate js format in qml format.
In reply to var chord = ... if by zenplus
Again, look at color voices, it comes in both flavours
In reply to Again, look at color voices, by Jojo-Schmitz
Hmm, I'm not coloring stems and hooks in that plugin, just notes and rests.
Looking into it...
Again, I go on to try, mixing your advices
I use colornote. qml , because handling pitch note & color, closest what I would like doing, that means handling note pitch (violin string) & stem color.
Therefore in colornote.qml, I introduce juste after the "while", this
var chord = cursor.element
if (chord.hook)
chord.hook.color = yellow
if (chord.stem)
chord.stem.color = yellow
That is;
property variant yellow : "#e6b432"
....
while (cursor.segment && (fullScore || cursor.tick < endTick)) {
if (cursor.element && cursor.element.type == Element.CHORD) {
var chord = cursor.element
if (chord.hook)
chord.hook.color = yellow
if (chord.stem)
chord.stem.color = yellow
var graceChords = cursor.element.graceNotes;
....
Then,
With Beta version 2, no syntax error, but no effect neither on hook color neither on stem color.
With version 2.0.RC, syntax error concerning hook & stem; that is
Warning: QMetaProperty::read: Unable to handle unregistered datatype 'Ms::Hook*' for property 'Ms::Chord::hook'
Warning: QMetaProperty::read: Unable to handle unregistered datatype 'Ms::Stem*' for property 'Ms::Chord::stem
And the end, I don't manage to come back to beta version 2
So I'm not expert in programming; I can understand in exploring what it's working and not.
Maybe you can notice something obviously wrong ?
In reply to Again, I go on to try, mixing by zenplus
Won't work in beta 2, but should in RC. The error shows how near you are :-)
I'm not sure though how to exactly do it... @lasconic?
In reply to Won't work in beta 2, but by Jojo-Schmitz
The code was still not right. I made some more changes in 1a66cfbadc
I can now color stem, hook, beam and slash for accaciaturra using
if (cursor.element.hook)
cursor.element.stem.color = "#FF0000"
if (cursor.element.hook)
cursor.element.hook.color = "#FF0000"
if (cursor.element.beam)
cursor.element.beam.color = "#FF0000"
if (cursor.element.beamSlash)
cursor.element.beamSlash.color = "#FF0000"
In reply to The code was still not right. by [DELETED] 5
Thanks a lot :
"1a66cfbadc" >> Does it mean I have to download an other version ?
And concerning vocabulary, what is beam and slash ; is it specific to accaciaturra ? do they (beam & slash) exist also for "normal note" ?
The piece of pluggin you described above, can be used also for "normal note " ?
and what about stem
Thanks again for your help
In reply to Thanks a lot : "1a66cfbadc" by zenplus
Yes, a nightly build, see http://musescore.org/en/download#Nightly-versions
And yes, only stemSlash applies to grace notes
In reply to The code was still not right. by [DELETED] 5
I guess it is rather
if (cursor.element.stem)
cursor.element.stem.color = "#FF0000"
if (cursor.element.hook)
cursor.element.hook.color = "#FF0000"
if (cursor.element.beam)
cursor.element.beam.color = "#FF0000"
if (cursor.element.stemSlash)
cursor.element.stemSlash.color = "#FF0000"
I've now updated the color voices plugin accordingly
In reply to I guess it is rather if by Jojo-Schmitz
So now questions which are so obvious for you;
•The latest MuseScore code is always available in the GitHub repository.
I understood that the code "1a66cfbadc " is somewhere in the Github
but where exactly ?
and how I can upgrade may 2.0 RC version with the nightly build ?
In reply to So now questions which are so by zenplus
By downloading from the link I gave...
In reply to By downloading from the link by Jojo-Schmitz
Ok thanks
I follow your link till this page:
http://prereleases.musescore.org/windows/nightly/
where I didn't find xxxx.4bacb66aaa. zip neither yyyyy.1a66cfbadc.zip
So obviously I need till some "piece of help"
- I m a true beginner :-( -
In reply to Ok thanks I follow your link by zenplus
Maybe it's better you wait for the release then. It's in less than a week now.
In reply to Maybe it's better you wait by [DELETED] 5
Yes maybe. But I understood the instructions concerning the nightly.zip
My question is; where is the nightlty.zip related to 1a66cfbadc in the page I mentionned above ?
That is http://prereleases.musescore.org/windows/nightly/
In reply to Yes maybe. But I understood by zenplus
not every commit results in a nightly build, but every newer build contains the older commits
In reply to not every commit results in a by Jojo-Schmitz
OK thanks
I try with the latest Windows Nightly I found , that is "R.9ab4e3e Nightly build";
Now my pluggin is working for "normal note" (not yet for GraceNote)
Just a question about beam when for example you have 4 notes linking within a beam: how can you deal with individual color note beam ?
Till I find a solution, I let beam black and I color only notes with their hook: it is easy reading
Thanks all for your help; It is very convenient to adjuste color & hook note upon the violin string for children (they choose their string color)
I go to handle the "note name" and a way to sing the note name for children having difficulties in reading score, that is preventing them to access an convenient violin playing (violin is enough difficult without these kind of difficulties)
One more : all, thanks for your help and I wait to go further a new version :-)
In reply to OK thanks I try with the by zenplus
Well, it'd be difficult to color a beam based on pitch, as it may (and probably will) connect notes of different pitches.
And yes, I too haven't got it to work properly for grace notes yet...