Simple score exported as midi, does not get same result when opening that midi file.

• Oct 13, 2018 - 03:43
Reported version
2.3
Type
Functional
Severity
S4 - Minor
Status
by design
Project

I am working with a simple M+W+Piano score for "Dona Nobis Pacem" for a college class. When exporting the parts to midi files I can hear there is something wrong with playback of the piano part midi file in Windows Media Player. The problem is that exporting midi has a bug that incorrectly processes simple one voice melodies and chords.

Compare the attached source mscz file piano part vs. the score produced when using MuseScore2 to open the attached MuseScore2-exported piano part midi file.

Note that if you re-export the attached mscz file to midi format, and then open that NEW midi file with MuseScore2, you may see errors in different measures than the errors in the attached midi file.


Comments

This score seems to stem from an XML import, so could you share the XML too?
And what exactly is wrong with the midi export file?
On re-import of that I do see some differences, these seem to be due to unison notes on different beats in the different staves of the piano cancelling out one another, like the Bb3 in measure 4, beat 1(-3) in bass clef and beat 2-3 in treble clef. And the missing slurs, of course. But both are most probably due to MIDI not being designed/able to carry those informations.

Hi Jojo,

Thanks for the quick reply. The XML is attached along with a screen shot of the iOS Sheet Music Scanner app that created the XML from the source camera image of a simple treble clef in a beginner voice class music text. What I was doing was duplicating that treble clef to add a bass clef, then duplicating both to hear choir and piano together, then replacing the piano bass clef with chord progressions for my accompanist to play for me while while I sing my part.

However you don't need any of that information because I just recreated the problem from scratch just by manually entering notes and chords into a new test score. Please see the attached "Test Midi.mscz," "Test Midi.mid," and "Test Midi-result.mscz."

In doing so, I discovered I might have violated some MIDI restriction. In my original problem, and in this very short test case, the piano treble and bass clefs were composed independently. It just happened that the B♭ below middle C in the treble clef was duplicated (contained within) the bass clef chord, as if asking my accompanist to hit that key with one thumb first and then the other thumb. I'll correct that before giving the score to him.

Now, as a bug report for MuseScore, somebody should take a look at that code. Measures 1 and 2 are just plain bizarre, with the dotted half B♭ in the chord being split out and changed to a staccato quarter, then continuing with the treble clef B♭ as a tied eighth, dotted eight, and sixteenth that doesn't reach the end of the measure. (Any correction to that code will probably fix measure 4, too.)

Bottom line -- I'm reporting a case where MuseScore2 exports a score to a midi file, opens that midi export, and doesn't get back a note-for-note match with the source of that export. If that's a bug, it'll be easy to generate similar test cases.

Attachment Size
Dona Nobis Pacem.xml 15.6 KB
Dona nobis Pacem.PNG 181.52 KB
Test Midi.mscz 5.74 KB
Test Midi.mid 215 bytes
Test Midi-result.mscz 5.8 KB

It is most definitely not a bug that exporting a score as MIDI then importing it won't get you back what you started with. In fact it would be practically miraculous if it did. MIDI simply doesn't contain nearly enough of the information that would be needed to make that work. It was never intended for that purpose.

That said, there may be cases where MuseScore could do at least a little better. The overlapping notes in this example are pretty obviously the source of the main problem here. Also, the fact that the piano piano is defined to leave a slight space between notes on playback, in order to have a chance for tenuto or slurs to lengthen the notes.

Remove the overlapping note and change the instrument to almost anything else and you will see you do get something more like what you started with - in this case. Still, as I said, that's only coincidence if it happens to work out like that.