This package contains the implementation of the algorithm for identifying repeated harmonic patterns in music and structure segmentation described in . It is primarily written in Python but calls Matlab for feature extraction and performance evaluation.
Included is Dan Ellis’ beat-synchronous chroma feature extraction code, also available from: http://labrosa.ee.columbia.edu/projects/coversongs/. Also useful (but not included) is Dan’s code for resynthesizing chroma.
All code in this package is distributed under the terms of the GNU General Public License. See the file COPYING for details.
You can also clone the project with Git by running:
$ git clone git://github.com/ronw/siplca-segmentation
>>> import segmenter >>> wavfile = '/path/to/come_together.wav' >>> rank = 4 # rank corresponds to the number of segments >>> win = 60 # win controls the length of each chroma pattern >>> niter = 200 # number of iterations to perform >>> np.random.seed(123) # Make this reproduceable >>> labels = segmenter.segment_wavfile(wavfile, win=win, rank=rank, ... niter=niter, plotiter=10) INFO:plca:Iteration 0: divergence = 10.065992 INFO:plca:Iteration 50: divergence = 9.468196 INFO:plca:Iteration 100: divergence = 9.421632 INFO:plca:Iteration 150: divergence = 9.409279 INFO:root:Iteration 199: final divergence = 9.404961 INFO:segmenter:Removing 2 segments shorter than 32 frames
>>> print labels 0.0000 21.7480 segment0 21.7480 37.7640 segment1 37.7640 55.1000 segment0 55.1000 76.1440 segment1 76.1440 95.1640 segment0 95.1640 121.2360 segment1 121.2360 158.5360 segment2 158.5360 180.8520 segment1 180.8520 196.5840 segment0 196.5840 255.8160 segment3
This material is based upon work supported by the NSF (grant IIS-0844654) and by the IMLS (grant LG-06-08-0073-08).
2010-05-27 Ron Weiss <firstname.lastname@example.org>