Export then import of midi changes spelling of notes.

• Sep 10, 2017 - 21:46

In the Russian forum a user posted this problem here: https://musescore.org/ru/node/251341#comment-781881

A translation of his original post from Google:
When exporting to the mid-file, in some places sharp has changed to flat. What am I doing wrong, tell me? Or correct the source file, if you can. It is clear that E flat - this is sharp. But it immediately seems that the notes are not the one and you get confused.
(end of original post)

I used his files to duplicate the problem. Version 2.1 was used to create the original file and in my testing. The users links are in English, so everyone should be able to read them there.

Basically, If you export the ToElise.mscz file to midi then import it back into MuseScore most of the sharps are changed to flats. These note spellings are consistent with the key of C. If you select the human performance option while importing, it comes up with the key of E (4 sharps) and spells all of the notes as if you would expect them to be in the key of E. I don't have a program that will let me look at the midi, so I don't know where the change is happening or if anything can be done about it.


Comments

There is nothing in a basic MIDI file that differentiates between enharmonic variants of the same pitch. The file format only holds the pitch information.

In reply to by jeetee

Hello everybody!
I'm from Russia. My name is Vlad. MuseScore provides more information in the midi-file. And this is read by other programs. I play the Piano Booster program, which allows you to learn CASIO synthesizer. This program distinguishes between flat, and #, and bécarre. Means midi-files can store the different information and not only number of a note.
Sorry for my English:)

Attachment Size
synthesizer.jpg 56.85 KB

In reply to by vlad1vv1

I believe you are mistaken. Each program really does has to guess the desired spelling from the information in the MIDI file. Your other program just happens to guess differently than MuseScore. If your other program really was doing what you think it is doing, it would have corrected spelled the Eb's as D#s, because the Eb is just wrong.

It might be that some vendors implement their own non-standard extensions they use internally to read and write extra information, but there would be no way for one program to know the non-standard extensions used by another. I wouldn't be surprised if there wasn't some "unofficial" standard that is used by multiple vendors, but anyhow, it's not something one can depend on.

This limitation of MIDI is just a fact of life, has been from the very beginning. This is why one of many reasons MIDI is a poor choice to use when trying to transmit notation information.

In reply to by vlad1vv1

Again it does not. MIDI has no concept of enharmonics; there simply is no difference between a sharp and a flat note of the same pitch. There is only pitch. MIDI is not a notation format, it is a playback format

Programs that then interpret that playback information back to notation are free to interpret this however they like. It's just like you watching someone play a piano and then transcribing that onto a sheet of paper. If they play the black key between a C and a D, it's totally up to you to either write that out as a C# or a Db. The piano key being pressed holds no such information.

Have a play around with the attached files, both result in the same pitch information; but they are different enharmonic notations of the tune from your screenshot.

Attachment Size
783666_MIDI_ex1.mid 185 bytes
783666_MIDI_ex2.mid 178 bytes
783666_MIDI_ex2.mscz 4.71 KB
783666_MIDI_ex1.mscz 4.68 KB

In reply to by jeetee

If there is Key signature information at the beginning of a midi file, the notation software will evaluate the accidentals accordingly.

Example: If there are no key signature (C major or A minor) in midi file; f#, c# and bb, eb are written instead of gb, db and a#, d#. (in importing/translating ) // These are the closest (relevant) key's accidentals to the C Major Key.

  • eg: (Key is C Major) c, e, d#, e, eb, d, db, c. -> save to midi file,
    import midi file -> translated to -> c, e, eb, e, eb, d, c#, c <- closest accidentals (from nearest keys)
  • eg2: (Change Key to A Major) -> save to midi file,
    import midi file -> translated to -> c, e, d#, e, d#, d, c#, c <- closest accidentals (from nearest keys)
  • eg3: (Change Key to Ab Major) save to midi file,
    import midi file -> translated to -> c, e, eb, e, eb, d, db, c <- closest accidentals (from nearest keys)

In situations that may be ambiguous, the software is free to do whatever it wants.

Inside the midi file, notes are indicated by numbers only.
eb and d# have (share) the same note number.
When we import: the software has to make some estimates. These estimates are sometimes effective, sometimes not.

The correct thing to do: is to run the "respell pitches" command after importing the MIDI file.
In this case, it is expected that the accidentals will return to their normal places.

In reply to by Ziya Mete Demircan

When Jeetee gave his reply I explained 1 number per note on the Russian site - hopefully in coherent Russian. Since the original copy had all sharps and naturals I told the OP to select all and use the down arrow followed by the up arrow to force sharps on all of the notes. Respell pitches does the same thing, but I'm not as sure how to explain that in Russian.

I think it's a good idea to stress that this is an inherent limitation of MIDI, not something we are not doing as we should, and that people should strongly considering not using MIDI for anything involving notation. people often use it because they don't know about MusicXML, or indeed they don't realize that both of these are inferior to simply saving the score normally.

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