hint request: custom selection

• Nov 7, 2018 - 13:06

Hello everybody,
I need a plugin that selects all the altered notes in a score, whether the alterations are in the key or around the score
In the end I need to be able to select all the notes named C#, D#, E#, F#, G#, A#, B# at he same time or, separately, all the flatted, and double flatted, and double sharpened, instead of selecting each one and extending the selection...
Do you have any hint?
Is there any plugin already available that I can try to modify?
thanks


Comments

so basically every note where accidental is not null.
Guess you could the the notenames plugin as a starting point, as that cycles through all notes in score or selection

In reply to by Jojo-Schmitz

I modified the 'colornotes' plugin leaving out all the unnecessary code, keeping the browse cycle throughout the whole score.
Is almost works... almost...

I select the sharpened notes with this code:

if (note.accidental) {
if (note.accidentalType == 1) {
. . . do whatever you need. . .
}
}

and it work perfectly, unless there are two identical altered notes in the same measure.
In that case, Musescore writes correctly the sharp sign only on the first note.
Although internally the two notes have the same name (e.g. G#), only the one with the sharp sign is detected.
Seem that the code looks for what is written on paper instead of the real note (pitch) name and alteration...

Is there a better method of selection of all the sharpened notes (those are the ones that interest me now)?

UPDATE: I discovered that if I manually add the sharp sign to the second altered note in the measure, the plugin correctly detects it.
Seems a further confirmation that the Note object represents what's printed, and not the real note name...

In reply to by [DELETED] 120107

The color notes plugin looks at pitches (note.pitch % 12), so why not doing that in your plugin too? That would not diffentiate between a C# and a Db for example, but do you care? It also won't look at double sharp/flat.
You could also keep track of measures (if an element is a barline increase measure count) and inside a measure if a note has an accidental, a following note in the same measure with the same pitch has one too, even if not spelled out

Or, as mentioned, look at tpc, range -1 - 33, only 13-19 are plain notes, all other have one or two sharps or flats

In reply to by Jojo-Schmitz

note.tpc works! Thank you all.

I used ([20,..., 26].indexOf >= 0)

I needed to get exactly all the sharps and not the flats or naturals
I made a solfege soundfont that uses the velocity value to play a "D sharp" or "E flat" according to the score, and I have to modify the velocity of the sharpened notes only.
That's relatively simple in the usual G key, but gets tricky in bass clef or others... for me, I mean...
with this plugin I make it to do the "dirty work" :)

if you are interested, here is the result:
https://www.youtube.com/watch?v=GhV7ft136zs

In reply to by Jojo-Schmitz

I'd love to.
This is more a proof of concept, and had to hire some trained singer to record the notes in a consistent way and wide enough range.
I plan to build an "international" version, with "Ti" spoken instead of "Si" as we do in Italy, and a moveable Do version, with the different syllables for the alterations (Do, Di, Re, Ri, etc...)
It would be great being able to raise some funding to cover these expenses, and after that I'd have no problem at all to release all ...
By the way, did you have any experience with crowdfunding? The money needed is actually not that much... depending of course on costs/benefits.
For a project like this I don't think a new Pavarotti is needed :)

And of course I'm open to suggestions, if you know quality singers and/or recording studios that could help...

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