Bug reading mscx and mscz files

• Nov 6, 2015 - 20:22

I noticed this problem using the Speedy MIDI editor. The editor includes configuration information in Lyric messages in output files. Here is an example as recorded in an mscx file:




Unfortunately, the xml example doesn't seem to show up, even if I enclose it in pre tags.

MuseScore successfully loads the original MIDI file and will create an mscx file. The problem is that the program stops with an error message when trying to read back its own mscx file. The error occurs in lines like the one illustrated. The trouble may be associated with the underscore symbols in the text. I attached the incorrect mscx file created with MuseScore.

Version 2.0.2

Attachment Size
musescoretest.mscx 1.13 MB

Comments

On ubuntu 15.10, using a build from last night - 5a8cf68 - I get an error:

"XML read error at line 21247 column 507: speedy_midi_config"

Loads fine once this line is removed.

In reply to by underquark

Thanks for your reply. It certainly is an XML error, and the XML error was created by MuseScore. I know this particular file can be fixed ny removing one line, but MuseScore generates multiple errors when saving from MIDI files with more channels (these examples exceeded the 2 MB upload limit on upload). It would be impractical for users to hand-correct large files.

In reply to by Marc Sabatella

Turned on the computer today and set about generating the example, but I was unable to reproduce the error with the same MIDI file I was using or with other files. In all cases, MuseScore saved and recovered files I created with Speedy MIDI correctly. Must have been the barometric pressure. I apologize for the false alarm. Is there a procedure to remove my report from the forum?

Thanks.

I'm seeing this behavior too, I received some midi files that contain xml-like information in the lyrics.

I think the problem is in impormidi_lyrics.cpp::addLyricsToScore. That function calls score->addLyrics with the text as extracted from the midi file, without escaping any XML. Calling .toHtmlEscaped on the QString before passing it to addLyrics will fix the crashes. But now our lyrics contain all kinds of crappy semi-xml control information from Speedy MIDI. We'll need to figure out a way to filter this information without being to restrictive.

I can create a PR with the proposed change, so the problematic lyrics can be removed from within MuseScore instead of hand-editing the XML-file.

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