We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › BPM detection with Minim
Page Index Toggle Pages: 1
BPM detection with Minim (Read 1204 times)
BPM detection with Minim
Oct 7th, 2009, 7:17pm
 
Hi everyone!
Im trying to determine the BPM of a song with Minim.
So far I've been using beatdetect on the frequency domain and it is very interesting. It's still very hard to get constant beats.
After googling around for a bit I realized what I probably need is to do the convolution of the sound signal (Its audioInput) with itself after a delay. Varying the delay should give different levels, and when the delay corresponds to the delay between beats the result should be maximum.
Anyways, I know I suck at explaining this.
Im wondering how I could take the sound signal and delay it. After that I know I'll run into a lot of trouble trying to calculate the convolution itself, but thats another story.
I read in the Minim website that delay and other effects are coming soon, but I was wondering if anybody knows of a way of delaying the signal manually, and specially as I have to delay it more than the buffer size.
Is this a lost cause?
Thanks in advance
Re: BPM detection with Minim
Reply #1 - Oct 8th, 2009, 2:13am
 
here is was i did with mimin.
this is an extract of a much bigger project and give more as a base of study rather than a complete tool.

basically i recoded the whole beatdetect myself. it's based on analysing the spectrum divided in logarithmic bands (12 per octave) As our ears are logarithmic, it would make no sense to use linear bands.

then for each band i compute a score which is based on the volume of the band compared to the band for the last X seconds. this allows me to detect attack. (our ear react to attack rather than volume).

the result of all the bands is then combined back into one global score.
each band can be enabled/disabled to focus on specific regions of the spectrum (works well to catch only the snare for instance)

in parallel i also compute an automatic adjusting parameter that will adapt itself to the "variability" of the music (the beatSense variable) so that we don't catch too many or too few "beats".
the sensivity of this detection can be adusted by altering beatSenseSense. (yeah i know, stupid name that is Smiley)

on the graphical user interface you'll see :
from top-left to down-right
-the current score slider (which turn red on beat)
-the current beatSense (the beat threashold if you wish)
-the big red beat indicator
-the sectrum displaying for each band :
  -level
  -average
  -score of the band


i hope this can help someone

http://motscousus.com/stuff/2008-02_Processing.org_patterns/test_beat.pde
Re: BPM detection with Minim
Reply #2 - Oct 8th, 2009, 5:55pm
 
Wow, that looks great! Im going to need some time to study all that, but its very interesting.
Thank you so much for your help.
Page Index Toggle Pages: 1