This repository contains scripts to convert MuseScore files (.mscz and .mscx) to LilyPond format (.ly).
.mscz- MuseScore compressed format (fully supported ✅).mscx- MuseScore uncompressed XML format (fully supported ✅)- Output:
.ly- LilyPond notation files
Run the setup script to automatically configure everything:
./setup.shIf you prefer manual setup, you need to install:
-
Python 3.6+ with venv support
-
MuseScore (with command-line support)
- Ubuntu/Debian:
sudo apt install musescore3 - macOS:
brew install musescore - Windows: Download from musescore.org
- Ubuntu/Debian:
-
LilyPond (includes
musicxml2ly)- Ubuntu/Debian:
sudo apt install lilypond - macOS:
brew install lilypond - Windows: Download from lilypond.org
- Ubuntu/Debian:
-
Virtual Environment Setup
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
# Activate virtual environment first
source venv/bin/activate
# Check if everything is installed
python convert_musescore_to_lilypond.py --check-deps# Convert .mscz file to same directory
python convert_musescore_to_lilypond.py song.mscz
# Convert .mscx file to specific output directory
python convert_musescore_to_lilypond.py song.mscx output_folder/
# Works with both compressed (.mscz) and uncompressed (.mscx) formats# Convert all files in current directory
python convert_musescore_to_lilypond.py --batch . lilypond_output/
# Convert all files recursively
python convert_musescore_to_lilypond.py --batch --recursive . lilypond_output/# Convert all .mscz and .mscx files in the workspace
python batch_convert.pyThis will:
- Convert all MuseScore files in the root directory
- Convert all MuseScore files in the
files/directory - Save all LilyPond files to
lilypond_output/directory
The conversion process involves two steps:
- MuseScore → MusicXML: Uses MuseScore's command-line export feature
- MusicXML → LilyPond: Uses LilyPond's built-in
musicxml2lyconverter
runoviisid/
├── 1.mscz # Original MuseScore files
├── 2.mscz
├── files/
│ ├── 0001-r.mscx
│ └── ...
├── lilypond_output/ # Generated LilyPond files
│ ├── 1.ly
│ ├── 2.ly
│ └── files/
│ ├── 0001-r.ly
│ └── ...
├── convert_musescore_to_lilypond.py
├── batch_convert.py
└── README.md
- ✅ Batch conversion of multiple files
- ✅ Recursive directory scanning
- ✅ Automatic dependency checking
- ✅ Error handling and reporting
- ✅ Progress indicators
- ✅ Preserves directory structure
- ✅ Supports both
.msczand.mscxformats
- Make sure MuseScore is installed and accessible from command line
- Try running
mscore --versionormusescore --version
- Make sure LilyPond is installed
- Try running
musicxml2ly --version
- Check that the MuseScore file is not corrupted
- Ensure you have read permissions for input files
- Ensure you have write permissions for output directory
- The conversion preserves most musical information, but some MuseScore-specific formatting may be lost
- LilyPond files may need manual adjustment for optimal engraving
- Large files may take some time to convert
- The script uses temporary files which are automatically cleaned up