-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I've tried to run the MusescoreXML (mscx) to MusicXML (musicxml) conversion from this repo with MuseScore 4 and for a small percentage of the pieces, MuseScore 4 crashes with the following rather cryptic exception:
[70154:1327906:20230413,091641.168260:WARNING crash_report_exception_handler.cc:240] UniversalExceptionRaise: (os/kern) failure (5)
Given the nature of the batch-processing of the conversion script, which stops when the first conversion fails, I wasn't able to identify which pieces cause the issues, so I rewrote the script to this:
import argparse
import subprocess
from pathlib import Path
from tqdm import tqdm
def convert(
musescore_xml_path: Path,
musicxml_path: Path,
# This is the path where MuseScore 4 executable is located on my MacOS machine and will be different for other OS installations
musescore_command="/Applications/MuseScore 4.app/Contents/MacOS/mscore"
):
convert_comand = f'"{musescore_command}" -o "{str(musicxml_path.absolute())}" "' \
f'{str(musescore_xml_path.absolute())}"'
process = subprocess.run(convert_comand, stderr=subprocess.PIPE, text=True, shell=True)
if not musicxml_path.exists():
print("Failed to convert: " + str(musescore_xml_path) + "\n" + process.stderr)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Converts a directory of MuseScoreXML files to MusicXML using '
'MuseScore'
)
parser.add_argument('-i', '--input_directory', default="scores", help='The input directory')
parser.add_argument('-o', '--output_directory', default="scores", help='The output directory')
args = parser.parse_args()
input_directory = Path(args.input_directory)
output_directory = Path(args.output_directory)
all_musicxml_files = list(input_directory.rglob("*.mscx"))
for musescore_xml_path in tqdm(all_musicxml_files, desc="Converting MuseScoreXML to MusicXML"):
musicxml_path = (output_directory / musescore_xml_path.relative_to(input_directory)).with_suffix(".musicxml")
if musicxml_path.exists():
continue
convert(musescore_xml_path, musicxml_path)which skips pieces that have already been converted and runs the conversion per file (be aware that this kind of blocks your computer because of opening and closing of musescore for each file).
The list of affected files is as follows:
scores/Reichardt,_Louise/12_Deutsche_und_Italiänische_Romantische_Gesänge/01_Frühlingslied/lc5067312.mscx
scores/Reichardt,_Louise/12_Deutsche_und_Italiänische_Romantische_Gesänge/02_Wenn_ich_ihn_nur_habe/lc5100067.mscx
scores/Reichardt,_Louise/12_Deutsche_und_Italiänische_Romantische_Gesänge/04_Wohl_dem_Mann/lc5100073.mscx
scores/Reichardt,_Louise/12_Deutsche_und_Italiänische_Romantische_Gesänge/12_Heymdal_(aus_Ariels_Offenbarungen)/lc5101826.mscx
scores/Reichardt,_Louise/6_Lieder_von_Novalis,_Op.4/3a_Geistliches_Lied/lc5092560.mscx
scores/Reichardt,_Louise/6_Lieder_von_Novalis,_Op.4/5_Noch_ein_Bergmannslied/lc5092612.mscx
scores/Reichardt,_Louise/12_Gesänge/03_Nach_Sevilla/lc5046249.mscx
scores/Reichardt,_Louise/12_Gesänge/01_Erinnrung_zum_Bach/lc5087917.mscx
scores/Reichardt,_Louise/12_Gesänge/07_Volkslied/lc5001925.mscx
scores/Reichardt,_Louise/12_Gesänge/05_Für_die_Laute_componirt/lc5001880.mscx
scores/Reichardt,_Louise/12_Gesänge/09_Der_Spinnerin_Nachtlied/lc5001937.mscx
scores/Reichardt,_Louise/12_Gesänge/02_Der_Sänger_geht/lc5002130.mscx
scores/Reichardt,_Louise/12_Gesänge/04_Vaters_Klage/lc5001870.mscx
scores/Reichardt,_Louise/12_Gesänge/08_Ein_recht_Gemüth/lc5001930.mscx
scores/Reichardt,_Louise/12_Gesänge/10_Die_Veilchen/lc5087944.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/07_Die_Wiese/lc5046362.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/01_Frühlingsblumen/lc5001965.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/03_Die_Blume_der_Blumen/lc5001980.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/08_Kaeuzlein/lc5002015.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/05_Betteley_der_Vögel/lc5001997.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/10_Der_Mond/lc5061932.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/04_Wachtelwacht/lc5001994.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/02_Der_traurige_Wanderer/lc5061310.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/06_Kriegslied_des_Mays/lc5002006.mscx
scores/Reichardt,_Louise/12_Gesänge,_Op.3/09_Hier_liegt_ein_Spielmann_begraben/lc5002019.mscx
scores/Schubert,_Franz/Die_schöne_Müllerin,_D.795/09_Des_Müllers_Blumen/lc4985932.mscx
MuseScore 4 reliably crashes with these files, I'm attaching one here as an example:
09_Der_Spinnerin_Nachtlied.zip
Those files were able to be opened with MuseScore 3, so it might be a bug in MuseScore 4. When opening with MuseScore 3, and saving the files again, it seems to correctly migrate the files and allows to open those files (at least the piece by Schubert was working like this).
Environment:
- macOS 13.3, Arch.: x86_64, MuseScore version (64-bit): 4.0.2-230651546, revision: github-musescore-musescore-dbe7c6d