[aubio-user] Onset detection in Python

Lukasz Tracewski lukasz.tracewski at outlook.com
Mon Mar 17 22:13:22 CET 2014


Hi,

I am using 0.4.1 release of aubio to do onset detection on monaural audio that is already in computer's memory. In essence, I am loading a WAVE file with scipy, doing some essential filtering and only then performing onset detection. What would be the best way? 

Here is what I have:



        onset_detector = onset("energy", window_size, hop_size, sample_rate)
        onsets = []


        windowed_sample = numpy.array_split(sample, numpy.arange(hop_size, len(sample), hop_size))
        for frame in windowed_sample:
            if onset_detector(frame):
                onsets.append(onset_detector.get_last())

So in fact it simulates reading file from a disc, following what is in examples. One of problems I have with this approach is that I am always detecting onset at zero. Is there a smarter solution? 

Thanks for the great work!

Cheers,Lucas
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aubio.org/pipermail/aubio-user/attachments/20140317/15f402e9/attachment.html>


More information about the aubio-user mailing list