musescore / musescore/MuseScore
MIDI export (piano at least) incorrect handling of velocity and dynamics
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 15.1k
- Forks
- 3.3k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 91
Description
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
- Create a score with 3 measures, one staff, several notes in each measure.
- In the first couple notes in each measure change the velocity to 40 and 50 leaving other notes 64 (default).
- In the first measure put "p" as a dynamic, then "mf" then "f" in the last.
- Play -- you'll hear the 40/50 notes quieter but they will change measure to measure (use "pppp" or "ffff" if in doubt).
- Export midi, and either dump the file or create a new score from it. The actual midi velocities are 40 and 50 in all three measures for the changed notes, but vary by the dynamic for the others.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the listed three-measure score in MuseScore 4.2, then compare playback with the note-on velocities in the exported MIDI file. Done means notes with explicit velocities such as 40 and 50 respond to dynamics consistently with notes left at the default 64.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100