| No Comments | No TrackBacks
> Hello!
>
> I visited your computer graphics website and read about your music
> visualisation tools where you use beat detection. I have tried to find
> information about this but all I've found is hard-to-understand mathematics
> tutorials...
>
> If you have any tutorials (C#, VB, C...), links or other information that
> could help me in my beat detection project I would appreciate it a lot!
>
> Best regards from Sweden


Beat detection the way I did it was quite simple. In fact, I wouldn't really call it beat detection, it was more like cheating. There is no beat counting or rhythm prediction, it is all done in real-time. But heck, CG is all about cheating... :-)

From winamp you're given every "cycle" a buffer that contains the left and right channel spectrograph, or FFT of the current time slice from the music. This is the exact same data that winamp displays in it's main window.

At first, all I did was write a simple plugin that displays the spectrograph in 3D. I wasted many hours in awe of my silly creation, studying the way the spectrograph behaved with different music.

After a while I noticed that with hip hop and most techno the beat is really apparent in the lower 2-6 bars of the spectrograph from winamp. I guess in hard-to-understand mathematics they would say that a band-pass filter on the FFT from 10Hz-50Hz would isolate the beat frequencies. All I did was snag this from winamp's buffer.

Now that I had the bass frequencies as regular integers from winamp, I just spent a lot of time experimenting with different methods of averaging their values and incrementing a counter based on this average. When the counter reached a certain point I made the conclusion that I was in a "beat" and told the graphics engine to display... whatever it pleased. Once the average died down I decremented the counter and informed the graphics engine. That's about all there is to it. The trick is in where you pick the cut off points for "in a beat" and "out of a beat".

So if you want to do this yourself w/out winamp you'll need to borrow a discrete FFT algorithm from somewhere. Otherise, winamp does 90% of the hard work for you, you just need to play with the numbers till you get something that looks right. :-)

Best of luck, show me the results when you're done! :-)

No TrackBacks

TrackBack URL:

Leave a comment

Myself

Projects

Monthly Archives

Photos

About this Entry

This page contains a single entry by Robert W. Rose published on July 25, 2003 8:49 AM.

was the previous entry in this blog.

is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.