views:

92

answers:

4

So basically I would like somehow that given an audio file as input (most likely mp3 or I can use some audio engine that will handle other types too) from my computer to control some LED lights so they will be something like an oscilloscope, like the one in winamp.

What would I need to be able to do this? I'm interested in building thing up all by myself, coding, hardware, etc..

I'm going with C++ on Windows.

+2  A: 

Here is a possible approach (high level description):

You could have a simple micro controller (MCU) in a basic circuit with a number of LEDs connected. LED connection circuitry should be easy to find. Most MCU manufacturers will also give a sample test/LED flash circuit in the product datasheet, along with a sample program.

The MCU could interface with your PC via a parallel port (I have used an ATmega8 for which the input pins were level compatible with the parallel port pins). It could also interface using a more sophisticated/higher level approach - via serial/usb port using a UART to serial or UART to USB module with your MCU. You could then output different values via the parallel/serial/usb from a PC application to the MCU, and have the MCU code flash the LEDs as required. There are some articles around that power LEDs from the parallel port itself though this is not recommended. I have used inpout32.dll for accessing the parallel port registers directly. The .NET framework provides a SerialPort class you could use if not using the parallel port approach.

As for the music side of things, I've never dealt with audio files in software. There should be some libraries around and you could perhaps scale amplitude/frequency variations over time to a numerical scale displayable on the LEDs you have. Since this implies you want a basic audio player I am sure you could find some info on the audio side of things for PC apps.

EDIT:

With my answer I assumed this is for a personal project and proposed an approach that would be easy on the budget - a few $ at the local electronics store should get you everything. This is a good start, but as the other answers suggest there are likely better solutions that scale. Starting with a kit - pre-made MCU board might be easier but more expensive! It would likely be worth the cost if it is for a professional project though!

Good luck!

filip-fku
For the audio part, you might want to check out the FMOD library ( http://fmod.org/ ). There you should be able to get enough info to flash the LEDs in a cool yet easy way :)
PeterK
+1  A: 

It sounds like a good case to use an Arduino developer kit. That's basically a small external device that can connect to your USB port and drive external electronics.

On the software side, you'd need to tap the audio stream, pass it through band-pass filters, and threshold it. If the signal in the frequency band exceeds the threshold, you light up the LED by sending a command to your Arduino.

MSalters
+1  A: 

So I guess you want to build up something like a LED wall. The difficulty lies within mapping a video signal (which you can have pre-built by a winamp plug/in or a custom solution) to the LED Wall pixels. I happen to know a little bit about commercial solutions used in the event business. Usually you build a LED Matrix by bunching together a set of LED Bars or LED Tiles. These devices are controlled via the DMX 512 Protocol. DMX 512 has 512 channels with a resolution of 8 bits per channel. A single LED pixel is controlled via 3 channels RGB.

A LED Lightning control software such as Madrix needs to map the signal of an image generator onto LED Pixels and again mapp that to DMX signals. DMX isn't hard to implement, it's a very simple and very robust protocol, can be wired with cheap cables and there are also a lot of commercial solutions available in terms of microcontrollers, DMX/USB adapters etc.

Johannes Rudolph
+1  A: 

Use the parallel port to drive leds directly. The parallel port is really easy to work with if you have simple needs. Take look a this resource for wiring eksamples.

Back when I was at Roskilde University we turned the entire Computer Science building in to a giant VU-meter for the anual campus wide party.

Basically an old pc was used to sample soundlevel as a value between 0-255. That value vas directly output to the "classic" pc parallel port.

The parallel port drove a series of 220V relays conected to green and red lightbulbs that were places in different CS offices.

I looked great! The pièce de résistance was the Japaneese turist who shoved up out of nowhere taking pictures of the building...

Niels Castle