Bug reading mscx and mscz files
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
I can load this file with both v2.02 and the latest nightly, not error messages.
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 On ubuntu 15.10, using a 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 Thanks for your reply. It by DoctorStan
Seems likely the problem is something specific to the MIDI file you imported. Can you post that MIDI file and then the precise steps to reproduce the problem from there (if it is is anything more than just opening the MIDI then saving).
In reply to Seems likely the problem is 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.
In reply to Turned on the computer today by DoctorStan
No way to remove it, but it's good to keep a record that it did happen once, in case it ever happens again.
In reply to No way to remove it, but it's by Marc Sabatella
I'm thinking it might be interesting to see the working MSCX file as well, for comparison to see what's different.
In reply to I'm thinking it might be by schepers
Sorry to take awhile, but I had trouble regenerating the error. Seems to be associated with a setting in Speedy MIDI that I must have changed. I found an older MuseScore file (attached) that demonstrates the error.
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.
In reply to I'm seeing this behavior too, by d.dewit
PR: https://github.com/musescore/MuseScore/pull/2964