musescore / musescore/MuseScore

MIDI export (piano at least) incorrect handling of velocity and dynamics

Open
#20,788 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

MIDI P2 regression MS3
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
  1. Create a score with 3 measures, one staff, several notes in each measure.
  2. In the first couple notes in each measure change the velocity to 40 and 50 leaving other notes 64 (default).
  3. In the first measure put "p" as a dynamic, then "mf" then "f" in the last.
  4. Play -- you'll hear the 40/50 notes quieter but they will change measure to measure (use "pppp" or "ffff" if in doubt).
  5. 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.

Velocities_In_Midi_File_Dump
Velocity_Score

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.