Go Down

Topic: iTunes --> Spectrum Analysis --> Arduino --> Light Show. (Read 1 time) previous topic - next topic


Basically, for the past 2 days i've been looking all over the ineterwebs for information on how to make a spectrum analyzer for the arduino, i started working with anthony mattox's way of using "processing" (application) to analyze the music stream, then to send data to the arduino. I could never get the audio input correct, and the post was i think 4 years ago, so some of the code is outdated....

It seems like so many people online have it up and running, but theres almost no information on how to get it to work!

Im quite new with the arduino, but do well with coding, scripting, whatever you wanna call it.

So, basically im looking for a way to get the music played in iTunes sent to some kind of analyzer that will analyze the different bands of audio, and send the data on those bands to the arduino, where i can process it from there.

Also, i forgot to add that i dont wanna deal with using the line in audio method, or any other method other than USB.
The long term goal: Have different leds go off for high sounds, mids, and lows.

Im working on a iMac with the latest version of snow leopard.
Thanks for any help :]


check - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286718155 - helps to do the spectrum analysis part.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


I have already tried to do that using processing but it cant directly catch the outcoming sound stream, you need to connect you audio out to the audio in and the analyse the audio in stream.


@robtillaart I checked out the link, but even stuff like that im not understanding, its all over the place as far as coding (to me). You'd think there would be something much more simple that just listens to whatever comes in (listenitunes.start();), makes it an array of the volumes at different frequencies, then you can just deal with the data that way... Maybe im just thinking about this all too simply-ly.

@Senso when you say the audio in and audio out streams are you referring to the ports on the computer? or something in the code?


Check this thread on the old forum - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1289765675
that points to

- http://blurtime.blogspot.com/2010/11/arduino-realtime-audio-spectrum.html - SW code
- http://blurtime.blogspot.com/2010/11/arduino-spectrum-with-video-out.html - HW schematics.

If you can recreate this you are allmost done (ok halfway :)

Instead of drawing lines on the (TV) screen you need to add up frequency bands (last for loop)  and use those numbers to steer the LED's. This need not necessary be 4 groups of 16, it can also be 8, 16, 32, 8 That's up to  you.

PS, You don't need to understand the implementation of FFT to use it. You put in an array with the sampled signal - the array DATA in the code - and the FFT converts it into two array's  - IM and DATA. The array IM in the code is needed for the FFT calculation. By taking the sqrt of (data^2 and im^2) one gets the "volume of a frequency". The index - i -  determines which frequencyband. (This explanation is way too simple, but all you need to know to use FFT for your goal).


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up