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.
Literally all you have to do is put the two wires coming out of the LED into the two speaker terminals on a speaker. Strip the plastic off of the wire with the wire strippers so you can twist it with the speaker wire. You'll notice that the LED illuminates with each music beat.
So, the best way to connect LED lights to your music is by turning on the music mode. And as long as the microphone is working and the music mode is turned on, the music will sync with the LED light making it pulsate to the rhythm.
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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With