diff --git a/README.md b/README.md index 8fd7b67..30a3c0b 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,11 @@ To evaluate a time-aligned transcription and ground truth: ### Other File Formats #### MusicXML +There is now a bash script that will perform this evaluation in one command: `evaluate_xml.bash gt.xml transcription.xml` + +It automatically removes all of the intermediate files as well. If you would like to save them, you can remove those lines +from the script, or perform the process manually with the following steps: + 1. Convert MusicXML into a text-based format: `./MusicXMLParser/MusicXMLToFmt1x gt.xml gt_xml.txt` (The C++ converter must be compiled first using `./compile.sh` in the `MusicXMLParser` directory.) diff --git a/evaluate_xml.bash b/evaluate_xml.bash new file mode 100755 index 0000000..970a412 --- /dev/null +++ b/evaluate_xml.bash @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 2 ]; then + echo "USAGE: evaluate.bash ref.xml transcription.xml" + exit 1 +fi + +./MusicXMLParser/MusicXMLToFmt1x $1 $1.txt +java -cp bin mv2h.tools.Converter -x <$1.txt >$1.conv.txt +rm $1.txt + +./MusicXMLParser/MusicXMLToFmt1x $2 $2.txt +java -cp bin mv2h.tools.Converter -x <$2.txt >$2.conv.txt +rm $2.txt + +java -cp bin mv2h.Main -g $1.conv.txt -t $2.conv.txt -a +rm $1.conv.txt $2.conv.txt