MIDI export saves wrong instruments

• Jan 12, 2019 - 17:33

if I export my music to a midi file in musescore then the wrong instruments are saved to it. The midi then sounds very different, even with the correct soundfont loaded. Why is that?
Even if I reimport it to musescore the instruments are not as configured them before the export.

That's how it should sound: https://www.dropbox.com/s/qqmfbbhb908228g/Elemental_Stars.mp3?dl=0
Here is the MIDI: https://www.dropbox.com/s/ikdan6gl6yfqgzt/Elemental_Stars.mid?dl=0

The MIDI was created with the default soundofnt of musescore.


MIDI files do not have any sound of their own, the sounds you hear when you play a MIDI file depend on the soundfont used by the program that plays that MIDI file. If I load your MIDI file into MuseScore and play it, then it sounds just like your MP3. But if you try loading it into any other program to play, then you will hear the sounds of that other program. That is the nature of MIDI - it doesn't contain sounds, on instructions on what notes to play.

In reply to by marcopianissimo

Feel free to attach your score so we can understand and assist better. But my guess is, you are using non-standard instrument assignments, either within MuseScore or within the program you are using to read the MIDI file. If you deviate from the General MIDI standard, you need to do so using both MuseScore and the program you use to read your MIDI files.

Alright, I figured out how to fix this issue. I know I'm over a year late, but I'm sure someone else will show up and have the same issue.

Long story short, some devices are incapable of using more than one port. MuseScore allows for exporting up to 16 different ports with 16 channels. Once again, many programs (including Windows Media Player) CANNOT use more than 1 single port. This means you need to fit every single unique instrument into 16 channels. Luckily, duplicate instruments can share a channel and export fine.

Keep in mind that many instruments actually occupy more than one channel. In the Mixer, you'll notice a right-facing arrow on every instrument. Sometimes, it's able to be clicked, and doing so reveals several more. For example, Violins (and all strings for that matter) have 3 in total: Arco, Pizzicato, and Tremolo. If you're only using Arco and not the other two, I'd go on each and set their channels to 16, which will be designated as unused. Yes, this does mean it's technically now only 15 total channels available. And no, you cannot place them all onto one channel. If you do, the instrument will sound like whatever the rightmost subinstrument is. In the case of a violin, it'll just make it constantly sound tremolo.

Additionally, and this is super important, channel 10 is ONLY for percussion. If you use a percussion or drumset on any other channel, it will play as a piano. If you use any other instrument on channel 10, it will use the percussion soundfont.

If you do have two instruments on the same channel, they'll all use the soundfont of the rightmost instrument in the mixer. I don't know if this has any practical application.

Finally, make sure you go to Preferences > Export > MIDI and check on "Export RPNs". This will allow your MIDI file to retain information such as pitch bending, vibrato, and other like information.

In reply to by DaSquyd

Hi there.
The same thing even happened for me when I tried to use Violins and Glockenspiel concurrently in my score. As soon as I added Glockenspiel to the list of my instruments, things started to go wrong. My violins sounded like Glockenspiel which completely turned my MIDI file into a mess. Also tried the methods you and other kind people had mentioned but none of them worked. In the end, I simply removed the problematic instrument and tried to find another way of completing my score. After deleting Glockenspiel's track, the MIDI file became OK as it should.

In reply to by PotatoPat

The problem as originally described is not a problem in MuseScore but a misunderstanding about how MIDI works - it simply does not record actual sounds. If you are having a problem you feel is not simply that, you would need to attach a score and give us precise steps to reproduce the problem in order for us to investigate further.

In reply to by Marc Sabatella

Marc, could it be that you are stuck in the idea that the OP complains about a violin not sounding as good as in his original score, while he actually wants to know why a violin has changed into a clarinet?
"if I export my music to a midi file in musescore then the wrong instruments are saved to it."

In reply to by jotti

I don't think that's what I was thinking at all, although it was over a year ago, so hard to say. Anyhow, though, the same answer certainly applies - violin sound can change to clarinet if you are using two different soundfonts and the program number for violin in one is clarient in the other. And that's really my point - MIDI is just numbers, not semantic information. We really don't know anything about how the OP produced the audio with the clarinet sound. I asked for clarification but none was ever provided, so it still seems to me a very assumption that this perfectly normal difference in soundfonts is completely responsible for what is being described here.

If not, then still, a year later, we still need precise step by step instructions to reproduce the perceived problem.

In reply to by Marc Sabatella

Marc, I searched for a forum comment that matches my problem. This is the closest I came. I know it is 2 years old. Here is my issue. When I export a score with multiple instruments to a midi file, then load that midi file into a program that plays midi files, it loads the whole score under one instrument/port/channel. My default instrument in the midi program is piano, so it plays all the instruments in my score as piano.
I know this isn't a bug, I just need help understanding why this happens. Is there a setting or something I need to do in Musescore to get the midi file to separate the parts into individual channels for the midi program to read as separate instruments?

In reply to by odelphi231

MuseScore exports MIDI files with separate tracks for each instrument, with each track on a separate channel. not sure what you mean by "it loads the whole score under one instrument/port/channel", but it sounds like the "it" to which you refer here is ignoring the track & channel info present in the file. So you'd need to consult the documentation and/or support forum for the software in question in order to understand why it sin't reading the MIDI file correctly.

In reply to by Marc Sabatella

Thank you. I had a feeling it was my midi software, but I wanted to be sure I didn't need to do anything to "prepare" my score for export. Do I need to make sure that each instrument is on a different channel in Musescore, or is that the default? What is the difference between a port and a channel? In musescore, you can change the port and the channel of the instruments.

In reply to by odelphi231

Hi, to my knowledge this is usually down to the midi software you use. When I open a midi file (created by MuseScore) in Cakewalk by Bandlab, it automatically creates separate tracks for each channel (instrument) and even add the TT GM sound module to this to play all sounds correct.
Other software might not do this be default and just import all into 1 track and others ask you how you want to import (i.e. when I use Reaper, it asks my if I want to expand multiple tracks or if I want to use single track).

Perhaps your midi software has an option somewhere to set/define this behaviour?

Of course when you use a "sound" in MuseScore that is not part of the GM standard or is assigned to a different patch, you get the wrong sounds but you can adjust this manually once the midi is imported.

In reply to by odelphi231

It's the default that each instrument in MuseScore is saved to a different track, and MuseScore will use different channels for each as well - often multiple channels per track (eg, for violin pizzicato vs arco). You shouldn't mess with any of those settings unless you are an expert and know exactly what you are doing, the defaults should be correct for most cases.

Prt vs channel is something a web search would help with, but as I understand it, MIDI defines only 16 channels per port, so multiple ports can be used to allow more than 16 channels.

In reply to by Marc Sabatella

I can confirm it was my software. I tried a different midi software and when I imported a midi file created in Musescore, it separated the tracks perfectly. Of course the sounds were different, but I know that is a soundfont thing. Now I need to figur out why my midi software is not working the way it should.

In reply to by odelphi231

I have spent the past couple of months trying to get my head around this, and it is all very strange...

Like the OP, I have exported a MuseScore score to MIDI and then attempted to load it into Cakewalk by Bandlab. The problem I face is the same as the OP (I think); the tracks are named appropriately: Piano, Ukulele, Violin, bass Guitar, etc., but when opening the song in the TTS-1 Synth, the actual instruments bear no resemblance to the track names. Sometimes they all play back as a piano, and at other times they load with multiple instances of things like "Slap Bass", "Jazz Guitar", Pizzicato Strings", etc. CW MS Screenshot_2.png

The same happens in other programmes; for example: Vanbasco's Karaoke Player VB Screenshot_2.png

But...Here's the thing, if I open the MIDI file from MuseScore in another notation software, Midillustrator, it opens and plays perfectly. MI Screenshot_2.png

However, if I then export from Midillustrator as a MIDI and open the resulting file in Cakewalk, the same problem occurs as happened with the MIDI file from MuseScore.

From this, I can only conclude that it is not an issue with MuseScore, per se, but the way in which notation software handles and exports MIDI - however, I am certainly no expert on the matter; this is only from my observations. Nevertheless, it's extremely frustrating. Working in a DAW seems to be no walk in the park at the best of times.

By way of comparison, if I open a professionally (i.e. paid-for) MIDI file, it loads into Cakewalk without issue.

I realise that MuseScore is intended primarily as a notation tool, but perhaps someone could shed some light on this anomaly? Perhaps there is a step in the process of exporting as MIDI that I, and others, are missing?

I have attached the original .mscz and resulting .mid files

In reply to by NefynIan

The only thing I can add is that MIDI is a series of codes that tell the software what instruments to use and track numbers. Maybe some software don't read those codes properly or are very strict in their interpretation, while others are more forgiving. I don't think you will get an answer from a Musescore expert because it is not strictly a Musescore issue.

In reply to by Marc Sabatella

I've found a slightly different problem. I made a score with a few instruments and exported the midi form this. I opened the midi file in Reaper (my DAW) each instrument loaded as a separate MIDI track. I connected it to my keyboard and I routed it to send the midi playback for each track to a different channel of the keyboard. If the Midi has no instrument attached then it should simply play using whatever instrument/sound is set on that channel of on the keyboard at that time.
The problem is that whenever I restart the track, it resets the instrument/sound my keyboard is using. This indicates that a preferred instrument is embedded in the midi file.

I had this problem about a year ago and found a way to prevent this by changing the way I exported or perhaps loaded the MIDI but I have forgotten what it was. If you know anything about this or what the real name for the "embedded preferred instrument" might be, any assistance would be appreciated :)

In reply to by londonjono

If I understand you correctly, you're talking a the MIDI "program change" message that MIDI files will generally contain at the start of each track to tell the receiving player which sound to use. If you want to use a different sound than the one written into the MIDI file, you can probably configure your DAW to ignore program change messages.

Do you still have an unanswered question? Please log in first to post your question.