User velocity does nothing

• Aug 11, 2020 - 00:53
Reported version
3.5
Type
Functional
Frequency
Few
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
Yes
Workaround
Yes
Project

User velocity doesn't change the velocity of a note in 3.5. I am on windows 10, 64 bit. User velocity works in 3.4(and maybe alpha/beta/RC). Offset velocity works as designed. The workaround is to use offset velocity, but that is annoying when trying to get ghost notes to playback.


Comments

Both user and offset velocity settings work as expected for me on instruments that don't use single note dynamics. For instruments that do use single note dynamics, I'm not exactly sure what I expect, but I do think I know that velocity has little to do with volume on that case, more about initial attack only. For such instruments, though, I don't see an obvious different in behavior here between offset and user. That is, a flute note at mf (default velocity 80) continues to sound mf whether I set user velocity to 1, or offset to -79.

As far as I recall it's been that way since the beginning of single note dynamics, certainly it was that way at first. Maybe there were a couple of releases in there where velocity did somehow affect volume even with SND?

Anyhow, since you say you hear a different between user & offset, we must be doing something different. Can you attach a score and steps to reproduce a problem?

In reply to by Marc Sabatella

That is the problem. It was working on the lead sheet where I had the ghost note on rhodes (using offset), but it didn't work on the arrangement with flute/alto sax (using user). I think that it should work for constant velocity instruments, so you can have ghost notes on woodwinds/brass.

I don't know that is has to be this way, and I'll let TheOtherJThistle speak to whether it's feasible to not do this. But I can provide some historical context.

"Velocity" comes from the world of keyboard synths, where it is literally how you measure how hard someone pressed a key (the time it takes for the key to get from a sensor at the top to a sensor at the bottom). In the original days of MIDI, that was basically it - velocity was the one and only way to control the volume of a note. Hit a key harder, get a louder note. But velocity info is transmitted only once, when the note is first hit. So there was no way to have the volume change afterwards. Well, no way the user could control, anyhow - obviously piano and other sounds might decay on their own. So, someone came up with the idea of sending send separate MIDI messages (called "continuous controller" or CC messages) after the initial note to control the volume. But not all implementations support that model.

If you do support SND, the volume is thus mostly controlled by CC, but the initial velocity is used to select which sample gets used in the case of instruments sampled at different "velocities". For example, a Rhodes electric piano sampled with a soft attack and hard attack), but the CC message controls the volume. But, I gather some implementations might use this "velocity switching" for something entirely different - like to use different samples for slurred versus tongued notes for strings and winds, or different stick/mallet types for percussion, or who knows what else. So in an implementation where you are using CC messages to control volume, you can't necessarily assume velocity actually is related to volume at all.

Except, maybe we can, because shoot, it's our implementation. That's where things get super fuzzy for me. I don't know if there is some technical reason why one cannot use initial velocity to also set the volume. Maybe that would affect other notes already being sustained, since CC messages are per channel rather than per note. That seems plausible. Or maybe it's just inconvenient to code it that way given the current realities of our algorithms and data structures.

I do remember this having come up as an issue with 3.1, and there either was or was not a solution found. If there was and it stopped working, that could be related to the same change that apparently broke some things about accents. Or it might be it's really been this way since 3.1 and there really is no good solution in the near future.

I'm not saying it's a good thing, but assuming you read through that history, hopefully you at least understand why that is the case based on the constraints of how MIDI works. A workaround would be to turn off SND for that instrument. Maybe someone else knows of some clever way to coerce SND into doing what you want.

CC11 is a synthesizer setting and affects all instruments. It makes SND work for all supported instruments as well as user velocities in nearly all sound fonts but makes expressive sounds in the MuseScore_General_HQ sound font not work.

If you read my historical background carefully, you will better understand the technical reasons why in some sense velocity is inherently incompatible with SND. There might be hacks to get it to work, but as I noted, it likely wouldn't work the way you want or need, because CC messages are per channel, meaning if you make one note softer or louder via velocity, then as far as I know all notes currently sounding on that channel would be affected.

Maybe MIDI 2.0 includes something we would be able to take advantage of in MuseScore 4. MIDI is not really my specialty, but I have been around it and doing some programming around it since practically day one, so I'm better at talking about generalities than specifics.

In reply to by BSG

Every single midi note-on contains a velocity. This is now inoperative/ignored? Can Sibelius or Finale control the volume of a single note? I can see that setting the initial velocity of a note that has internal dynamic changes can present problems, but most notes DON'T. Removing the ability to control individual notes is no solution. If it's no longer supported, remove it from the UI.

Velocity is not ignored, it just no longer controls volume, for the reasons I tried to clearly explain already - when using SND, volume is controlled by CC messages, not by velocity. So in theory, velocity will control which sample gets used, but it won't control the volume, if SND is enabled, because that is fundamentally the difference between supporting SND versus not. Plugins can presumably control velocity in the same way the Inspector can, but I doubt setting velocity from a plugin will change the basic fact that in the SND, velocity simply is not the same as volume.

Whether there is a way to hack the MIDI specification in order to override this is something I have no insight into. Might be something to take up on a MIDI-specific forum, if people there have good suggestions for us as to how to resolve this conundrum, feel free to point us to their answers.

@BSG , @sr3323 - this may be a bit technical, but this is why single-note dynamics doesn't work with note-specific velocities:

We control single-note dynamics with CC messages. These are messages that are sent to the synthesizer, and in this case they tell it how loud to make the playback. We use CC messages because they can change how loud a note is in real time.

The problem is that the soundfont is setup to interpret these CC messages as 'change the volume of the channel'. The channel is the synthesizer's name for an 'instrument'. So, if our CC messages are changing the volume of the whole channel, there's no way individual note volumes can be controlled.

There are plans, I hope, to use something called 'polyphonic aftertouch' in the future, which does allow note-specific control of volume.

But for now, we can't control note-specific volumes. As far as I can remember, it's always been that way with single-note dynamics.

In reply to by TheOtherJThistle

I understand. The field should be removed or greyed out in the inspector for SND instruments. There should therefore be a way to set the channel volume (via CC), for the whole channel, at a point in the score with the inspector without introducing a "Dynamic" mark, hacking it, and hiding it, even if the velocity of individual notes is no longer meaningful.

In reply to by BSG

> There should therefore be a way to set the channel volume (via CC), for the whole channel, at a point in the score with the inspector without introducing a "Dynamic" mark, hacking it, and hiding it, even if the velocity of individual notes is no longer meaningful.

What?! Why? What's wrong with introducing a dynamic mark and just setting it to be invisible?

In reply to by TheOtherJThistle

It is unappealing. You need another one to revert it, and that requires knowing and duplicating the regnant dynamic prior to it, something which, by the way, is impossible to determine but by eye (esp difficult in light of hidden dynamics, as it were) in MuseScore. And if you ever change that, you'll be in a pickle unless you find all of these. It is awful and a nursery for errors.

I feel this sort of fine co tell over the playback is the sort of thing that will be addressed by t sequencer in MuseScore 4, no need to reproduce this effort in the Inspector.

But, a note on velocity and SND - shouldn’t velocity still affect the initial attack, by allowing the synth to choose the proper sample? For example, if middle “C” on trumpet is sample at three different dynamics and mapped to three different velocity ranges, this should be something the Velocity field In the Inspector could still co troll. Right now, though, I’m not convinced velocity is used at all for this purpose.