apmcleod / MV2H

An automatic, joint, quantitative metric for complete transcription of polyphonic music.
MIT License
16 stars 3 forks source link

MV2H

This is the code for the MV2H metric, originally proposed in my 2018 ISMIR paper.

If you use the metric, please cite it:

@inproceedings{McLeod:18a,
  title={Evaluating automatic polyphonic music transcription},
  author={McLeod, Andrew and Steedman, Mark},
  booktitle={International Society for Music Information Retrieval Conference (ISMIR)},
  year={2018},
  pages={42--49}
}

To compile the code, simply run make in the base directory.

Usage

Non-aligned Data

Use the -a flag to evaluate a non-time-aligned transcription:

Aligned Data

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 (if you have musescore3): evaluate_xml.bash gt.xml transcription.xml

You can also perform the process manually by first converting the MusicXML files into MIDI, and then following the instructions for MIDI files.

MIDI

  1. Convert a MIDI file into the MV2H format: java -cp bin mv2h.tools.Converter -m -i gt.mid -o gt_converted.txt -a INT can be used to set the anacrusis (pick-up bar) length to INT sub beats, in case it is not aligned correctly in the MIDI. Different parsed voices can be generated using --channel or --track. Default uses both.

  2. Evaluate with alignment using the -a flag: java -cp bin mv2h.Main -g gt_converted.txt -t transcription_converted.txt -a

Chord symbols will not be parsed.

Averaging Multiple Evaluations

To get the averages of many MV2H evaluations:

  1. Concatenate the evaluations into a single txt file: cat res*.txt >all_results.txt
  2. Use the -F flag: java -cp bin mv2h.Main -F <all_results.txt

Examples

The examples directory contains two example transcriptions of an ground truth. To perform evaluation, run the following commands and you should get the results shown:

File Format

The file format for reading a ground truth or transcription is text-based, and each line can be one of the following, and ordering of the lines does not matter:

For any duplicate times, only the last given chord, key, or hierarchy are saved. Duplicate tatums are ignored.

Python Version

Big thanks to @lucasmpaim for his work porting MV2H to python here.

The python version does run significantly slower at the moment, particularly on long pieces with inaccuracte transcriptions.

NOTE: The java version of MV2H should always be considered the canonical, "correct" version, and should be used for final evaluation of a system. However, I have no reason to believe that the python code has any problems with it, and we are working on writing tests to confirm this (see this issue).

Version History