This toolbox is used to evaluate the custom implementation of the Mongeau-Sankoff-Measure for melodic similarity implemented in the musicjson-toolbox. It contains functions to convert songs of the essen folksong collection in **kern format to midi or xml, and from xml to json.
The scores aren't included, but are available from KernScores.
The two implemented algorithms calculate similarity scores between songsheets based on Mongeau-Sankoff-Measure. The MelodyShape-Implementation of 2015-ShapeH is used from Julian Urbano [1].
Generate xml or midi from **kern format:
python bin/convert.py kern/czech midi/czech --midi
python bin/convert.py kern/czech xml/czech --xml
Generate json from xml:
node bin/convert.js path/to/xml path/to/json
MelodyShape:
# Usage:
python bin/similarity.py <algorithm> <collection> <queries> <output> [-c <cutoff>]
# Example: 2015-ShapeH with demo collection
python bin/similarity.py 2015-shapeh collection/midi/ query/midi result/data/2015-shapeh.csv
Mongeau-Sankoff:
# Usage:
node bin/similarity.js <algorithm> <collection> <queries> <output> [-c <cutoff>] [-k <value> [-k <value> [-k <value>]]]
# Example
node bin/similarity.js ms collection/json/ query/json result/data/ms.csv
node bin/similarity.js gar collection/json/ query/json result/data/gar.csv
ms
is using original Mongeau-Sankoff-Measure [2], where gar
is using the adjusted version by [3].
Use cutoff (only retrieve N-top documents for a query:
# Usage:
python bin/similarity.py <algorithm> <collection> <queries> <output> -c <cutoff>
node bin/similarity.js <algorithm> <collection> <queries> <output> -c <cutoff>
# Example
python bin/similarity.py 2015-shapeh collection/midi/ query/midi result/data/2015-shapeh.csv -c 10
node bin/similarity.js ms collection/json/ query/json result/data/ms.csv -c 10
node bin/similarity.js gar collection/json/ query/json result/data/gar.csv -c 10
Use k parameters for adjustment.
ms
only uses one parameter,
gar
is currently only using k1
and k3
but k2
is included for future consistency:
# Usage:
node bin/similarity.js <algorithm> <collection> <queries> <output> -k <value> -k <value> -k <value>
# Example
node bin/similarity.js ms collection/json/ query/json result/data/ms.csv -k 0.1
node bin/similarity.js gar collection/json/ query/json result/data/gar.csv -k 0.1 -k 0.2 -k 0.3
[1] Urbano, J. (2015). MelodyShape at MIREX 2015 Symbolic Melodic Similarity. In 11th Music Information Retrieval Evaluation eXchange (MIREX 2015). Retrieved from http://www.music-ir.org/mirex/abstracts/2015/JU1.pdf
[2] Mongeau, M., & Sankoff, D. (1990). Comparison of musical sequences. Computers and the Humanities, 24(3), 161–175. Retrieved from http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.666.2716&rep=rep1&type=pdf
[3] Gómez, C., Abad-Mota, S., & Ruckhaus, E. (2007). An Analysis of the Mongeau-Sankoff Algorithm for Music Information Retrieval. Proceedings of the 8th International Conference on Music Information Retrieval (ISMIR), 109–110. Retrieved from http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.133.5044&rep=rep1&type=pdf