The "Beat/Music Detection" code you have always wanted

I plan to make a product using this code soon and decided to take it down, sorry. I hope everyone who got a chance to try out the code enjoyed it.

Nice work. :slight_smile:
A ruff schematic of the input side would be nice. I guess my electronic skills need work :~ I have been trying to get audio from LM386’s into my nano and have had some trouble.
Thanks,
BEAN

Hi, we are new in the forum, so hi everybody!
We are doing a project with an arduino and sound detection. So we would like to know which is the maximum frequency of data adquisition by the analogic input.
After doing some experiments we have scored 8333 Hz. Is that correct?
Thank you!

Thanks for taking the time to post the schematic. It addressed the problem I was having. Just means I have to keep working at it
Thanks again,
BEAN

Hi,
do you know if i could do the same thing --> control led lights using a playlist of say 3 songs in max/msp and then sending it to arduino to change the led colors?

Unfortunately not actually beat detection, I was kinda hoping for some true 'beat detection' code which is extremely difficult.

Nice work none the less :slight_smile:

Mowcius

hapoo:
Hi,
do you know if i could do the same thing --> control led lights using a playlist of say 3 songs in max/msp and then sending it to arduino to change the led colors?

I'm not familiar with max/msp, I just got Arduino 2 weeks ago. Any analog signal will work with this program regardless of the source. To get bass isolated you would still need to create a filter before the signal is put into the Arduino since the code only performs actions based on amplitude and doesn't do any filtering. I looked up max/msp and plan to mess with it in the near future so if you still have trouble I may be of more assistance later.

mowcius:
Unfortunately not actually beat detection, I was kinda hoping for some true 'beat detection' code which is extremely difficult.

Yes, but I couldn't think of any good reason to actually detect the beat pattern of music, if you want to play different songs or very dynamic music a program that detected beats would not be very useful. This program allows for rapid change in music intensity and rhythm and will still perform actions based on the bass hits as long as you have a halfway decent filter.

I can add a few lines of code to estimate BPM if you were looking for something like that. If you have an awesome project idea that requires being able to estimate the upcoming beats in music before they are played then you can let me know and maybe it will inspire me to take up the coding challenge, for the projects I have in mind though this is all I need.

I can add a few lines of code to estimate BPM if you were looking for something like that.

The main issue is that the estimated BMP changes during the song. Hmm - Perhaps the whole song can be analysed and then the bpm worked out after it has finished. That sounds like an interesting project to me :slight_smile:

I'm using an rMP3 board for my audio stuff (which will analyse the frequencies of the audio you are playing - so you can do visualisers) so I can also easily tell when the song has finished. Unfortunately my projects meter is already full so I don't think I want to try this right at the mo :stuck_out_tongue:

Btw, Rogue Robotics are currently doing a compo where you can win an rMP3 - see http://arduino.cc/forum/index.php/topic,50016.0.html

Mowcius

Arduinoid:
I did a little research into measuring tempo, aka BPM, and found it to be a very non exact science.

Indeed - that's the issue :smiley:

Hey very cool! And nice video :slight_smile:

I'm new to the Arduino world - and have been working on the exact same type of project (the implementation is a bit different, however). Here's my video:

You can see some pictures of the shield I built (and more instructions to follow) here:
http://majordecibel.blogspot.com/

Hey Arduinoid, did you ever get around to scribbling down the schematic for this circuit?
Would love to include it in my current project.

Thanks

Hi,
Is it possible that you can post schematics?
I like your project to do some christmas lights-
Thanks
Bye
Michael
Venezuela

Great project! (oh, over 1000 views?!) :astonished:

Wk

@Diebor - You can sample faster than you can process or send the data. It sounds good at 40K samples / sec.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1208715493/11

The only use I can see for this is to oversample and average ever pair of samples.
This way you can avoid using a hardware Nyquist filter at lower sample rates.

I made a cool light show with the MSGEQ7 chip and 4 LED's.
Also works with El wire.

See this post for pseudocode:
http://arduino.cc/forum/index.php/topic,77572.0.html

Hi,
Great code, just what I was looking for, however I could do with some help with wiring the pre amp circuit.
I currently have two audio inputs, switched using a relay, and two audio outputs, also witched using a relay, whilst the audio is going between the two relays is where I want to get the sampling signal from, can I just connect the inputs to the op amps to here?
Thanks,
Dan

Is it possible to use an LM358 and +5V power supply instead?

majordecibel:
...

You can see some pictures of the shield I built (and more instructions to follow) here:
http://majordecibel.blogspot.com/

could you invite me please, it seams your blog is not open to anybody.
thank you.

I can't send private messages, forum aparently broken :smiley:

I want to build a unicorn-on-a-stick for the next festival that shoots beat-synced lasers from it's eyes :slight_smile:

Is there any chance one could send me the code via eMail, I promise I wont build anything commercial with it :): lulzufail@gmail.com

thanks in advance and best wishes from Germany!

Veit

how can i get the code? it would have been to so much help for me.
this is just the thing i have been looking for! :slight_smile: :slight_smile: