This software aligns performances from the ACoRD - Aligned Continuo Realization Dataset with their respective scores. The program is written in Python, but uses external modules written in C++ (Nakamura, 2017).
The performances are in the Performances directory and the scores in the Scores directory in the dataset. Take the MusicXML score files from the dataset. Directories with the scores and the performances should be copied to root from with the code runs. The software processes the whole Performances directory with its full structure, but the scores have to be put directly to the Scores directory in the root.
Before running the code, install requirements from the requirements.txt file. Make sure that all packages are installed correctly, for reference, see Partitura, Parangonar and Matchmaker websites.
The programs pipeline consitst of two parts:
- basso continuo performance alignment
- evaluation of the alignment
Dataset alignment is done by the file align_dataset.py. It uses the Dataloader object to load the performances, the scores and map each performance to the score with the played basso continuo line. The loaded dataset continuo_dataset can be preprocessed using different preprocessing techniques:
- score preprocessing
BassLineExtractoris mandatory, as it chooses the basso continuo staff from the score containing multiple staves. - One of two performance preprocessing methods can be used:
PerformanceToScoreRangeTrimmer(optional parametertolerance, otherwise set to 0 by default) orPerformanceInvertedSkyline. The preprocessing methods are created an called as in the following example:
inverted_skyline_preprocessor = pp.PerformanceInvertedSkyline()
inverted_skyline_dataset = inverted_skyline_preprocessor(preprocessed_score_dataset)
-
Preprocessed datasets are then inputs to four bass alignment methods, each having its own wrapper:
BassAlignmentWrapperDTW,BassAlignmentWrapperHMM,BassAlignmentWrapperNakamuraHMM,BassAlignmentWrapperGlue. They can be called on the preprocessed datasets. Three methods use Python packages (installed from requirements), but for Merged-output HMM by Nakamura et al. (2017), make sure that thenakamura_alignment_wrapperis loaded correctly, as it is a C++ tool with a Python wrapper. These methods create each analignmentlist, containing dictionaries with one of three alignment labelsmatch,insertion,deletion. Each of these alignment dictionaries can then be used one at a time assupplementary_alignmentin point 5. -
An
AlignedDataset(alignment_name, dataset, alignment)object is created and stored toCSVfiles, which can be used in `Parangonar. -
Similarly to points 3 and 4,
PositionBasedRealizationAlignmentWrappercan be called to do the full realization alignment and save it as aligned dataset. Only allowed preprocessing of dataset here is score preprocessing, as performance preprocessings cut out notes that are required for full realization alignment. However, supplementary alignment from step 3 must be chosen to perform the full realization alignment.
Evaluation is in the file evaluate_dataset_alignment.py. In the code, correct alignment and ground truth alignment (from ACoRD) directories have to be chosen. Each of the three labels (match, insertion, deletion) is tested independently, therefore this has to be chosen before the test as well. The code produces CSV files with precision, recall and F1-score for each file and summaries for the whole label alignment.