loading
This is a guide to make an LED flashing circuit that "beats" to an mp3 file on your computer, which can add an awesome effect to any sound-related device, or even your room (if you extend the concept with LED drivers or plenty of resistors/transistors).

The LED flashing circuit makes use of the Minim audio library and the Arduino program Processing to analyze sound, producing a response based on a snare drum hit, a bass drum hit, and a hi-hat hit from the percussion of the audio file.

Step 1: Parts/Tools Needed

Here is what you'll need to make the LED beat flashing circuit:

Hardware:
1. An Arduino microcontroller board. There are many versions of the Arduino, but I would recommend the Arduino Duemilanove. You can buy one online for around $20.
2. Three LEDs (different colors preferred, so you can see the difference in beats easier - I used a red, yellow, and green LED)
3. Three resistors (depending on your LEDs, the resistor value will be different - check the ratings on the LEDs to see what resistance corresponds to their maximum brightness, without burning them out)
4. A solderless breadboard
5. Some wire, to use as leads from the Arduino to the LEDs/resistors on the breadboard
6. A computer
7. A USB cable (A to B)

Software:
1. Arduino Software Environment
2. Processing Software Environment
3. The "arduino" library for Processing
4. The BeatWrite / BeatListener code from the minim JavaSound library examples

Download links for the software will follow in Step 3.

<p>Hi, I just did everything that's told on the instructions, I built the circuit, BeatWrite runs without errors but leds won't light up. Can anyone help me?</p>
<p>You may need to change the 0 in this line to the com port number your Arduino is using:</p><p>&quot;arduino = new Arduino(this, Arduino.list()[0], 57600);&quot;</p>
<p>No you have to change the whole word like this:</p><p>arduino = new Arduino(this, &quot;com4&quot;, 57600);</p>
<p>&quot;arduino = new Arduino(this, Arduino.list()[0], 57600);&quot;</p><p>it is [0] or [1] for even or odd parity</p>
<p>Did you get this issue solved?</p>
<p>Guyz I have problem saying Null Pointer Exception</p><p>can anyone help me?</p><p>Thanks a Lot</p>
<p>Hey did you figure out what the problem was? I am having the same error :(</p>
<p>im having the same problem. did you figure out a solution? our arduino board is lighting to the beat but the LEDs are not and the wiring seems to be right.</p>
<p>What do you mean by the Arduino board is lighting to the beat? The RX LED on the Arduino?</p>
<p>Hey, I had the same prob! To fix wire everything up without the resistors. Like this:</p><p></p>
<p>Hey, I had the same prob! To fix wire everything up without the resistors. Like this: </p>
<p>have the exact problem. It loads on the arduino but does not show up on the LED lights, can someone please help</p>
<p>Hey, I had the same prob! To fix wire everything up without the resistors. Like this: </p>
<p>I'm wanting to build a custom electric guitar with an Arduino brain inside the body, and led's on the outside that will light up when certain frequencies are passed to the output jack. Is there a way to route those frequencies into the Arduino instead of an mp3 file to light the lights?</p>
<p>I have and error and its all ports are busy :/<br>any solutions?</p>
<p>I know it seems silly but change Cable connecting UNO to computer.<br>see physical connection on:<br><a href="https://www.arduino.cc/en/Guide/Troubleshooting#upload" rel="nofollow">https://www.arduino.cc/en/Guide/Troubleshooting#up...</a><br></p>
<p>guys I get and error that says </p><p>=== Minim Error ===</p><p>=== Couldn't load the file crazy bass mastered</p><p>Could not run the sketch (Target VM failed to initialize).</p><p>For more information, read revisions.txt and Help ? Troubleshooting.</p><p>why is it saying that?</p>
<p>you have to put file extension with file name</p>
<p>If everything (all the code) seems to be running fine, but your LEDS just wont light up</p><p>try changing the line to </p><p>arduino = new Arduino(this, &quot;/dev/cu.usbmodem1411&quot;, 57600);</p><p>where the part inbetween the double quotes is your arduino's serial. This can be found on the bottom right of any arduino code page </p>
<p>what about arduino? is code upload interval wise(buffer of course) or compile first and upload the whole rhythm at the start? </p><p>-secondly how about if we close the processing and music then what? Arduino will continue to blow the led according?</p>
<p>Sorry guys...just wondering where and how can I change</p><p>==&gt; isRange(int low, int high, int threshold) method as mentioned above??</p>
<p> Works great! I used an Arduino R3 and it works fine. In processing, if you are missing libraries, go to &quot;Sketch &gt; Import Library &gt; Add Library&quot; and add &quot;Arduino (Firmata)&quot; and &quot;Minim&quot;. Also changing</p><p> &quot;arduino = new Arduino(this, Arduino.list()[1], 57600);&quot;</p><p>to:</p><p>&quot;arduino = new Arduino(this, Arduino.list()[0], 57600);&quot;</p><p>made it work. </p>
<p>Thank you!!</p>
<p>Night club strobe light - Strobe flash and club disco light that sync with your music beat. Party on!</p>Description<p>It provides a FREE handy strobe light to you right in your pocket! It will listen to the music around you and blink the flash on your device, just like a strobe light. Not just that, the phone screen will become a disco light, one might say, strikes at your music beats! That&rsquo;s NOT all. Swipe your screen and it will give you several majestic hallucinations, sync with your music, of course. This app is just perfect for your party group, large or small, or even for enhancing your personal musical experience. Bring your phones together and party is just one tap away!<br><br>**NOTICE** <br>Playing media via bluetooth devices will be disabled during using session of the app due to the low quality sound limited by Apple.<br><br>**FEATURES**<br>- Strobe light syncs with your music<br>- Disco light syncs with your music<br>- Hallucination effects, sync with your music<br>- Sensitivity adjustment by quick or accurate mode, with good visual presentation. <br>- Torch light support, for..ehhm&hellip; finding objects you drop on the floor for example.<br>- Listen to music from around you or right from your phone<br>- Futuristic design, smooth animation<br>**HOW TO USE**<br>- Tap the screen light button (on the left) to activate disco light and screen light effects.<br>- Tap the strobe light button (on the right) to activate strobe light effect. Tap again to switch to torch light mode.<br>- You will see the music reflects on the slider bar in color. Once the color bar exceed the pointer on the slider, flash light will strike. This is how you control sensitivity.<br>- For quick configuration, just tap on the marks on the slider to adjust the sensitivity. Move your finger on the slider (you don&rsquo;t have to place your fingertip exactly on the pointer) for more accurate result.<br>- Swipe left or right to change screen effect and hallucinations.</p><p>Link ios: <a href="https://itunes.apple.com/us/app/night-club-strobe-light-strobe/id1128598578?ls=1&mt=8" rel="nofollow">https://itunes.apple.com/us/app/night-club-strobe-...</a></p><p>link preview: https://www.youtube.com/watch?v=WKEbaaBdtd0</p>
<p>what did I do wrong here? there are so many errors</p><p>it also keeps saying that all of the libraries but processing.serial haven't been downloaded, but I thought that the minim library came with Processing, so I'm not sure what the problem is. Please get back to me as soon as possible!</p>
<p>now it says that the ddf.minim library and the sun.audio library don't match, and also the the sun.audio library can't be found. is there something else I need to download?</p>
<p>Can some one please help :( I have no idea what this is and I've been at this for hours. It says &quot;unexpected token&quot; and it has line 19 highlighted &quot;Minim.minim;&quot; </p>
<p>You didn't install the minim library. Minim comes included by default on Processing 2 but not Processing 3.</p><p>To install it on processing 3, click sketch &gt; import library &gt; add library, then search for minim and click install.</p><p>Hope this helps</p>
<p>Has anyone tried to build it on Android Mode with Android SDK? I have tried but still stuck with error as below.</p><p><em><strong>[dx] </strong></em></p><p><em><strong> [dx] PARSE ERROR:</strong></em></p><p><em><strong> [dx] unsupported class file version 52.0</strong></em></p><p><em><strong> [dx] ...while parsing ddf/minim/javasound/BasicMetaData.class</strong></em></p><p><em><strong> [dx] 1 error; aborting</strong></em></p><p><em><strong>BUILD FAILED</strong></em></p><p><em><strong>C:\Program Files (x86)\adt-bundle-windows-x86-20140321\sdk\tools\ant\build.xml:888: The following error occurred while executing this line:</strong></em></p><p><em><strong>C:\Program Files (x86)\adt-bundle-windows-x86-20140321\sdk\tools\ant\build.xml:890: The following error occurred while executing this line:</strong></em></p><p><em><strong>C:\Program Files (x86)\adt-bundle-windows-x86-20140321\sdk\tools\ant\build.xml:902: The following error occurred while executing this line:</strong></em></p><p><em><strong>C:\Program Files (x86)\adt-bundle-windows-x86-20140321\sdk\tools\ant\build.xml:283: null returned: 1</strong></em></p><p><em><strong>Total time: 26 seconds</strong></em></p>
<p>It all worked out fine for me but the LEDs are not as in sync as I was hoping them to be. I hope to make improvements on the software myself. Has anyone else tried this?</p>
<p>would it be possible to make a cube of LEDs 3 by 4 on each side? </p>
<p>How to fix this?</p><p>No library found for ddf.minim</p><p>No library found for ddf.minim.analysis</p><p>Libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.</p>
<p>Put the arduino library in <br>Documents&gt;Processing&gt;libraries, and if it doesn't work use <br>processing v2, download it from here : </p><p><a href="https://processing.org/download/?processing" rel="nofollow">https://processing.org/download/?processing</a></p><p>(Run processing at least once before doing that to create the Processing folder in Documents)</p>
<p>It works. Thanks for the great work. But may i know how do i store it into the arduino. because everytime it finish, I've to click play on processing in order to work again.</p>
<p>can you help me please , i'am stuck in this</p><p> Go to File -&gt; Examples -&gt; Firmata -&gt; StandardFirmata, and press the Upload button on the Arduino SE (see image 2).</p><p>and i don't found upload !!!!!!</p>
<p>Ctrl + U, just press it after the window of StandardFirmata opens up</p>
<p>Once you have loaded the code and selected the type of Arduino you are using as well as the Com. Port number from the tools menu/dropdown, you can choose upload, or press CTRL+U on your keyboard.</p>
<p>Hey</p><p>I found this tutorial really cool but I am having a problem with step 3 part 3. I do not understand where the processing folder needs to be nor do I understand where to put the libraries. This is clrealy my fault not yours as others have done this easily. Thnaks for the help in advance</p><p>PS - I only got my arduino today</p>
<p>It says 'No library found for ddf.minim'</p><p>'No library found for ddf.minim.analysis'</p><p>'No library found for cc.arduino'</p>
<p>Put the arduino library in Documents&gt;Processing&gt;libraries, and if it doesn't work use processing v2, download it from here : </p><p><a href="https://processing.org/download/?processing" rel="nofollow">https://processing.org/download/?processing</a></p><p>(Run processing at least once before doing that to create the Processing folder in Documents)</p>
<p>Hey samD71,Even I am facing a similar problem.My beat.pde file is not loading.`It displays some sketchbook error.</p>
<p>In processing, go to Sketch&gt;Add file..&gt;Arduino.jar, you will find Arduino.jar in the Arduino library you downloaded, if you placed it in the right place it should be in Documents&gt;Processing&gt;libraries&gt;arduino&gt;library... the code should work now</p>
<p>okay got through the problems going through an error where it says cant find class or type beatlistener .</p>
<p>okay got through the problems going through an error where it says cant find class or type beatlistener .</p>
<p>okay got through the problems going through an error where it says cant find class or type beatlistener .</p>
<p>Hello! Thank you for the tutorial first of all! I do how ever have a problem, I think it is a bit external to this tut but still.</p><p>This line &quot;arduino = new Arduino(this, Arduino.list()[1], 57600);&quot; is highlighted </p><p>and the error line tells me &quot;error opening serial port /dev/cu/Bluetooth-modem: port busy. &quot; although I didn't use the bluetooth to work in any way. </p><p>Where should I look for to resolve this?</p>
<p>all fixed!</p>
<p>im pretty new to this side of programming i followed all the instructions and im getting a pretty big error could some please help me ive been struggling with what to do next ive searched all over and im sure its something simple here is the error </p><p>Arduino: 1.6.1 (Windows 7), Board: &quot;Arduino Uno&quot;</p><p>BeatWrite.ino:20:1: error: 'import' does not name a type</p><p>In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:24:0,</p><p> from BeatWrite.ino:20:</p><p>BeatWrite.ino:20:28: error: expected unqualified-id before 'true'</p><p>BeatWrite.ino:22:1: error: 'import' does not name a type</p><p>BeatWrite.ino:23:1: error: 'import' does not name a type</p><p>BeatWrite.ino:25:1: error: 'Minim' does not name a type</p><p>BeatWrite.ino:26:1: error: 'AudioPlayer' does not name a type</p><p>BeatWrite.ino:27:1: error: 'BeatDetect' does not name a type</p><p>BeatWrite.ino:28:1: error: 'BeatListener' does not name a type</p><p>BeatWrite.ino:29:1: error: 'Arduino' does not name a type</p><p>BeatWrite.ino: In function 'void setup()':</p><p>BeatWrite.ino:38:9: error: 'Arduino' was not declared in this scope</p><p>BeatWrite.ino:38:26: error: 'println' was not declared in this scope</p><p>BeatWrite.ino: In function 'void draw()':</p><p>BeatWrite.ino:42:13: error: 'background' was not declared in this scope</p><p>BeatWrite.ino:43:9: error: 'fill' was not declared in this scope</p><p>BeatWrite.ino:44:4: error: 'beat' was not declared in this scope</p><p>BeatWrite.ino:45:1: error: 'arduino' was not declared in this scope</p><p>BeatWrite.ino:45:30: error: 'Arduino' was not declared in this scope</p><p>In file included from BeatWrite.ino:20:0:</p><p>C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:40:14: error: expected unqualified-id before numeric constant</p><p> #define HIGH 0x1</p><p> ^</p><p>BeatWrite.ino:45:38: note: in expansion of macro 'HIGH'</p><p>BeatWrite.ino:48:4: error: 'beat' was not declared in this scope</p><p>BeatWrite.ino:49:1: error: 'arduino' was not declared in this scope</p><p>BeatWrite.ino:49:31: error: 'Arduino' was not declared in this scope</p><p>In file included from BeatWrite.ino:20:0:</p><p>C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:40:14: error: expected unqualified-id before numeric constant</p><p> #define HIGH 0x1</p><p> ^</p><p>BeatWrite.ino:49:39: note: in expansion of macro 'HIGH'</p><p>BeatWrite.ino:52:4: error: 'beat' was not declared in this scope</p><p>BeatWrite.ino:53:1: error: 'arduino' was not declared in this scope</p><p>BeatWrite.ino:53:31: error: 'Arduino' was not declared in this scope</p><p>In file included from BeatWrite.ino:20:0:</p><p>C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:40:14: error: expected unqualified-id before numeric constant</p><p> #define HIGH 0x1</p><p> ^</p><p>BeatWrite.ino:53:39: note: in expansion of macro 'HIGH'</p><p>BeatWrite.ino:56:1: error: 'arduino' was not declared in this scope</p><p>BeatWrite.ino:56:30: error: 'Arduino' was not declared in this scope</p><p>In file included from BeatWrite.ino:20:0:</p><p>C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:41:14: error: expected unqualified-id before numeric constant</p><p> #define LOW 0x0</p><p> ^</p><p>BeatWrite.ino:56:38: note: in expansion of macro 'LOW'</p><p>C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:41:14: error: expected unqualified-id before numeric constant</p><p> #define LOW 0x0</p><p> ^</p><p>BeatWrite.ino:57:39: note: in expansion of macro 'LOW'</p><p>C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:41:14: error: expected unqualified-id before numeric constant</p><p> #define LOW 0x0</p><p> ^</p><p>BeatWrite.ino:58:39: note: in expansion of macro 'LOW'</p><p>BeatWrite.ino:59:18: error: 'textSize' was not declared in this scope</p><p>BeatWrite.ino:60:14: error: 'width' was not declared in this scope</p><p>BeatWrite.ino:60:23: error: 'height' was not declared in this scope</p><p>BeatWrite.ino:60:31: error: 'text' was not declared in this scope</p><p>BeatWrite.ino: In function 'void stop()':</p><p>BeatWrite.ino:72:1: error: 'song' was not declared in this scope</p><p>BeatWrite.ino:74:1: error: 'minim' was not declared in this scope</p><p>BeatWrite.ino:76:1: error: 'super' was not declared in this scope</p><p>BeatListener.ino: At global scope:</p><p>BeatListener.ino:1:31: error: expected initializer before 'AudioListener'</p><p>Error compiling.</p><p> This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p>
<p>If you are using Processing 3, you need to install the library.</p>
<p>i did everything but i got this error</p><p>&quot;no libraries found for ddf.minim&quot;</p><p>&quot;no libraries found for ddf.minim.analysis&quot;</p><p>please help me out.</p>

About This Instructable

547,026views

293favorites

License:

More by Hyrulian:How to Make LEDs Flash to Music with an Arduino 
Add instructable to: