This script contains an implementation of the algorithm proposed in "Multiple scale music segmentation using rhythm, timbre, and harmony" by Kristoffer Jensen for music segmentation (boundary detection). It uses numpy and scipy to compute the boundaries as the shortest path of a graph whose adjacency matrix is computed from the self-similarity matrix.
The script follows the grammar used in the Music Structure Analysis Framework by Oriol Nieto.
The script can be simply copied in the folder in which you need it, or its directory can be added in the Python path.
The script has a main function segment
that can be called with any matrix of features:
from JensenSegmenter import segment
F= #some feature extraction method
est_idxs, _=segment(F)
The result est_idxs
can be used with the mir_eval framework for evaluation.
- Python 3.x
- Numpy
- Scipy
Jensen, K., (2007). Multiple scale music segmentation using rhythm, timbre, and harmony. In EURASIP Journal on Advances in
Created by Michele Buccoli ([email protected]).