would you please tell me what is the role of first number(-1) in code below in processing?
please find short executable code bellow. please note that after executing this code in processing, a circle and several lines will be appear. and they will change via sound level detected by microphone.
"import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
BeatDetect beat;
AudioInput player;
int r = 200;
float rad = 70;
void setup()
{
size(displayWidth, displayHeight);
minim = new Minim(this);
player = minim.getLineIn();
beat = new BeatDetect();
background(-1);
}
void draw()
{
beat.detect(player.mix);
fill(#1A1F18, 20);
noStroke();
rect(0, 0, width, height);
translate(width/2, height/2);
noFill();
fill(-1, 200);
if (beat.isOnset()) rad = rad*1.1;
else rad = 70;
ellipse(0, 0, 2*rad, 2*rad);
stroke(-1, 50);
int bsize = player.bufferSize();
for (int i = 0; i < bsize - 1; i+=5)
{
float x = (r)*cos(i*2*PI/bsize);
float y = (r)*sin(i*2*PI/bsize);
float x2 = (r + player.left.get(i)*1000)*cos(i*2*PI/bsize);
line(x, y, x2, y2);
}
}"
Best Regards