Turning Music Into A Light Show

[nickinoki] Made a light show using some amplifiers and an arduino. First he created a microphone circuit based around a LM386 Audio Amplifier. After amplifying the output of the microphone a second time, he uses three bandpass filters to block all but a few desired frequencies from reaching the arduino.  By only letting a few frequencies through the arduino is able to determine if the song is louder at higher or lower frequencies.  Then using the three analogue inputs he created a scheme for generating the light show on an arduino. While he was unable to achieve the exact target frequencies with his bandpass filters they worked well enough to allow him to successfully generate the light show.

24 thoughts on “Turning Music Into A Light Show

  1. steaky: there is an FFT library written in C for AVR, so you have to compile that for your arduino code. I tried mucking my way through it to make a audio graphical equalizer, but I fail at software.

  2. An Arduino is overkill for a simple project like this, of course, but it is a good way to get into audio DSP. (Comparators would have been a good choice for a simpler, all-analog approach.)

    As for the filters, could you not replace the resistors with trim-pots and use a multimeter to fine-tune the cut-off frequencies, since imprecise resistance/capacitance values are typically the culprit?

  3. Cardassian: So how many lights are there in this here “light show”?

    Picard: There….are….F..O..U..R….Lights!!!!!

    Cardassian: Wow, you humans are really lax on the whole “light show” definition eh?

  4. Dear (I use the term loosly) HAD,

    I don’t like Instructables. They exist in opposition to “Freedom of the Internet”. In addition, they are making rediculous amounts of money off the work of others (Advertizing and “Pro” membership). And this is content they receive for free. I would prefer that you NOT refer me to them. I realize that you are not likely to do as I would prefer, so please note when the referral you make is to Instructables so that I can avoid wasting valuable emotional energy following the link. I may be the only reader who feels this way, but please humor me.

    Norm

  5. @Norm

    cry about it. how about you make a FREE account, and it turns into a great resource for anyone who wants to use the site for its intended purpose: making things. and good for them making money, whats it to you? two words: Chrome, AdBlock.

  6. I did a similar thing with a mic, low pass filter for the bass and opamp.
    Output goes into a Picaxe 08M that filters out the beat and generates serial RGB flashy data that runs to my RGB lamp. (serout)
    If the beat had not been detected for a few seconds, it would fade to random colours. Once a beat had been picked up it would swap between two random colours (sometimes black to make a strobe effect).
    The colours would be changed every 8 beats or so so it should synch up with whatever song.

    It’s kinda fun to optimize programs into a small space. Squeeze every byte!

  7. @Norm
    Instructables makes money, yes, but for people who have a project to share you have several options to post your project. If you want something easy that will share your project with a huge number of people, Instructables is free and easy to use. Otherwise you would need to pay for a web host or run your own server with enough bandwidth to handle linking from HaD. Advertisements aren’t a problem if you use AdBlock and if you have a (free) account you don’t see the Go Pro stuff so I really don’t see the reason behind the Instructables hate. If you really don’t like it, don’t go there.

    As for the project, cool! I just finished a project where I modded some LED fans with microcontroller-driven RGB LED’s for my PC case (3 fans * 4 RGB LED’s * 3 R/G/B = 36 LEDs total with Software PWM). I used an FFT in Processing to analyze the audio playback and do the same thing except digitally to send serial commands and flash the LED’s. I have blue mapped to low (bass) frequencies, green to midrange, and red to high (treble).

  8. @CalcProgrammer
    You mentioned you used a FFT libary for audio stuff… I’m plannung to play with FFTs on Atmels for a long time – but usually find excuses why not to start.
    One thing I’m always wonding is how you debug your stuff.
    Even assuming your FFT libary is rock solid – designing an FIR filter or whatever is (for me) always a try and error game.
    How did you do that. How do you test your whole setup – always with real data???

  9. I built something similar into an IKEA mood lamp, although all audio processing is done on the atmega168 (using software filters, not FFT). The lamp also accepts MIDI input (and sports the requisite automatic colour-cycling modes):

    http://www.youtube.com/watch?v=q_wdKhV-b6w

    (I have changed jobs since posting the video comment, and I would now be willing to assume the minuscule risk of posting details about the construction/code… one day I hope to have/take the time to do so :-( )

  10. @Norm Lillibridge
    Doesn’t your browser tell you the target of links when you hover on them? If not, I suggest you get one that does.
    I always like to check where a link is taking me, lest I blindly click myself onto something horrific – such as Instrucatables.

  11. How about instead of writing some ridiculous note about hating instructables, you just point your browser elsewhere.

    Alternatively, add an entry in your hosts file to point anything hosted at instructables to google or something.

    just edit c:\windows\system32\drivers\etc\hosts and add something like

    74.125.229.16 http://www.instructables.com

    to the bottom.

    There you go. Problem solved. you don’t ever have to look at instructables again.

  12. For those who detest Instructables:

    Taking Philip’s tip a step further, there is a handy Firefox add-on called “Redirector” that allows you to redirect URLs matching a given pattern to a custom URL, based either on regexes or wildcards. By using the following include pattern:
    http://www.instructables.com/id/*

    …and the following redirect pattern:
    http://daid.mine.nu/instructabliss/?url=http://www.instructables.com/id/$1

    you can redirect all Instructables to Instructabliss.

  13. Why bother with a mic. pre-amp? Eliminate that stage, use a capacitor and a variable resistor for volume control and make two of ’em, feeding them at line level and stereo use. Gets rid of unwanted background noise such as someone talking in vicinity of the mic. and other ‘room noises’.

  14. Not to say this isn’t cool, but I did this very thing when I was about 10 (close to 30 years ago…damn) and I used op amps. Even then the project cost me just a few dollars for parts. I also used incandescent bulbs for my “color organ” as the LEDs I had back then just weren’t very impressive for a light show.

  15. when i was a teen I made one with a triac and some transistors per channel. it was great for listening to ELO on :) Its not really a waste to use an arduino chip only though, you could program beat sequencing of lights and stuff.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.