Open Linwood-F opened 9 months ago
I've tried to search for related issues. One is here but has no midi detail (found by Marc Sabatella, thank you):
https://github.com/musescore/MuseScore/issues/19207
While I suggest the issue is in Midi Export, I do not think it is in the exportmidi.cpp module itself, since I see no references there to velocity and scaling, I think it relates to how other output mechanisms are recording the need to scale and where exportmidi pulls data, but I am lost in the playback code itself. I tried tracing back through event/NPlayEvent (my best guess but I think it may be further back).
The midi import should be looked at as well.
Open new score, add a C note. Check properties/playback/velocity. It is 64. Export midi, drag/drop midi file into musescore. Check note - properties/playback/velocity is 80.
The imported note is louder due to the “user velocity” being 80 instead of default 64.
Issue type
Import/export issue
Bug description
In the changes from 3.x to 4.x and how velocity (vs velocity offset) are handled, the midi export does not work as expected. In particular, if a note is left at the default 64 velocity in the score, dynamics (e.g. p, mf, f) affect it. If you change that note to, say, 63 -- then it is output as 63 in the midi file ignoring dynamics.
This makes it impractical to use velocity as a mechanism for fine tuning midi output, e.g. to emphasize one voice or notes slightly.
I believe that all velocity settings should be treated the same with respect to dynamics, and indeed if you play a score back from within musescore, it is; it appears to be only different on midi export.
I am labeling this as a regression however in 3.x I do not know if this precise presentation of the issue occurred, as in 3.x there was a velocity offset that served this purpose.
Steps to reproduce
I'm going to try to include a score and midi output as well.
Screenshots/Screen recordings
No response
MuseScore Version
4.2
Regression
Yes, this used to work in MuseScore 3.x and now is broken
Operating system
Windows 10
Additional context
Apparently I cannot attach an actual mscz, but it takes moments to reproduce the score from the image. The dump is a filtering of the output midi to just the note-on value and the last column is the velocity in the midi file. Of significance is how "40" and "50" are never changed but 64 is.