How to Make LEDs Flash to Music with an Arduino

von
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.

Schritt 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.

Post a comment
Be nice!

Noch keine Einträge.
Sei der Erste!

alexander.s.h.35
alexander.s.h.35 sagt: Sep 18, 2014. 11:36 vorm.

For peeps who dis does not work for try useing the simpledigitalfirmata

jeffmodell
jeffmodell sagt: Sep 8, 2014. 11:46 nachm.

I got it working but is there any ideas on getting it to play with live streaming audio from either a player or line in

naveed.edalati
naveed.edalati sagt: Aug 24, 2014. 1:39 nachm.

Hi. Does anyone know how I can extend the length of time each LED is on for? I am trying to hook the outputs to a relay module and feed it to a traffic light. The period of each pulse is way too fast at the moment and I am looking to reduce it.

Narendrababuk
Narendrababuk sagt: Aug 17, 2014. 12:43 vorm.

i wnn auduino code for displaying single led light,,,, in led display32*16 nd i hv to display only 4*4 leds in that display only

RaresP
RaresP sagt: Aug 16, 2014. 1:07 nachm.

Thank you dude for the project it is awesome :)

vansh2001
vansh2001 sagt: Jul 23, 2014. 10:35 nachm.

I need help. My led won't light up.I hear the music in the processing. I checked and made sure they led are working. How do i use processing to connect with arduino

vansh2001
vansh2001 sagt: Jul 22, 2014. 9:27 nachm.

I got through all the set up as mentioned but for some resin my led won't light up to the beat. 2 of the them are constantly lit( input 12 and 8). How do i fix this

H2oSecReT
H2oSecReT sagt: Mai 20, 2014. 9:14 nachm.

i'm encountering another problem again how ti fix this:

==== JavaSound Minim Error ====

==== Don't know the ID3 code WOAF

==== JavaSound Minim Error ====

==== Don't know the ID3 code WOAR

==== JavaSound Minim Error ====

==== Don't know the ID3 code WOAS

==== JavaSound Minim Error ====

==== Don't know the ID3 code APIC

please help sir

the song is already playing but the led are not flashing

H2oSecReT
H2oSecReT sagt: Mai 20, 2014. 6:38 vorm.

i got an error like this:

java.lang.RuntimeException: java.lang.NullPointerException

at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)

at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:100)

at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:205)

at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)

at javax.media.opengl.Threading.invoke(Threading.java:191)

at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:483)

at processing.opengl.PGL.requestDraw(PGL.java:1149)

at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1604)

at processing.core.PApplet.run(PApplet.java:2176)

at java.lang.Thread.run(Thread.java:662)

Caused by: java.lang.NullPointerException

at ddf.minim.javasound.JSMinim.getAudioRecordingStream(Unknown Source)

at ddf.minim.Minim.loadFile(Unknown Source)

at BeatWrite.setup(BeatWrite.java:58)

at processing.core.PApplet.handleDraw(PApplet.java:2280)

at processing.opengl.PGL$PGLListener.display(PGL.java:2601)

at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:588)

at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:572)

at javax.media.opengl.awt.GLCanvas$7.run(GLCanvas.java:1054)

at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1034)

at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:909)

at javax.media.opengl.awt.GLCanvas$8.run(GLCanvas.java:1065)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:666)

at java.awt.EventQueue.access$400(EventQueue.java:81)

at java.awt.EventQueue$2.run(EventQueue.java:627)

at java.awt.EventQueue$2.run(EventQueue.java:625)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:636)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

mondherr
mondherr sagt: Apr 19, 2014. 1:40 vorm.

you for all
the information

according
to which the LEDs are lit

What is a
`three code isKick isSnare isHat

sampling is made or not

algorithm program

help me pleasethank

mondherr
mondherr sagt: Apr 19, 2014. 1:27 vorm.

ayou for all
the information

according
to which the LEDs are lit

What is a
`three code isKick isSnare isHat

sampling is made or not

algorithm program

aide
moi pleasethank

mondherr
mondherr sagt: Apr 19, 2014. 1:12 vorm.

thank you for all the information

I do not understand by what the LEDs light

how we selected three part audio buffer according to intensity or frequency

as do the three codes isKick isSnare isHat

algorithm program

thank you

nerfitz
nerfitz sagt: Apr 7, 2014. 5:54 nachm.

i have been trying to get this software to works for the past couple days now and it keeps saying "the package "cc" does not exist...

I understand that the libraries have to be within the sketchbook folders for the program to find them but i guess i don't know which file is missing or exactly how it is supposed to go if someone (hopefully the poster?) could screenshot the folders and how they are supposed to look or describe the order of files within files that would be awesome. I've been moving things around for a while and i have already tried renaming Arduino to arduino, no luck.

emceecabias
emceecabias sagt: Mär 23, 2014. 10:38 nachm.

Hello there!
Can I change the music into one of the songs of SKRILLEX like the CINEMA or the Rock and Roll song? and also how will I code it if I'm going to use that song. Thanks :-)

wahahahaha
wahahahaha sagt: Mär 15, 2014. 5:59 vorm.

what to do?..im getting this error

java.lang.NullPointerException

at processing.mode.java.runner.Runner.findException(Runner.java:926)

at processing.mode.java.runner.Runner.reportException(Runner.java:871)

at processing.mode.java.runner.Runner.exceptionEvent(Runner.java:797)

at processing.mode.java.runner.Runner$2.run(Runner.java:686)

edecoux
edecoux sagt: Jan 21, 2014. 8:43 vorm.

i'm getting this error

==== JavaSound Minim Error ====

==== Don't know the ID3 code TXXX

==== JavaSound Minim Error ====

==== Don't know the ID3 code TXXX

==== JavaSound Minim Error ====

==== Don't know the ID3 code TXXX

==== JavaSound Minim Error ====

==== Don't know the ID3 code TDEN

==== JavaSound Minim Error ====

==== Don't know the ID3 code TSSE

lilchip
lilchip sagt: Dez 6, 2013. 3:27 nachm.
please help I keep getting the following error I am trying to run this project on the raspberry pi
java.io.IOException: Cannot run program "/home/pi/processing-2.1/java/bin/java": java.io.IOException: error=2. no such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:488)
lilchip
lilchip sagt: Dez 6, 2013. 3:23 nachm.
I am trying to run this project from a raspberry pi please help error code above
lilchip
lilchip sagt: Dez 6, 2013. 3:21 nachm.
java.io.IOException: Cannot run program "/home/pi/processing-2.1/java" : java.io.IOException: error=2. No such file or directory
at java.lang.ProcessBuilder.start.(ProcessBuilder.;java:488)
dan555
dan555 sagt: Dez 2, 2013. 11:04 vorm.
Hi I Was wondering if you are able to add more channels to the program so you are capable off having 8 leds flashing away
jcupof
jcupof sagt: Nov 16, 2013. 3:14 nachm.
I've been working on this for a bit now, and can't seem to get it to work. I believe the Processing app is trying to communicate with the Arduino board via bluetooth, and I need it to speak via USB. I would appreciate any feedback. Thanks.


- java.lang.RuntimeException: Error opening serial port /dev/cu.Bluetooth-Modem: Port busy
jcupof
jcupof sagt: Nov 16, 2013. 3:23 nachm.
I solved my previous issue, and now have this:
I am on a mac 10.9.x
- java.lang.NullPointerException
at processing.app.Library.getClassPath(Library.java:315)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:406)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:185)
at processing.mode.java.JavaBuild.build(JavaBuild.java:144)
at processing.mode.java.JavaBuild.build(JavaBuild.java:123)
at processing.mode.java.JavaMode.handleRun(JavaMode.java:120)
at processing.mode.java.JavaEditor$18.run(JavaEditor.java:468)
at java.lang.Thread.run(Thread.java:744)
jabelone
jabelone sagt: Nov 16, 2013. 1:23 vorm.
I have tried so many different ways to do this and was just about to buy a pre built kit and yours worked!! Because I couldn't get the pre built kit here in time I needed something as proof of concept. Thanks heaps!!
bbulldog
bbulldog sagt: Nov 3, 2013. 9:21 nachm.
Help! Hope someone is looking at this. Worked on an error all day. Can't get it. When the file BeatWrite is started, get the error, "import does not name type." Appreciate any help you can give me.
lynettequek
lynettequek sagt: Aug 31, 2013. 7:25 nachm.
mine highlights this:
arduino = new Arduino(this, Arduino.list()[0], 57600);

and wrote that they could not register dispose + 0 for processing.
anyone knows what went wrong?
tchatow
tchatow sagt: Aug 18, 2013. 1:15 nachm.
Here is my code:

/**
* This sketch demonstrates how to use the BeatDetect object in FREQ_ENERGY mode.

* You can use isKick, isSnare, isHat, isRange,
* and isOnset(int) to track whatever kind of beats you are looking to track, they will report
* true or false based on the state of the analysis. To "tick" the analysis you must call detect
* with successive buffers of audio. You can do this inside of draw, but you are likely to miss some
* audio buffers if you do this. The sketch implements an AudioListener called BeatListener
* so that it can call detect on every buffer of audio processed by the system without repeating a buffer
* or missing one.
*


* This sketch plays an entire song so it may be a little slow to load.
*/

import processing.serial.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import cc.arduino.*;

Minim minim;
AudioPlayer song;
BeatDetect beat;
BeatListener bl;
Arduino arduino;

int ledPin = 12; // LED connected to digital pin 12
int ledPin2 = 8; // LED connected to digital pin 1
int ledPin3 = 2; // LED connected to digital pin 0

float kickSize, snareSize, hatSize;

void setup() {
println(Arduino.list()[0]);
}

void draw() {
background(0);
fill(255);
if(beat.isKick()) {
arduino.digitalWrite(ledPin, Arduino.HIGH); // set the LED on
kickSize = 32;
}
if(beat.isSnare()) {
arduino.digitalWrite(ledPin2, Arduino.HIGH); // set the LED on
snareSize = 32;
}
if(beat.isHat()) {
arduino.digitalWrite(ledPin3, Arduino.HIGH); // set the LED on
hatSize = 32;
}
arduino.digitalWrite(ledPin, Arduino.LOW); // set the LED off
arduino.digitalWrite(ledPin2, Arduino.LOW); // set the LED off
arduino.digitalWrite(ledPin3, Arduino.LOW); // set the LED off
textSize(kickSize);
text("KICK", width/4, height/2);
textSize(snareSize);
text("SNARE", width/2, height/2);
textSize(hatSize);
text("HAT", 3*width/4, height/2);
kickSize = constrain(kickSize * 0.95, 16, 32);
snareSize = constrain(snareSize * 0.95, 16, 32);
hatSize = constrain(hatSize * 0.95, 16, 32);
}

void stop() {
// always close Minim audio classes when you are finished with them
song.close();
// always stop Minim before exiting
minim.stop();
// this closes the sketch
super.stop();
}





I get an error on this line: if(beat.isKick()) {

Here is the error: NullPointerException
BobThAK
BobThAK sagt: Mai 8, 2013. 6:16 nachm.
I'm getting this. lol

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: No framebuffer objects available
at processing.opengl.PGL$PGLListener.init(PGL.java:3255)
at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:532)
at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:552)
at javax.media.opengl.awt.GLCanvas$5.run(GLCanvas.java:1032)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1019)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:896)
at javax.media.opengl.awt.GLCanvas$7.run(GLCanvas.java:1060)
at javax.media.opengl.Threading.invoke(Threading.java:193)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:461)
at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:516)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
at sun.awt.RepaintArea.paint(RepaintArea.java:224)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:308)
at java.awt.Component.dispatchEventImpl(Component.java:4736)
at java.awt.Component.dispatchEvent(Component.java:4488)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:668)
at java.awt.EventQueue.access$400(EventQueue.java:81)
at java.awt.EventQueue$2.run(EventQueue.java:627)
at java.awt.EventQueue$2.run(EventQueue.java:625)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:641)
at java.awt.EventQueue$3.run(EventQueue.java:639)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:638)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "Animation Thread" java.lang.RuntimeException: java.lang.RuntimeException: Processing cannot run because GLSL shaders are not available.
at jogamp.common.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:99)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:205)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:461)
at processing.opengl.PGL.requestDraw(PGL.java:1195)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1550)
at processing.core.PApplet.run(PApplet.java:2140)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: Processing cannot run because GLSL shaders are not available.
at processing.opengl.PGraphicsOpenGL.getGLParameters(PGraphicsOpenGL.java:6077)
at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:1580)
at processing.core.PApplet.handleDraw(PApplet.java:2219)
at processing.opengl.PGL$PGLListener.display(PGL.java:3240)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:573)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:558)
at javax.media.opengl.awt.GLCanvas$6.run(GLCanvas.java:1049)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1021)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:896)
at javax.media.opengl.awt.GLCanvas$7.run(GLCanvas.java:1060)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:666)
at java.awt.EventQueue.access$400(EventQueue.java:81)
at java.awt.EventQueue$2.run(EventQueue.java:627)
at java.awt.EventQueue$2.run(EventQueue.java:625)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:636)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
The+Expert+Noob
The+Expert+Noob sagt: Mai 5, 2013. 7:13 nachm.
my best settings came as:

beat.setSensitivity(1);
kickSize = snareSize = hatSize = 500

time to rig it up to some bridge rectifiers, isolators and some A/C lights
Iraz
Iraz sagt: Mai 1, 2013. 6:01 nachm.
It says serial does not run in 64-bit mode? Can anyone help me?
jordxn
jordxn sagt: Apr 6, 2013. 2:49 nachm.
Also had the "the package "cc" does not exist issue. To fix -- In the Processing Editor, select "Sketch" > "Add File", then just select the "Ardunio.jar" file. Should work!

I also got "ArrayIndexOutOfBoundsException" -- To get this fixed;

Changed line 35 from;
arduino = new Arduino(this, Arduino.list()[1], 57600);
To;
arduino = new Arduino(this, Arduino.list()[0], 57600);

And then it works!! :)
Doctor_Donna
Doctor_Donna sagt: Jan 27, 2013. 2:23 nachm.
Well now I fixed that... But now it's saying:

"NullPointerException" on processing
An highlighting the line "song = minim.loadfile("mysong.mp3", 2048);"
Doctor_Donna
Doctor_Donna sagt: Jan 27, 2013. 12:52 nachm.
Well, I fixed the "Cannot find a class or type named 'BeatListener'" problem... On my own.
But I would appreciate it if someone would help with arduino. When I try to upload it, is says "avrdude: stk500_getsync() : not in sync: resp=0x30" What exactly does that mean and how do I fix it; because I think it has something to do with "ArrayIndexOutOfBoundsException: 1
WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 1
at sketch_jan20a.setup(sketch_jan20a.java:59)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source
at java.lang.Thread.run(Thread.java:662)" on processing.
(btw: "sketch_jan20a." is the name of the processing page I put the code on) If someone could help with either or both of these, it would be much appreciated!
Doctor_Donna
Doctor_Donna sagt: Jan 21, 2013. 10:03 nachm.
On processing, it says

"Cannot find a class or type named 'BeatListener'"

How do I fix this? What am I missing? No ones' answers are helping me.
landsharkxx
landsharkxx sagt: Jan 5, 2013. 6:42 nachm.
I need help, when I press the run button in processing it says No library found for cc.arduino
Libraries must be installed in a folder called "libraries" inside the "sketchbook" folder.
I've found the libraries folder in the arduino-1.0.3 folder but I cant find sketchbook folder
rmoorjani
rmoorjani sagt: Dez 17, 2012. 7:35 nachm.
Hey guys, I fixed the "the package "cc" does not exist. you might be missing a library." error! ITS SUPER SIMPLE! Just go to /libraries/arduino/library/ and rename the Arduino.jar to arduino.jar with a lowercase :)
skyfly200
skyfly200 sagt: Mär 15, 2013. 10:46 nachm.
I have this error and this did not help
gthorsnes
gthorsnes sagt: Dez 14, 2012. 11:06 nachm.
To everyone getting the "IllegalAccess" message: go back to the Processing download page, and download the LAST KNOWN GOOD COPY: 1.5.1 For some reason the beta of 2.0 is messed up and causes this issue. Just download the 1.5.1 build, underneath the beta builds, and re-try. This fixed the issue for me.
rynev33
rynev33 sagt: Dez 7, 2012. 10:25 vorm.
I am also getting that exception in thread message. Can you please explain the fix?
ejogion
ejogion sagt: Nov 19, 2012. 6:42 nachm.
I got this
Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy

HELP!!!!
pablopeillard
pablopeillard sagt: Nov 21, 2012. 3:08 nachm.
https://github.com/pardo-bsso/processing-arduino That fixed it for me
dannyelloko20
dannyelloko20 sagt: Okt 26, 2012. 3:42 nachm.
I got everything accordingly to what you have but im getting the following error:

OpenGL error 1280 at top beginDraw(): invalid enumerant

Help please
Sushant08
Sushant08 sagt: Jun 9, 2012. 12:33 vorm.
i keep getting java arrayindexoutofbounds exception1 even after i have changed the filename and added the arduino libraries
Sushant08
Sushant08 sagt: Jun 9, 2012. 12:31 vorm.
i keep getting java arrayindexout of exception 1 error .even after i have replaced the filename and added the arduino libraries
agian
agian sagt: Mai 1, 2012. 10:41 vorm.
Is it possible to save the data from processing so it doesnt need to be tethered to the computer?
robinsunny
robinsunny sagt: Apr 30, 2012. 2:13 nachm.
how can i edit beatwriter to recognize just more than kick, snare, and hat? i want to split the lows, mids, and highs into 2 or more signals each and use 6 to 9 LEDs altogether
oldsmarracin
oldsmarracin sagt: Apr 26, 2012. 7:29 nachm.
your code worked a week ago now everytime i try and run it i get java crashes i click show more and it says faulty module rxtxserial.dll
Dannyboy1891
Dannyboy1891 sagt: Apr 23, 2012. 8:27 nachm.
Hey I am making this project for my class and I am wondering if anyone knows how i could do this same thing but with 5 led's tied in series......please comment back thanks :)
robinsunny
robinsunny sagt: Apr 30, 2012. 2:10 nachm.
same here, i'm gonna follow this thread in case anything comes up
Dannyboy1891
Dannyboy1891 sagt: Mai 1, 2012. 8:12 vorm.
I found out an easy way to do it without using any extra components.......just tie the led's in parallel instead of series......the arduino powered all 5 of my led's just fine make sure you have a resistor though.
robinsunny
robinsunny sagt: Mai 2, 2012. 11:38 vorm.
do u know a way to split the bands even more so the kick has its own lows, mids, and highs and the snare would have its own lows, mids, highs and so on? what do i need to edit to recognize more frequency ranges?
Dannyboy1891
Dannyboy1891 sagt: Mai 14, 2012. 5:27 nachm.
No I havent figured that out yet either. If you find out please let me know. It would better my project.
alexwu2211
alexwu2211 sagt: Mär 12, 2012. 7:13 vorm.
Hi, I am a 13 year old kid from taiwan, and I just failed miserably on the this Arduino- based project. This was my first Arduino project in mind, and I thought it would be a good lesson to start with. At the start everything worked out smoothly, but after I downloaded the Arduino library for Processing, things started going a little down hill. Soon my dad came over to help, but also failed. We just couldn't figure out where was Processing's library! Since I didn't succeed with this project, it would be very helpful for you guys to answer some of my questions/ suggestions, so here they are.

1) does this project only work with PC?

2) where is Processing's library?

3) could you make another picture of how to put the Arduino folder into Processing's library?

4) is the Arduino in the picture a UNO?

5) can the latest Arduino UNO work for this project


Thanks guys, this is really all I ask for!!!
tomtortoise
tomtortoise sagt: Feb 6, 2012. 2:24 nachm.
I downloaded the processing-arduino.zip, unzipped it, and copy/pasted that into the folder "libraries" that i made, (this folder is in the Processing main folder)
after this im still getting the error
the package "cc" does not exist. you might be missing a library.

no library found for cc.arduino
as of release 1.0, libraries most be installed in a folder named 'libraries' inside the 'sketchbook' folder.

i tried looking or the sketchbook folder but i cant find it, do i need to make it?
Tunai
Tunai sagt: Feb 21, 2012. 11:16 nachm.
In processing main window file > preferences you will see the default sketchbook location. Create a libraries folder there and copy the arduino folder to here.
Ethankell
Ethankell sagt: Jan 20, 2012. 4:12 nachm.
Whenever I'm trying to run the script in processing I get the following error.


WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 1
at BeatWrite.setup(BeatWrite.java:59)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)

It also highlights

arduino = new Arduino(this, Arduino.list()[1], 57600);


Within the script. Any ideas/help? It would be much appreciated.
Tunai
Tunai sagt: Feb 21, 2012. 11:17 nachm.
I did this arduino = new Arduino(this, Arduino.list()[0], 57600);

and it worked.


 I dont know about RXTX mismatch error
oldsmarracin
oldsmarracin sagt: Apr 26, 2012. 7:32 nachm.
the rxtx error is highly common and has no effect on how it works but for the rest of the error its just you didnt have the right com selected for the arduino
gang601
gang601 sagt: Dez 27, 2011. 2:39 nachm.
This is so interesting! I'll follow this!
fullinception
fullinception sagt: Dez 26, 2011. 3:29 nachm.
when I try to import an .MP3 to the programmer software it says i should stick to the ASCII format. what is this what am I doing wrong. please help.
blister75
blister75 sagt: Jan 3, 2012. 9:06 vorm.
dont import into processing instead just copy/paste into the data folder. MP3 are binary files and processing will not read them correctly
fullinception
fullinception sagt: Jan 3, 2012. 2:19 nachm.
Thanks for the reply! I'll try that.
asinghwi
asinghwi sagt: Dez 8, 2011. 9:28 nachm.
Hi the LED's light up according to the music. What should I do if I want to add more LED's?
frstz28
frstz28 sagt: Okt 16, 2011. 8:19 nachm.
I was just wonding how different the codes will be if I am using an arduino uno?
runothepes
runothepes sagt: Okt 12, 2011. 9:27 vorm.
For all of you having problems with the "no library found for cc.arduino..." i suggest doing this:

In Processing go to your sketchbook folder (if you dont know where it is, go to File -> Preferences to find out) and look for a subfolder named "libraries". If it doesnt exist, create one. Copy the "arduino" folder located in the "processing-arduino-0017.zip" or the other file, if you own an arduino mega.

That should do it...

calebpicou
calebpicou sagt: Okt 10, 2011. 5:17 nachm.
My leds don't respond at all. I checked to make sure I had the correct pins and everything. Do I need to do something different to get it to work with the Arduino Uno?
jin_yeugh
jin_yeugh sagt: Feb 28, 2012. 5:29 nachm.
I'm still having this same problem getting the LEDs to light up. Did you ever get them working?
bpatel82
bpatel82 sagt: Jul 20, 2011. 5:07 nachm.
this is cool.. i am trying to run this code on Arduino 2560.. can I use the standard firmata code with Arduino AT2560? If so, do i need to update any part of the code other than the com port? please let me know.
jarvis7.1
jarvis7.1 sagt: Jul 1, 2011. 11:11 vorm.
is it possible to make it play a whole playlist if so can u please help me
jarvis7.1
jarvis7.1 sagt: Jun 30, 2011. 7:30 nachm.
if i try to run the script in processing i get the following error.

the package "cc" does not exist. you might be missing a library.

no library found for cc.arduino
as of release 1.0, libraries most be installed in a folder named 'libraries' inside the 'sketchbook' folder.

can someone please help.
Handegaard
Handegaard sagt: Jul 23, 2011. 1:15 nachm.
I get the same massage! :/ need help!
jarvis7.1
jarvis7.1 sagt: Jul 23, 2011. 8:23 nachm.
No, I figured it out myself, but thanks any way! :)
Handegaard
Handegaard sagt: Jul 25, 2011. 6:40 vorm.
How did you do it?
jarvis7.1
jarvis7.1 sagt: Jul 26, 2011. 8:39 nachm.
I actually cant remember how i fixed it. I fixed it a couple of weeks ago, but i do remember reading the reply to someone elses comment. It gave me a website and i checked it out but it didn't fix it completly so i worked off of what i was left with.
gang601
gang601 sagt: Jan 6, 2012. 1:09 vorm.
1)Go this wepsite : http://www.arduino.cc/playground/Interfacing/Processing
2)Download this -> Processing Library: processing-arduino.zip (Updated 11 Nov. 2011)
3) Unzip the file and you can find "arduino" folder
3) Copy "arduino" file into libraries(in processing folder)
4) and restart


kempx
kempx sagt: Jun 1, 2011. 5:39 vorm.
If I try to run the script in Processing, I get the follwing error:

WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2

Since I'm not familiar with JAVA, I have no idea, what I should do now. Any help would be appreciated.

-KempX
samwhiteUK
samwhiteUK sagt: Jun 23, 2011. 7:53 vorm.
I had the same problem. First, download this file, and place it on your desktop.

http://www.filedude.com/download/EGLBZ2GaNkfd5fbb8931

Next, browse to your prcessing folder, and go to (location of processing folder)/modes/java/libraries/serial/library, and make a backup copy of RXTXcomm.jar.

Now rename the file you downloaded to RXTXcomm.jar, and overwrite the one in the Prcosessing folder, then restart processing and try running the sketch again.

If something goes wrong, you can always restore the file from the backup.

Let me know how it goes.
A.O.D
A.O.D sagt: Mai 5, 2011. 7:09 vorm.
I've use the EL escudo shield to control EL wire with this program for a display in my electronics class.
SpiderPi
SpiderPi sagt: Apr 27, 2011. 8:02 vorm.
I need some help as the compiler in processing 1.2 says Arduino constructor is undefined. would you be so gentle to instruct. Thanks
Magikhatman
Magikhatman sagt: Mär 28, 2011. 5:39 vorm.
I have a small question if someone wanted to do something similar to this but with a microphne as the input (and slightly more lights to show the gain input) what would the code for that look like?
p.s appologies if this is too far removed from the project
Harrymatic
Harrymatic sagt: Mär 27, 2011. 10:28 vorm.
Very well presented and informative, but it does seem like overkill as the same thing could be done with a transistor. But then again, I'm the kind of person that prefers to fix something with a soldering iron than writing code.
smaqil
smaqil sagt: Mär 21, 2011. 7:59 nachm.
HI i am trying to make this project for my class ..every think is working but only the LED's are not insync with the music and some of the coding i am not getting. if sum one please help me and tell me whts the problem and where is the problem for insync i have to submit this project by next week thank you
matrixneowoman
matrixneowoman sagt: Feb 22, 2011. 5:49 nachm.
Found solution to that. Now it is stating a NullPointer at the file that I put in. Is it too large?
matrixneowoman
matrixneowoman sagt: Feb 22, 2011. 4:36 nachm.
I get a message stating that it cannot find a class for BeatListener. What am I missing?

Here's the exact message:
Cannot find a class or type named "BeatListener"
gang601
gang601 sagt: Jan 6, 2012. 1:28 vorm.
As you put "BeatWriter" into processing, Do it like same~
useraaaaa
useraaaaa sagt: Feb 1, 2011. 8:31 vorm.
that suxx..
"Download and unzip the attached folder of code below (BeatWrite.zip)."

i expected to see audio out connected to analog input
Hyrulian
Hyrulian sagt: Feb 1, 2011. 9:24 vorm.
Nope, that's not this tutorial, anyway - this is for analyzing an audio file that is played on your computer and transmitted via USB.

~Hyrulian
ringofrizz
ringofrizz sagt: Jan 26, 2011. 5:04 nachm.
Help me please, I'm a noob! :(

In processing, in line 35,

arduino = new Arduino(this, Arduino.list()[1], 57600);

I get an error saying, ArrayIndexOutOfBoundsException: 1

What do I do? I've had my Arduino Duemilaneve for about 4 days now, so I'm really a noob, Haha :p

Please help,
much appreciated.
Hyrulian
Hyrulian sagt: Jan 26, 2011. 8:51 nachm.
Hi ringoffrizz,

Take a look at the post I made to Sentinel in the comments below. I have quoted it here for your convenience:

It looks like you have other serial devices connected to your computer, other than the Arduino. Try calling Arduino.list() on its own line in the setup() portion of the program, like this:

void setup() {
println(Arduino.list());
}

Then choose the appropriate Arduino listing when you make a new Arduino object, like this:

arduino = new Arduino(this, Arduino.list()[Whatever index you find in the Arduino.listI()], 57600);

~Hyrulian
ringofrizz
ringofrizz sagt: Jan 26, 2011. 10:29 nachm.
Thank U soooooooo much for the help Hyrulian, thank U for your fast response also!

Ok, println fixed that error, but now I get an error with the next line, line 36

size(512, 200, P3D); gest a "It looks like you're mixing "active" and "static" modes." error.

What should I do about this 1?

Thanks again for all your help!

I hope I'm not to much much of a bother, haha :P
Hyrulian
Hyrulian sagt: Jan 27, 2011. 7:29 vorm.
Hi ringofrizz,

You're not a bother at all, here's your problem, on this line:

void setup() {println.Arduino.list();}

You forgot to take out the ending bracket here when you were debugging. Take out the last curly bracket on this line, and you should be good, like this:

void setup() {println.Arduino.list();

~Hyrulian
ringofrizz
ringofrizz sagt: Jan 27, 2011. 3:33 nachm.
Well YAY! :D haha :p

That kinda fixed it, but I get a different error this time

void setup() {println.Arduino.list(); says " Cannot find anything named "println" "

Grrrr! This is getting a bit flustering ):

-ringofrizz
Hyrulian
Hyrulian sagt: Jan 27, 2011. 8:23 nachm.
Haha, there's one other problem with that line, instead of

println.Arduino.list();

you should have

println(Arduino.list());

with the parentheses.

~Hyrulian
ringofrizz
ringofrizz sagt: Jan 28, 2011. 2:38 nachm.
Ok, I changed it to void setup() {println(Arduino.list());

But then I get a "ArrayIndexOutOfBoundsException: 1" error on

arduino = new Arduino(this, Arduino.list()[1], 57600); still.

I don't get whats wrong :(




/**
* This sketch demonstrates how to use the BeatDetect object in FREQ_ENERGY mode.

* You can use isKick, isSnare, isHat, isRange,
* and isOnset(int) to track whatever kind of beats you are looking to track, they will report
* true or false based on the state of the analysis. To "tick" the analysis you must call detect
* with successive buffers of audio. You can do this inside of draw, but you are likely to miss some
* audio buffers if you do this. The sketch implements an AudioListener called BeatListener
* so that it can call detect on every buffer of audio processed by the system without repeating a buffer
* or missing one.
*


* This sketch plays an entire song so it may be a little slow to load.
*/

import processing.serial.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import cc.arduino.*;

Minim minim;
AudioPlayer song;
BeatDetect beat;
BeatListener bl;
Arduino arduino;

int ledPin = 12; // LED connected to digital pin 12
int ledPin2 = 8; // LED connected to digital pin 1
int ledPin3 = 2; // LED connected to digital pin 0

float kickSize, snareSize, hatSize;

void setup() {println(Arduino.list());
size(512, 200, P3D);

minim = new Minim(this);
arduino = new Arduino(this, Arduino.list()[1], 57600);

song = minim.loadFile("Soy Bomb", 2048);
song.play();
// a beat detection object that is FREQ_ENERGY mode that
// expects buffers the length of song's buffer size
// and samples captured at songs's sample rate
beat = new BeatDetect(song.bufferSize(), song.sampleRate());
// set the sensitivity to 300 milliseconds
// After a beat has been detected, the algorithm will wait for 300 milliseconds
// before allowing another beat to be reported. You can use this to dampen the
// algorithm if it is giving too many false-positives. The default value is 10,
// which is essentially no damping. If you try to set the sensitivity to a negative value,
// an error will be reported and it will be set to 10 instead.
beat.setSensitivity(100);
kickSize = snareSize = hatSize = 16;
// make a new beat listener, so that we won't miss any buffers for the analysis
bl = new BeatListener(beat, song);
textFont(createFont("Helvetica", 16));
textAlign(CENTER);

arduino.pinMode(ledPin, Arduino.OUTPUT);
arduino.pinMode(ledPin2, Arduino.OUTPUT);
arduino.pinMode(ledPin3, Arduino.OUTPUT);
}

void draw() {
background(0);
fill(255);
if(beat.isKick()) {
arduino.digitalWrite(ledPin, Arduino.HIGH); // set the LED on
kickSize = 32;
}
if(beat.isSnare()) {
arduino.digitalWrite(ledPin2, Arduino.HIGH); // set the LED on
snareSize = 32;
}
if(beat.isHat()) {
arduino.digitalWrite(ledPin3, Arduino.HIGH); // set the LED on
hatSize = 32;
}
arduino.digitalWrite(ledPin, Arduino.LOW); // set the LED off
arduino.digitalWrite(ledPin2, Arduino.LOW); // set the LED off
arduino.digitalWrite(ledPin3, Arduino.LOW); // set the LED off
textSize(kickSize);
text("KICK", width/4, height/2);
textSize(snareSize);
text("SNARE", width/2, height/2);
textSize(hatSize);
text("HAT", 3*width/4, height/2);
kickSize = constrain(kickSize * 0.95, 16, 32);
snareSize = constrain(snareSize * 0.95, 16, 32);
hatSize = constrain(hatSize * 0.95, 16, 32);
}

void stop() {
// always close Minim audio classes when you are finished with them
song.close();
// always stop Minim before exiting
minim.stop();
// this closes the sketch
super.stop();
}


-ringofrizz (:

Hyrulian
Hyrulian sagt: Jan 28, 2011. 3:33 nachm.
We're back to your original issue, here - you need a different number than "1" on this part: Arduino.list()[1]. The whole reason we're printing out the list is so you can find your Arduino in the list of serial devices. Try this code:

/**
* This sketch demonstrates how to use the BeatDetect object in FREQ_ENERGY mode.

* You can use isKick, isSnare, isHat, isRange,
* and isOnset(int) to track whatever kind of beats you are looking to track, they will report
* true or false based on the state of the analysis. To "tick" the analysis you must call detect
* with successive buffers of audio. You can do this inside of draw, but you are likely to miss some
* audio buffers if you do this. The sketch implements an AudioListener called BeatListener
* so that it can call detect on every buffer of audio processed by the system without repeating a buffer
* or missing one.
*


* This sketch plays an entire song so it may be a little slow to load.
*/

import processing.serial.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import cc.arduino.*;

Minim minim;
AudioPlayer song;
BeatDetect beat;
BeatListener bl;
Arduino arduino;

int ledPin = 12; // LED connected to digital pin 12
int ledPin2 = 8; // LED connected to digital pin 1
int ledPin3 = 2; // LED connected to digital pin 0

float kickSize, snareSize, hatSize;

void setup() {
println(Arduino.list());
}

void draw() {
background(0);
fill(255);
if(beat.isKick()) {
arduino.digitalWrite(ledPin, Arduino.HIGH); // set the LED on
kickSize = 32;
}
if(beat.isSnare()) {
arduino.digitalWrite(ledPin2, Arduino.HIGH); // set the LED on
snareSize = 32;
}
if(beat.isHat()) {
arduino.digitalWrite(ledPin3, Arduino.HIGH); // set the LED on
hatSize = 32;
}
arduino.digitalWrite(ledPin, Arduino.LOW); // set the LED off
arduino.digitalWrite(ledPin2, Arduino.LOW); // set the LED off
arduino.digitalWrite(ledPin3, Arduino.LOW); // set the LED off
textSize(kickSize);
text("KICK", width/4, height/2);
textSize(snareSize);
text("SNARE", width/2, height/2);
textSize(hatSize);
text("HAT", 3*width/4, height/2);
kickSize = constrain(kickSize * 0.95, 16, 32);
snareSize = constrain(snareSize * 0.95, 16, 32);
hatSize = constrain(hatSize * 0.95, 16, 32);
}

void stop() {
// always close Minim audio classes when you are finished with them
song.close();
// always stop Minim before exiting
minim.stop();
// this closes the sketch
super.stop();
}

Look at what it prints out in your Serial Monitor, then change the value of the number "1" to whatever value the Arduino is.

~Hyrulian
ringofrizz
ringofrizz sagt: Jan 28, 2011. 3:54 nachm.
Ok, thank U soooooooooooooooooooooooooooo much for writing i new code! :D

It seems everything works except I get

"Cannot find a class or type named "BeatListener" " on BeatListener bl; :(

-ringofrizz
Hyrulian
Hyrulian sagt: Jan 28, 2011. 4:13 nachm.
Do you have the BeatListener.pde file in the same folder as the BeatWrite.pde file?

~Hyrulian
ringofrizz
ringofrizz sagt: Jan 28, 2011. 6:50 nachm.
I do, yes :D

-ringofrizz
Hyrulian
Hyrulian sagt: Jan 29, 2011. 12:03 nachm.
Okay, make sure it's open in your current project (it's open in a tab in the Processing window).

~Hyrulian
ringofrizz
ringofrizz sagt: Jan 29, 2011. 1:51 nachm.
I know I sound stupid, but how do U do that? Haha :p

-ringofrizz
ringofrizz
ringofrizz sagt: Jan 26, 2011. 10:31 nachm.
My code looks like this now if it helps :)


/**
* This sketch demonstrates how to use the BeatDetect object in FREQ_ENERGY mode.

* You can use isKick, isSnare, isHat, isRange,
* and isOnset(int) to track whatever kind of beats you are looking to track, they will report
* true or false based on the state of the analysis. To "tick" the analysis you must call detect
* with successive buffers of audio. You can do this inside of draw, but you are likely to miss some
* audio buffers if you do this. The sketch implements an AudioListener called BeatListener
* so that it can call detect on every buffer of audio processed by the system without repeating a buffer
* or missing one.
*


* This sketch plays an entire song so it may be a little slow to load.
*/

import processing.serial.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import cc.arduino.*;

Minim minim;
AudioPlayer song;
BeatDetect beat;
BeatListener bl;
Arduino arduino;

int ledPin = 12; // LED connected to digital pin 12
int ledPin2 = 8; // LED connected to digital pin 1
int ledPin3 = 2; // LED connected to digital pin 0

float kickSize, snareSize, hatSize;

void setup() {println.Arduino.list();}
size(512, 200, P3D);

minim = new Minim(this);
arduino = new Arduino(this, Arduino.list()[1], 57600);

song = minim.loadFile("Soy Bomb", 2048);
song.play();
// a beat detection object that is FREQ_ENERGY mode that
// expects buffers the length of song's buffer size
// and samples captured at songs's sample rate
beat = new BeatDetect(song.bufferSize(), song.sampleRate());
// set the sensitivity to 300 milliseconds
// After a beat has been detected, the algorithm will wait for 300 milliseconds
// before allowing another beat to be reported. You can use this to dampen the
// algorithm if it is giving too many false-positives. The default value is 10,
// which is essentially no damping. If you try to set the sensitivity to a negative value,
// an error will be reported and it will be set to 10 instead.
beat.setSensitivity(100);
kickSize = snareSize = hatSize = 16;
// make a new beat listener, so that we won't miss any buffers for the analysis
bl = new BeatListener(beat, song);
textFont(createFont("Helvetica", 16));
textAlign(CENTER);

arduino.pinMode(ledPin, Arduino.OUTPUT);
arduino.pinMode(ledPin2, Arduino.OUTPUT);
arduino.pinMode(ledPin3, Arduino.OUTPUT);
}

void draw() {
background(0);
fill(255);
if(beat.isKick()) {
arduino.digitalWrite(ledPin, Arduino.HIGH); // set the LED on
kickSize = 32;
}
if(beat.isSnare()) {
arduino.digitalWrite(ledPin2, Arduino.HIGH); // set the LED on
snareSize = 32;
}
if(beat.isHat()) {
arduino.digitalWrite(ledPin3, Arduino.HIGH); // set the LED on
hatSize = 32;
}
arduino.digitalWrite(ledPin, Arduino.LOW); // set the LED off
arduino.digitalWrite(ledPin2, Arduino.LOW); // set the LED off
arduino.digitalWrite(ledPin3, Arduino.LOW); // set the LED off
textSize(kickSize);
text("KICK", width/4, height/2);
textSize(snareSize);
text("SNARE", width/2, height/2);
textSize(hatSize);
text("HAT", 3*width/4, height/2);
kickSize = constrain(kickSize * 0.95, 16, 32);
snareSize = constrain(snareSize * 0.95, 16, 32);
hatSize = constrain(hatSize * 0.95, 16, 32);
}

void stop() {
// always close Minim audio classes when you are finished with them
song.close();
// always stop Minim before exiting
minim.stop();
// this closes the sketch
super.stop();
}

oldsmarracin
oldsmarracin sagt: Apr 26, 2012. 7:35 nachm.
arduino = new Arduino(this, Arduino.list()[0], 57600);
try that
GeoffN
GeoffN sagt: Jan 10, 2011. 5:12 vorm.
Hi Hyrulian,

I am a real noob to Arduino and I have an Uno board and I think I have followed your instructions properly, but when I click play I end up with a screen of red text and the first line is "import' does not name a type. Any ideas on where I am going wrong.

Thanks
Geoff
Hyrulian
Hyrulian sagt: Jan 10, 2011. 6:18 vorm.
Hey Geoff,

It's all right, we all have to start somewhere. The red text means your IDE threw an exception, which means an error occurred. The main reason for this is that you're trying to run the code on the Arduino, when it actually runs on the PC. You'll need the Processing IDE to do this, from processing.org. Make sure you're using this program to run the script. There's more information for your issue here:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1246598776/0

Hope this helps,
~Hyrulian
GeoffN
GeoffN sagt: Jan 11, 2011. 2:32 vorm.
Hyrulian,
it is me back again with another problem, now when run is pressed it starts to load then a null pointer exception occurs. I searched for info about this and I believe its something to do with Java, also the TX light flickers.
Geoff
Hyrulian
Hyrulian sagt: Jan 11, 2011. 7:03 vorm.
Geoff,

What line does the NullPointerException occur on? It should say what line number. The TX light means it's trying to transfer something, but since it stops flickering, it gets cut short by the exception.

~Hyrulian
GeoffN
GeoffN sagt: Jan 11, 2011. 5:30 nachm.
Hyrulian,
I persevered and tried different songs and finally got it to play "yarhoo" the only error that shows now is this one:

====JavaSound Minim Error====
====Don't know the ID3 code PRIV

but apart from that it works.
Thanks for all your help
Geoff
Hyrulian
Hyrulian sagt: Jan 11, 2011. 7 nachm.
That's great, Geoff! Glad to know you got it working.

~Hyrulian
mman1506
mman1506 sagt: Dez 5, 2010. 6:26 nachm.
i have the lights setup on a large scale with Christmas lights the only problem is its a seizure inducing is there anyway to it allow to hold the beat for a second.
Hyrulian
Hyrulian sagt: Dez 6, 2010. 6:18 vorm.
Hi mman,

Taking a look at the code, find the line:

beat.setSensitivity(100);

This is where you can set how long it takes to register a new "beat," in milliseconds. In your case, if you wanted to hold the beat for a second, you would change the line to:

beat.setSensitivity(1000);

Hope this helps.

~Hyrulian
mman1506
mman1506 sagt: Dez 6, 2010. 7:21 vorm.
i experimented with the beat sensitivity but i found the only way to do it was add a delay before the the led off paragraph the only problem is theres slowdown in the script. i also combined kick snare and hat together since i only had 1 light channel. I also recorded a quick video http://www.youtube.com/watch?v=68tPmQ_VQ5g
Hyrulian
Hyrulian sagt: Dez 6, 2010. 8:08 vorm.
Wow, that looks really cool. Yeah, using delay() will cause overall slowdown and overhead with the Arduino, but it still seems to be doing a good job.

~Hyrulian
dfhdh24
dfhdh24 sagt: Nov 22, 2010. 7:10 vorm.
great project by the way. i was wodering how to make it loop instead of just stopping at the end
Hyrulian
Hyrulian sagt: Nov 22, 2010. 2:07 nachm.
Thanks dfhdh24. In order to make it loop instead of stopping, you could try putting it in a function called "void loop()" instead of "void setup()".
Sentinel07
Sentinel07 sagt: Nov 22, 2010. 6:18 vorm.
OK here is a new problem my friend is trying to get the processing to work but he keeps getting NullPointerException and the instruction "song.play();" keeps get highlighted any suggestions Hyrulian.
Hyrulian
Hyrulian sagt: Nov 22, 2010. 7:16 vorm.
It sounds to me like your friend doesn't have the .mp3 file loaded correctly. Tell him to make sure that he's typed the filename correctly in the "song = minim.loadFile("freebird.mp3", 2048);" line. Also, tell him to make sure that the .mp3 file is located in the "BeatWrite/data" folder, not the "BeatWrite" folder.

~Hyrulian
jin_yeugh
jin_yeugh sagt: Feb 26, 2012. 7:56 nachm.
I just tried moving the folder around and didn't realize that it had to be in the same folder as the BeatWrite file. I had it in the same zipped folder, but separate from the file. It works great now! Thanks for the pointer.
robinsunny
robinsunny sagt: Apr 30, 2012. 1:37 nachm.
i have the same problem, but i can't get mine to work at all. the file is in the right place, and the code is edited accordingly. Every time i "run" it, it keeps giving me the same error and goes back to this line. any thoughts?
Sentinel07
Sentinel07 sagt: Nov 8, 2010. 3:14 nachm.
On the processing I keep getting ArrayIndexOutOfBoundsException: 1 whenever I try to run it and this is line in the program that gets highlighted:

arduino = new Arduino(this, Arduino.list()[1], 57600);

I need some help figuring this out
Hyrulian
Hyrulian sagt: Nov 9, 2010. 9:31 vorm.
Hi Sentinel,

It looks like you have other serial devices connected to your computer, other than the Arduino. Try calling Arduino.list() on its own line in the setup() portion of the program, like this:

void setup() {
println(Arduino.list());
}

Then choose the appropriate Arduino listing when you make a new Arduino object, like this:

arduino = new Arduino(this, Arduino.list()[Whatever index you find in the Arduino.listI()], 57600);

~Hyrulian
ca.le
ca.le sagt: Nov 1, 2010. 7:07 nachm.
i am not sure why but on Processing it says that I am missing a package called "cc", and that I might be missing a library...
can anyone help? PLEASE
Hyrulian
Hyrulian sagt: Nov 1, 2010. 8:23 nachm.
Hi ca.le,

You might want to try checking out this link, it has a few solutions for your problem: http://processing.org/discourse/yabb2/YaBB.pl?num=1259105373/5

~Hyrulian
ca.le
ca.le sagt: Nov 2, 2010. 3:05 vorm.
thanks for the reply, it works now! yay!!!
btw great instructable
noik
noik sagt: Okt 16, 2010. 9:57 vorm.
I've been waiting for a long time for this instructable!,
Very nice