Skip to content

Instantly share code, notes, and snippets.

@Vaults
Last active July 13, 2023 07:20
Show Gist options
  • Save Vaults/335162c039eea88a023d25c1857fb358 to your computer and use it in GitHub Desktop.
Save Vaults/335162c039eea88a023d25c1857fb358 to your computer and use it in GitHub Desktop.
Musescore to Lilypond (.mszc to .ly)
#!/bin/bash
#./mszc-to-ly.sh musescore-file.mszc
# will output a corresponding lilypond file with the same name in the same folder
MUSESCORE="<path to musescore>"
FILE=$1
FILE_BASE=$(echo $FILE | sed 's/.mscz//')
LILY_FILE="$FILE_BASE.ly"
MUSICXML_OUTPUT=/tmp/tmp.musicxml
$MUSESCORE "$FILE" -o "$MUSICXML_OUTPUT"
echo "$(pwd)/$LILY_FILE"
musicxml2ly "$MUSICXML_OUTPUT" -o "$LILY_FILE"
rm $MUSICXML_OUTPUT
sed -i.bak "s/\(\\\stemUp\|\\\stemDown\)//g" "$LILY_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment