Plugin Request: Automatically display note velocities by staff

• Dec 12, 2018 - 18:46

When analysing or interpreting the dynamics of a live midi performance, It would be helpful to see the numerical velocity of each note (user or offset) placed above or below the staff (see image). Numerical velocity values are much more precise than traditional dynamic markings (piano, forte, crescendo or diminuendo, etc).

Besides displaying note velocities as staff text, the plugin could offer the choice to add traditional dynamic markings automatically by calculating the average velocities of a passage or selected measures. While displaying note velocities as staff text, similar to the "notenames" plugin, seems fairly easy to do, displaying traditional dynamic markings would be more difficult as it would require analysing the velocity relationship of multiple notes. Other brainstorm ideas included color-coding the velocity numbers to show traditional dynamic levels--for example, pink for piano, orange for forte, purple for pianissimo, red for fortissimo. Or, to avoid colors, the very load velocities could be bolded and the very soft, italicized.

To minimize unnecessary clutter on the score, there could be a threshold to display only those velocities that significantly change between notes (e.g., a difference greater than 5). For example, a velocity difference of "1" may be too subtle for the ear to the detect compared to a difference of "5". Or, the velocities could be rounded and any consecutive velocities of the same value not displayed.

I am not a competent programmer, so I am putting this idea out to see if anyone with more skills might be interested in developing such a plugin for Musescore 2/3, at least to do the simpler task of displaying note velocities as staff text.

Thanks.
PS: The staff text has been minimized to 8pt and the values are "user". Also, the velocity of the last note is not displayed since it is the same as the preceding one ("36").
notevelocitiesabovestaff.png


Comments

In reply to by Jojo-Schmitz

I tried experimenting with the Notenames plugin, looking at other plugins, and reading through the help in the plugin creator, and I still don't have a clue what I am doing. Unless there is more documentation, I cannot create the plugin. It would probably take someone fluent in qml to modify the Notenames plugin into a basic "velocity to staff text" plugin in 1/2 hr--me, days.

In reply to by Jojo-Schmitz

Thanks for the hack. However, the numbers shown above the staff are not note velocities, but midi/pitch numbers? I looked through your hacked code and I couldn't find any velocity-specific read commands. I was unsuccessful in plugging in commands veloOffset or VeloType.

Do I have to change how nameChord is defined?

function nameChord (notes, text) {
for (var i = 0; i < notes.length; i++) {
var sep = ","; // change to "\n" if you want them vertically
if ( i > 0 )
text.text = sep + text.text;

     if (typeof notes[i].tpc === "undefined") // like for grace notes ?!?
        return
     text.text = notes[i].pitch
  } // end for note

}

Also, how would I change the font size from 10 to 8pt.

Thanks again,
Sam

PS: I've attached a short test score based on a live performance, a midi conversion of a ukulele track using Anthemscore (https://www.lunaverus.com/), that has varying note velocities.

Attachment Size
VelocityPluginTest.mscz 7.72 KB

In reply to by Jojo-Schmitz

Thanks! I must have spelt veloOffset wrong when I tried earlier.

Unlike your notename plugin, the modified plugin only displays one velocity above polyphonic notes (e.g., dyads). The plugin reads the first note, but not the rest. I would also like polyphonic values stacked vertically, bottom up ('var sep = "\n"; // change to "\n").

Is it because the output is an integer instead of a string that "text.text = sep + text.text;" is not concatenating?

Thanks again,
Sam

In reply to by Jojo-Schmitz

Thanks. It works!

I've modified the plugin to round the velocities to single digits to make it less cluttered on the score. The idea is just to get a general sense of note-to-note dynamics, similar to Marcel Tabututeau's numerical system used to teach phrasing. (Marcel Tabututeau was a French-American oboist who is considered the founder of the American school of oboe playing.). Also, the plugin reduces the font size to 8.

At some point, it would great if you made the notename plugin properly position vertically stacked note names so they don't overlap with the notes and have to be readjusted manually. To get around this, I set the staff text style to align the numbers vertically to bottom edge by right-clicking on a number, "select all similar elements" and then "text properties". I've also adjusted text.pos.y within the plugin to compensate for this realignment.

VelocityPluginTest.png

Attachment Size
VelocityPluginTest.png 56.96 KB
notevelocities.qml 4.16 KB

In reply to by Sambaji

How can I change the vertical alignment of staff text to "align bottom edge to reference point" within the plugin so it doesn't have to be done manually? The solution would also work in improving the notesnames plugin.

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