PDA

View Full Version : How to detect BPM of the song by programming




vavdiyaharesh
Mar 16, 2009, 12:03 AM
Hi,

In my application, i have to detect all the songs and BPM og those songs. Detect the songs are finished now i have to detect BPM of songs.


Does anyone tell me that how can i detect BPM of each song by programming in Cocoa.

Thanks,
Haresh.



ChrisA
Mar 16, 2009, 12:35 AM
Hi,

In my application, i have to detect all the songs and BPM og those songs. Detect the songs are finished now i have to .


Does anyone tell me that how can i detect BPM of each song by programming in Cocoa.

Thanks,
Haresh.

You have picked a hard problem. One that no one yet has solved completely. If you do this well you will be the first to do so.

OK here is what you have to do. Stop thinking about programming and cocoa. How would YOU figure it out your self without a computer. Let's say you found a person who somehow had never heard music of any kind how would you tell him to find the BPM. Write down those instructions in detail.

Good now you have about 10 or 20 steps all you have to do is write software for each of those steps.

What you have shown by your question is that in order to write a non-trivial program yo need to know a lot about no only programming but the subject area too. For example how would you write an airplane flight simulator. You'd need to understand about the physics of flight and many other subjects. In your case you are going to have to learn about music and signal processing. Programming is the easy part.

AUFan
Mar 16, 2009, 10:46 AM
I will preface this comment by stating I have absolutely no experience with analyzing music via electronic devices or otherwise. ;)

Perhaps you should look into counting drum beats per minute since they usually set the beat/pace for the song--however if the song doesn't use drums it might work so well. Besides counting drum beats, your other best bet might be to see what mathematical analysis has been done and if there are any existing algorithms that perform a similar function.

lazydog
Mar 16, 2009, 10:52 AM
Hi

I've never done anything like this before but I was wondering if a low pass filter feeding a number of narrow band pass filters covering the range of bpm would do the trick. Pick the bpm of the filter with the highest output.

b e n

Consultant
Mar 16, 2009, 11:29 AM
A number of DJing software does it, some have component that allows users to tap the beats for BPM calculations.

GorillaPaws
Mar 16, 2009, 11:57 AM
...some have component that allows users to tap the beats for BPM calculations.

I think this kind of thing would be the easiest implementation by far from a programming standpoint. Clearly it's less optimal for the user than having the computer calculate it in the background, but it's going to be more accurate and won't have any of the issues of handling songs without a strong rhythmic bass/drum line (like a cappella singing for example). Of course if your user is anything like Steve Martin's character in "The Jerk" you may have problems :D.

AUFan
Mar 17, 2009, 08:25 AM
A number of DJing software does it, some have component that allows users to tap the beats for BPM calculations.

I think the only problem with this would be that it probably relies on having some sort of strong drum/baseline to set the beat for the song if it's anything like some of the DJ's I've run across recently.

I've never done anything like this before but I was wondering if a low pass filter feeding a number of narrow band pass filters covering the range of bpm would do the trick. Pick the bpm of the filter with the highest output.


Or perhaps in a similar vein, try and seperate the different sources (vocals, instruments etc.) and then have the program look for the graph/audio range with the most consistent and constant beat -- even accapella has one. Might this be possible with something like Core Audio or OpenAL?