Make: Projects

Digital LED Color Organ

Synchronize LEDs to stereo audio playing on a computer with the help of Arduino and the Max Runtime app.

Digital LED Color Organ

I’ve had color organs on the brain since the last installment of the circuit skills series, so I decided try my hand at a new incarnation of the basic 3-channel sound-to-light machine using high-power LEDs.

This time, I took advantage of the fact that I play all of my music from a computer, and created a ‘patch’ in MaxMSP to calculate high, mid, & low values of the outgoing audio stream. Max then sends these values out to an Arduino via serial connection over USB. The Arduino then uses these values to set the individual PWM outputs of 6 different pins. I wired each of these output pins to a couple of Rebel Tri-Driver boards which powered my Luxeon Rebel based display. Alternatively, a much more affordable low-power display could be created by simply connecting each of those PWM outputs to a 5mm LED and resistor wired in series.

Steps

Step #1:

PrevNext
Digital LED Color Organ
  • First download the Max patch & Arduino code for this project here.
  • To run the patch, you'll need to download & install the free cross-platform Max Runtime (link @ top righthand side of the page).
  • The Max Runtime will also require some additional software in order to listen to your computer's outgoing audio. I used Soundflower to do this on my Mac, Windows & Linux users should check out Jack (haven't used it myself, but I believe it should work for this).

Step #2:

PrevNext
Digital LED Color Organ

Upload "StereoColorOrganReceiver_r2.pde" to your Arduino. Leave the Arduino connected to your computer via USB but quit/close the Arduino IDE. You may need to download the Messenger library here http://www.arduino.cc/playground/Code/Me...

Step #3:

PrevNext
Digital LED Color OrganDigital LED Color OrganDigital LED Color OrganDigital LED Color Organ
  • In OS X, set "Soundflower(2 ch)" to "Built in Output" and in the "Audio Setup" app/utility, then set Soundflower(2 ch) as the audio input device.
  • Open "Max-Serial_Color Organ.mxf" file with the "MaxMSP Runtime" app. Click on the "Audio I/O" button and in the DSP Status window that opens, set input device to "Soundflower(2 ch)".
  • Start some audio playing in the application of your choice (iTunes, WinAmp, etc.) and click the button next to "AUDIO ENABLE" (you should see a waveform animate the oscilloscope viewer now)
  • Choose the address of your Arduino from the pulldown menu to the right of "PORT:" Click the button next to "SERIAL ENABLE" Your Arduino should now be receiving values and setting the PWM outputs accordingly.

Step #4:

PrevNext
Digital LED Color Organ
  • The Arduino sketch maps the values in the following way:
  • High Left = pin 3
  • Mid Left = pin 5
  • Low Left = pin 6
  • High Right = pin 9
  • Mid Right = pin 11
  • Connect each of these pins to an LED with an appropriately sized resistor to limit the current. (online calculators can be handy)
  • Alternatively high power LEDs could be used in conjunction with a separate power supply and/or driver board.

Step #5:

PrevNext
Digital LED Color OrganDigital LED Color OrganDigital LED Color Organ

Step #6:

PrevNext
Digital LED Color OrganDigital LED Color OrganDigital LED Color OrganDigital LED Color Organ

Step #7:

PrevNext
Digital LED Color OrganDigital LED Color OrganDigital LED Color OrganDigital LED Color Organ

Step #8:

PrevNext
Digital LED Color OrganDigital LED Color OrganDigital LED Color Organ

  • jordan

    that used to happen to me try
    resetting computer,
    exit and re-open software,
    unplug replug arduino.
    these helped me

  • Jordy

    Hello KevinKevlar
    Try instructables.com!
    you won’t regret it

  • Sean

    Does anyone know where I could find the download link for the max patch for this project?

  • mhrumman

    I’m having an issue with MAX and the serial port, I’ve closed anything that may be interfering but I keep getting an error saying ‘serial: specified port not available’. Any one have any idea what to do?

  • alex

    i downloaded the messenger library but when i try to upload the sketch provided to arduino it says “Messenger does not name a type”… any ideas?

  • Pingback: Android结合Arduino制作LED灯光秀 - 极客范 - GeekFan.net()

  • nozar

    The project not working on windows…. My arduino board is not receiving the pwn outputs

  • Lucas Nunamaker

    Maybe I’m being dumb, but how do I download the patch and arduino code?

  • Roger Linhart

    I’m not seeing a link to the patch, just an image of it that appears to be truncated.