musescore / musescore/MuseScore

MIDI export mangles large scores' instruments and channels

Open
#16,540 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

MIDI
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Describe the bug
When trying to export MIDI from a score with lots of instruments, I usually find that the output file somehow has the wrong instruments playing the wrong notes, and frequently that two unrelated staves have been smashed into one channel.

In my current test score, I have an orchestra of:

  • Bassoon
  • Horn in F
  • Timpani
  • Glockenspiel
  • Vibraphone
  • Solo violin
  • Solo contrabass
  • Section violins I and II
  • Section violas, celli, and contrabasses

In the exported MIDI, the bassoon, vibraphone, glockenspiel, and timpani are all set to play with the String Ensemble patch, except for the very first beat (where only the vibraphone plays). This was tested in VLC Media Player and OpenMPT.

In addition, when imported into OpenMPT, I find that Vibraphone and Violins I are in the same MIDI channel. When they happen to play the same notes at the same time, only one note appears, meaning information is lost.

To Reproduce
Steps to reproduce the behavior:

  1. Open a large orchestral score.
  2. Play back in Musescore for reference.
  3. Export as MIDI.
  4. Play back the MIDI in VLC

Expected behavior
Every staff retains its instrument when exported. Staves do not share channels.

Screenshots
The part in MuseScore:
image
The part in OpenMPT (channels run top to bottom):
image
If nothing else, note that the instrument (numbered 3) is the same for all notes, despite showing the rhythms of two separate staves.

Platform information

  • OS: Windows 10

Additional context
In MuseScore 3, every variant of the strings sound patch (arco, pizzicato, etc.) had a separate channel by default, meaning each strings section would waste several full channels. Often, manually reassigning all channels and ports so that one part = one channel would fix MIDI export.
I assume the same applies to MuseScore 4, but unfortunately, I don't seem to be able to check MIDI channels anymore....

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 export with a large orchestral score, then inspect the exported MIDI in VLC or OpenMPT and compare instrument assignments and channel usage with MuseScore playback. Done means each staff retains its instrument and unrelated staves no longer share a MIDI channel without losing notes.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.