Arduino and Sound
October 14th, 2008. Filed under: arduino, hardware, processing.I modified another old Processing program of mine to graphically react to sound using the Minim library. The program outputs the sound level to an Arduino connected to a breadboard, creating a sound level meter using LEDs. The code is a bit sloppy (and uncommented!) as I quickly tried to prototype these ideas:
October 15th, 2008 at 5:17 pm
cool…one neat thing about the minim library (if you don’t know already) is that you can do FFT analysis and then average on a log scale…it could be nice to have each LED illuminate based on the amplitude of a specific band of frequencies.
you could also use PWM (analogWrite) to vary the brightness of the LEDs, too.
nice progress!
October 15th, 2008 at 6:12 pm
good ideas rob. i’ve only done some cursory reading on FFT analysis and PWM, but i’m excited about implementing them.
November 13th, 2008 at 8:03 am
[…] More about Visualizing sound with an Arduino […]
November 13th, 2008 at 8:46 am
[…] More about Visualizing sound with an Arduino […]
November 13th, 2008 at 9:45 am
I’ve been goofing off with this same stuff lately (the Minim library and FFT analysis). The problem I’ve running into is that something like lighting up an LED will be darn close to realtime, but displaying a sketch will be off by a small amount. For recordings this is easy to combat, simply read the file into a buffer without playing it, then based on each sample write out a frame, of course you have to put it all together with some other piece of software later, which is kinda lame. For live work I’ve been using MIDI to control the visuals
Very cool work though, I haven’t tried with the actually Arduino board yet, just working with processing thus far…
November 14th, 2008 at 9:03 am
@gmuller I’ve noticed this as well. I thought it was due to my computer being too slow, but I’m not convinced. If you find a way to improve the latency, I’d love to hear about it.
November 20th, 2008 at 11:27 pm
[…] the Minim library for working with audio, inspired by a link on someone’s Twitter feed to someone else’s experiment with Minim and an Arduino. I’ve cleaned up and reformatted his code in my own fetishistic manner, and now I’m […]
April 9th, 2009 at 5:25 am
[…] http://nicklally.com/?p=330 […]
October 12th, 2009 at 2:54 pm
So I tried getting the arduino to react to music. It doesn’t want to for some reason. Is it just any music player or some special program on your computer that would have it react? I’m working on a project for my electronics class and this is the code that would make my project actually do what I want it to but for some reason it doesn’t react… Anything I can do?
October 12th, 2009 at 4:49 pm
No special player, just the code for both Processing and Arduino running together. It is using the internal mic in my computer, so you might check that the volume on it is turned up.
Are you seeing the Processing program react to sound and not the Arduino? I would need more details to troubleshoot your problem.
October 14th, 2009 at 1:07 pm
Yes actually the processing program is reacting nicely to the sound. I was really surprised to notice that it picked up my voice too.
November 8th, 2009 at 10:45 pm
[…] Processing Code was based off of this code here written by Nick Lally. We altered the object from circles to stars that still change colours while […]