View Single Post
Old 3rd November 2012, 19:39   #216
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 860
Resonant beat detecion

Ok, here is the code for the resonant beat detection. Not much different from my previous postings but tuned and sanitised for general use. It is all in the per frame sections, you may use it in your own presets as you like.

It cannot do magic, but on music with a simple, clear and constant rhythm it performs very much better than earlier schemes. It will in general even keep the beat during announcements of the DJ, and is particularly well suited for club/techno live streams with an uninterrupted rhythm.

There are drawbacks, though:

(1) On a change of song with different rhythm, the algorithm will take a few seconds to fall into pace. Same as for you (I guess) on the dance floor.

(2) The algorithm may occasionally change between the single and double or even quadruple beat frequency. This is simply because a lot of music does contain multiples of the base beat, e.g. a slow bass drum and snares at double frequency. More complicates schemes may even carry 3/4, 6/4, 5/6 and many other multiples of the beat. To find out the basic rhythm would require quite more elaborate code. If you look over a dance floor, you will note that most humans do not understand complex rhythms either.

(3) Timing depends on a constant frame rate. Backgound processes that use up CPU time in irregular intervals and drop the frame rate, will disturb.

Currently the algorithm tends to fall into the fastest rhythm that exists in the music. This is on purpose, because it is much easier to make code to half the beat than to double it.
Attached Files
File Type: milk martin - resonant beat detection v1.milk (7.7 KB, 781 views)
Nitorami is offline   Reply With Quote