//println(volumeValue);// uncomment to debug only, else leave comment
////////sound stuff end////////
return volumeValue;
}
}
2.) His example sketch:
// 1) +++++ To make a sketch sound responsive the first step is to put the SoundRespond.pde file in the same folder
//with the sketch you are working on.
//++++++++++++++++++++++++++++++++
// 2) +++++ The second step is to copy the line below into your sketch above void setup() +++++
SoundRespond mySoundRespond;
//+++++++++++++++++++++++++++++++
float diam =60; //diameter of the circle
float xPos = 0; //the position of the circle left to right on x axis
float yPos = 200; //the position of the circle to to bottom on y axis
float speed = 3; // how many pixels the circle will move with each frame
float sndChng;
void setup() {
size(500,500);
// 3) +++++ The third step is to copy the line below into your sketch below size(width,height); +++++
// between the curly brackets of of setup()
mySoundRespond = new SoundRespond(this);
//++++++++++++++++++++++++++++++++++
smooth();
}
void draw() {
background(255); // redraw the background each frame to erase the previous circle
// Use values to draw an ellipse
noStroke();
fill(#831919);
ellipse(xPos,yPos,diam,diam);
// 4) +++++ The forth step is to choose a variable of something you want to change with sound +++++
// this has to be between the curly brackets of of draw().
// Copy and paste "mySoundRespond.adding(value);" and put a number in the place of the word ""value".
sndChng = mySoundRespond.adding(5);
//The number determines the amount of the sound response effect.
//For speed changes try 2.0-5.0 to start, size changes can be much larger numbers.
//++++++++++++++++++++++++++++++++++
//must multiply speed by sndChng! adding does not work!!
//uncomment constrain() below to keep circle moving
//sndChng = constrain(sndChng,1,10);
xPos = xPos + (speed*sndChng);
println("xPos " + xPos);
println("speed " + speed);
if ((xPos > width) || (xPos < 0)) {
speed = speed * -1;
}
}
I followed his first few instructions, copying the folder into my new sketch folder. In creating my own sketch, as well as trying to run this example, I received a "Found one too many { characters without a } to match it." message with the
import ddf.minim.*; // Variables and library imports
line highlighted in the SoundRespond file. I've been scanning this over and over - I cannot find a source for this error! Any suggestions on what I might be reading wrong?