Hint needed to color notes according to the tone quality of their instrument
I would like to build on the colornotes plugin, to color the notes not only according to their pitch, but taking into account the instrument playing them. How from the plugin code do I learn what instrument is associated with the staff, and what, if any, subinstrument is in effect (e.g., mute or pizz.) for a particular chord?
What I'm trying to achieve: color the notes of a score according to their position on Arthur Lange's Spectratone Chart. This chart divides each orchestral instrument's playable range into one or more subranges of ten possible tone colors, each of which is mapped to a visual color.
For reference: https://www.alexanderpublishing.com/products/spectrotone-chart-download…
Comments
Hi Splainer,
I have the same need, I am also a professional software developer.
The musiced extension , Young Musician workspace, provides in the Palettes Annotation a way to mark a region of the score with a color, like a highlighter.. That should provide better visual than simply colouring note by note.
Unfortunately there isn't much documentation on programming the extensions.
Furthermore, the could be an issue from legal point of view in sharing such an extension to people that did not purchase the Spectrotone .
Perhaps a more straightforward approach is to
1. install the musiced extension, annotate a small region and then export in MusicXML format
2. check how the annotation is stored in the MusicXML
3. write a small program that process the MusicXML input, automatically enrich it with the Annotation as "understood" by the Musiced extension
4. import the output of that program in MuseScore and view it using the Young Musician workspace.
I think this is the approach that I will be following.
After writing that piece of work, I will contact AlexanderPublishing, and request authorisation for sharing the code with other people - would be great if they agree, if they don't then I could release the code but removing the "real sauce" that is the colour associated with specific frequency ranges for specific instruments.
In reply to Hi Splainer, I have the same… by lucatoldo
I think you might be missing what an extension really is.. It is just a zip-bundle of workspaces/plugins/soundfonts/templates/instrument-definitions. It can do nothing that you currently already can't do otherwise manually within the software as well.
In the case of annotations, the most straight-forward is to use a single plain "line" from the lines palette and give it a semi-transparent color as well as change the stacking order and Y-offset for it to make it "under-"lay the staff itself.
It might be nice to have a plugin to create such lines; although I'm not sure they can at this point in time. If they can't, then yes, using the MusicXML approach for adding such lines might be feasible. It in no way involves having any entension/muxt installed however.
There is no such thing as having an annotation being "understood" by the musiced extension as the extension doesn't contain code, nor has any purpose of "understanding" something. It is just a plain old line with some fancy styling options.
In reply to Hi Splainer, I have the same… by lucatoldo
Hi lucatoldo,
If you go the MusicXML route, you might find a musical analysis library like music21 (http://web.mit.edu/music21/doc/about/what.html) handy for step 3 and 4. It can parse the MusicXML into useful structures for the analysis. I'll be very curious to follow your progress with this.