Okay so, after many months of study and tinkering, writing and re-writing code I finally made a working(at least with version 22)(see my last post I uploaded the library and my code that works with IDE 1.6) beat detection program it takes 10 seconds to get a rough beat and then starts honing in after 20 more seconds if I remember correctly... it's been a while since I messed with it. I found a much cooler solution to my problem and no longer need this code, but I put the absolute peak of my focus and effort into it for many months so it seems a waste to not share it.
be nice to me I'm not a programmer and I only had one class of java in college. but I know enough to know that it's sloppy, not very well documented and downright confusing at some parts. for example, I start using some weird variables like "fruit" or "Fruity" my brain was fried and I needed a variable with a unique name... sorry. Despite all this I'll do my best to answer any questions.
keep in mind that beat detection is hard enough to do for a person and their instincts let alone to define it in an algorithm but this is still fun to see it respond to faster or slower beats even though it might be off a little (it's not as good as we all hope it was.) sometimes its dead on though.
when I started this project I knew nothing of Arduinos or micro controllers for that matter, but after lurking 100% (out of fear of angering grumpy Arduino community members) I learned a lot. in fact I feel that everyone needs to try and figure things out without making things a problem for someone else or at least until you are really stuck.
I still don't feel like I belong posting anything on here cause I don't know very much. but I wanted to contribute this so here it is
oh and this is actually a two Arduino project, one for detecting the BPM and one for controlling animations on an 8X8 RGB LED matrix. if anyone is interested in the animation side of this project I'll post it in the appropriate section and add a link to it in this post.
I fully intended on cleaning up this code and making it pretty and easy to understand but I am busy with other projects, a three year old, job, new business and life in general so this is what you get, sorry.
some things you'll need besides my code:
SimpleTimer library
you will also need this web site as reference as to how to hook up the MSGEQ7 chip for audio data input: