I want to cut a song into several segments, any suggestion?

527 views
Skip to first unread message

陈杰

unread,
Mar 16, 2017, 8:15:45 AM3/16/17
to librosa

Hey guys:
     
        Give me a song or music, I want the program can cut it into several segments automatically.
      
       In this case, beats and onsets are too low-level units, so I think the structural analysis function like "segment.recurrence_matrix"  can find those special cut points for me.

       So my question is, if I can use the functions like recurrence_matrix and recurrence_to_lag to get the lag matrix, how can I understand the matrix and translate it to the meaningful cut points.

       Thanks for your help.

Brian McFee

unread,
Mar 16, 2017, 1:22:57 PM3/16/17
to librosa
What you need for this is a segmentation algorithm.  Librosa provides the tools to build one, but it does not provide a segmenter out of the box.

The example gallery includes a full implementation of the laplacian structure decomposition method: https://librosa.github.io/librosa_gallery/auto_examples/plot_segmentation.html

You might also check out MSAF, which implements a variety of segmentation methods: https://pythonhosted.org/msaf/

Once you have the cut points, librosa.effects.remix() can be used to carve out the audio buffers aligned to the nearest zero-crossings to the cut points.
Reply all
Reply to author
Forward
0 new messages