Hi, does anyone know how to fix this error, my sketch works when I use a different svg file but not on other svg files. I can’t work out what might be causing this? This is the error that comes up : arrayindexoutofboundsexception: 55
timport ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;
import processing.serial.*;
import geomerative.*;
Minim minim;
AudioPlayer player;
AudioInput input;
RShape grp;
RPoint[][] pointPaths;
float z = 0;
String inString; // Input string from serial port
String val; // Data received from the serial port
int lf = 10;
Serial myPort;
int sensitivity=100;
boolean ignoringStyles = false;
void setup()
{
//fullScreen();
print (Serial.list());
size(600, 600, P3D);
minim = new Minim(this);
player = minim.loadFile("WIND ONE.mp3");
input = minim.getLineIn();
player.play();
// I know that the first port in the serial list on my mac
// is always my FTDI adaptor, so I open Serial.list()[0].
// On Windows machines, this generally opens COM1.
// Open whatever port is the one you're using.
String portName = Serial.list()[1];
myPort = new Serial(this, portName, 9600);
myPort.bufferUntil(lf);
RG.init(this);
RG.ignoreStyles(ignoringStyles);
RG.setPolygonizer(RG.ADAPTATIVE);
grp = RG.loadShape("E.svg");
grp.centerIn(g, 100, 1, 1);
pointPaths = grp.getPointsInPaths();
}
void draw()
{
//z = 10 * sin( frameCount/50.0 * PI);
print(inString);
background(0);
loadShape("E.svg").disableStyle(); // Ignore the colors in the SVG
fill(255); // Set the SVG fill to blue
stroke(0);
for(int i = 0; i < player.bufferSize() - 1; i++)
{
inString=str(sensitivity*(player.left.get(i)));
}
float Random_var=(float(inString)/400)*50;
translate(300,300,z);
for(int i = 0; i<pointPaths.length; i++){
translate((random((Random_var))),(random((Random_var))),z);
if (pointPaths[i] != null) {
beginShape();
for(int j = 0; j<pointPaths[i].length; j++){
vertex(pointPaths[i][j].x, pointPaths[i][j].y);
}
endShape();
}
}
}
void serialEvent(Serial p) {
inString = p.readString();
}ype or paste code here