Receiving Music on an Arduino Uno

I want to setup some LEDs to light up in sync with some music using an Arduino Uno. The biggest problem is how I would receive the music as an input and what data I would use to set the power level of the LEDs. I would like to have the music be streamed from a computer to the Arduino via either ethernet or USB (wirelessly even?).

What equipment would I need for this, and generally how would I go about inputting music and feeding some form of data into the program?

I think you need a 7 Band graphics filter chip:-
http://skoba.no-ip.org/msgeq7/index.html

What equipment would I need for this

The Arduino does not make a very good audio processor. It can, barely, with the aid of a Fast Fourier Transform (FFT) determine a spectrum of input frequencies. If that is what you want to use to determine which LEDs to light up, then some research along those lines is in your future.

If you have some different idea about what "in sync with some music" means, you need to spell them out.

Grumpy_Mike:
I think you need a 7 Band graphics filter chip:-
http://skoba.no-ip.org/msgeq7/index.html

Hi Mike,

Thanks for the tip on that part. The link you provided appears broken, but I found another copy of the datasheet here (via Sparkfun).

Cheers ! Geoff

PaulS:
If you have some different idea about what "in sync with some music" means, you need to spell them out.

Yeah sorry, I was trying to figure out how to word it but I don't know in what ways I could measure the audio coming in to the arduino, or exactly how sound transfer works. For example, does the voltage level vary in a consistent manner, so that I could use the voltage (relative to min and max) to set the power of the LEDs? Different LEDs don't need to light up at different points, I just want the power of the LEDs to match up with some aspect of the song; drum beats, noise level, whatever works.

Hopefully that conveys what I want haha.

For example, does the voltage level vary in a consistent manner,

In a consistent manor with what?

You need to do some research.
Have a look at some audio signals:-
https://www.google.co.uk/search?q=audio+signal&hl=en&client=firefox-a&hs=OCz&tbo=u&rls=org.mozilla:en-US:official&tbm=isch&source=univ&sa=X&ei=00LPUMWgMI600QWt1YCQCQ&ved=0CEYQsAQ&biw=1212&bih=747

You need to know what you want before anyone can tell you what to do.

Grumpy_Mike:
In a consistent manor with what?

As in does does voltage correlate to decibels or tone or anything like that? I forgot about amplitude; can the Arduino measure that?

I guess I'll try to give an example here. Say a song is playing, and at one point, it's really soft/quiet relative to the rest of the song, and kind of slow. At that point, I would want the LEDs to light up at maybe 30% power and at say 3 flashes per second. Then the song picks up and is now faster and louder, so I would want the LEDs to light up at like 90% power and at 5 flashes per second.

The numbers are totally arbitrary and I can handle the coding, I just don't know what kind of data I would have to work with, what that data would represent in the song (like voltage corresponding to decibels or something), and how exactly I would get the music from the computer to the Arduino.

As in does does voltage correlate to decibels or tone or anything like that?

The voltage corresponds to the instantaneous sound pressure of the air. It change all the time from a positive value to a negative value. The peak voltage has some relationship with the loudness of the sound but not direct. The time it takes for the voltage to go from a positive peak to a negative peak and back again is related to the frequency.

and how exactly I would get the music from the computer to the Arduino.

This shows you how to get the audio signal into an arduino:-
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/

However, as I said YOU need to do a lot more research on what an audio signal actually is.

I agree that you definitely need to do some research so you know what the sound coming in from the computer is doing electrically, but once you get done with that I attached a schematic of a circuit I just built to take audio from line levels (computer) and bring it to the Arduino's analog input. I used it for an school honors project where I tried to do some DSP tasks on the Arduino. I was able to do a reasonably fast FFT and some real time digital filtering, so the Arduino can handle what you need to do.

The circuit in the schematic amplifies the signal by a factor of 10 and shifts it up to center it in the allowable ADC range. The op amp I used could be replaced with another (It was what was in the lab), but you need something that will drive close to the lower power rail(no 741's here). Also note the schematic doesn't show it, but the positive supply for the op amp is the 14V+ supply, and the negative supply is ground. C1 is there to allow the DC offset to take place, and C2 and C3 are there to filter out frequencies less than 100 Hz to avoid noise and greater than 20KHz to avoid aliasing.

Lastly, even if you don't plan to do any frequency analysis check out the example code from the FFT library at Arduino FFT – Get your freq. on! | Open Music Labs. They will give you an excellent idea of how to make the analog reads go faster if that is something you need. As far as assessing loudness, peak detection can be a little sensitive. If processing power were no object I would find the RMS value of a group of samples and call that the volume level. The square-roots will kill you on the Arduino, but a sum of absolute values might work out fine.

input schematic.PNG