Can't export musicxml file to midi via mscore command line on OSX Catalina
I'm presuming the issue is I'm missing something from the musicxml file, but I can't seem to figure out what. There doesn't seem to be any issue rendering this to mp3 or pdf with the same file. Here's the output I get. Attached is the musicxml file.
/Applications/MuseScore\ 3.app/Contents/MacOS/mscore -o test.midi test.musicxml
convert ...
importMusicXml() file 'test.musicxml' is not a valid MusicXML file
Error at line 52 col 9: calculated duration invalid, using specified duration
Error at line 60 col 9: calculated duration invalid, using specified duration
Error at line 68 col 9: calculated duration invalid, using specified duration
Error at line 76 col 9: calculated duration invalid, using specified duration
Error at line 91 col 9: calculated duration invalid, using specified duration
Error at line 99 col 9: calculated duration invalid, using specified duration
Error at line 107 col 9: calculated duration invalid, using specified duration
Error at line 115 col 9: calculated duration invalid, using specified duration
Error at line 130 col 9: calculated duration invalid, using specified duration
Error at line 138 col 9: calculated duration invalid, using specified duration
Error at line 146 col 9: calculated duration invalid, using specified duration
Error at line 154 col 9: calculated duration invalid, using specified duration
Error at line 169 col 9: calculated duration invalid, using specified duration
Error at line 177 col 9: calculated duration invalid, using specified duration
Error at line 185 col 9: calculated duration invalid, using specified duration
Error at line 193 col 9: calculated duration invalid, using specified duration
Error at line 52 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 60 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 68 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 76 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 91 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 99 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 107 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 115 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 130 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 138 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 146 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 154 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 169 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 177 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 185 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
Error at line 193 col 9: calculated duration invalid, using specified duration
TDuration::setType(): unknown, assume "quarter"
to
... failed!
Attachment | Size |
---|---|
test.musicxml | 4.74 KB |
Comments
The MusicXML file is indeed invalid:
- root-step must be spelled capital C
- for all notes:
- note type is missing (duration 1 and divisions 1 implies duration is quarter)
- element order is incorrect (correct is: pitch, duration, voice, type, staff
In reply to The MusicXML file is indeed… by Leon Vinken
Thank you! That fixes the problem.
In reply to Thank you! That fixes the… by kianwilcox
Perhaps I spoke too soon. It appears to fix it for small progressions, but larger ones still seem to be running into the same issue. If i manually load the file in MuseScore and tell it to try to import it anyway, it succeeds in getting exactly what I was aiming for. Is there a way to do something similar via command line?
In reply to Perhaps I spoke too soon. It… by kianwilcox
Adding the
-f
(or--force
) option might work. If not, it should be made to work, by settingcanIgnore
in the MusicXML importer.Hmm, seems it does that in
converterMode
(i.e. when using the-o
option) already:But see further down, you've just been using the converter mode wrongly...
In reply to Adding the -f (or --force)… by Jojo-Schmitz
Switching the name to .mid instead of midi fixed it. Thank you for your help!
Try with this one
No explanation though why it converts to MP3 or PDF?!?
In reply to Try with this one by Jojo-Schmitz
Just for my own education, is this a Mac thing? I was able to open the the original file and export to midi in Windows.
In reply to Just for my own education,… by bobjp
The xml import gave a warning on Windows, ignoring that worked though
In reply to The xml import gave a… by Jojo-Schmitz
Agreed. Same thing for me. Hence my question. Just wondering.
In reply to Try with this one by Jojo-Schmitz
Oddly enough this seems to be still giving the same problem, claiming it is not a valid musicxml file? I tried the recommendation above, and while it worked for a small progression, I appear to have the same problem when going for the full file.
In reply to Oddly enough this seems to… by kianwilcox
So just make sure to create a valid MusicXML file
Try
I.e. drop the trailing "i" from ".midi"
The error is about an unknown file type, that
doConvert()
method doesn't know about ".midi", just ".mid"Very well explains why it works for ".mp3" and ".pdf" ;-)
See also https://github.com/musescore/MuseScore/pull/5936 which fixes this by allowing ".midi" and giving an error message about otherwise unknown file types
Fixed in the next development build and in 3.5
In reply to Try /Applications/MuseScore… by Jojo-Schmitz
This indeed fixed it. Thank you so much!