Hey, after my first problem get solved here, I hope someone can help me again.
I want the shape (as you can hopefully see on the picture) is changing by sound input. When the sound is loud, the shape should be bigger and in a different color as if the sound is quieter. The inner circle is constantly in the same position. Just the outer circle should change the size.
This is my code so far:
float scale = 1;
int shapelength = 12;
int iterations = 22;
import ddf.minim.*;
Minim minim;
AudioInput in;
float[][][] shape_coords = new float[2][shapelength][2];
void setup() {
size(3840, 2160);
background (255, 48, 48);
minim = new Minim(this);
in = minim.getLineIn(); // Audio Input
// inner circle
shape_coords[1][0][0] = 1500 * scale;
shape_coords[1][0][1] = 1495 * scale;
shape_coords[1][1][0] = 1500 * scale;
shape_coords[1][1][1] = 1495 * scale;
shape_coords[1][2][0] = 1500 * scale;
shape_coords[1][2][1] = 1495 * scale;
shape_coords[1][3][0] = 1500 * scale;
shape_coords[1][3][1] = 1495 * scale;
shape_coords[1][4][0] = 1500 * scale;
shape_coords[1][4][1] = 1495 * scale;
shape_coords[1][5][0] = 1500 * scale;
shape_coords[1][5][1] = 1495 * scale;
shape_coords[1][6][0] = 1500 * scale;
shape_coords[1][6][1] = 1495 * scale;
shape_coords[1][7][0] = 1500 * scale;
shape_coords[1][7][1] = 1495 * scale;
shape_coords[1][8][0] = 1500 * scale;
shape_coords[1][8][1] = 1495 * scale;
shape_coords[1][9][0] = 1500 * scale;
shape_coords[1][9][1] = 1495 * scale;
shape_coords[1][10][0] = 1500 * scale;
shape_coords[1][10][1] = 1495 * scale;
shape_coords[1][11][0] = 1500 * scale;
shape_coords[1][11][1] = 1495 * scale;
// outer circle
shape_coords[0][0][0] = 1520 * scale;
shape_coords[0][0][1] = 485 * scale;
shape_coords[0][1][0] = 2020 * scale;
shape_coords[0][1][1] = 1150 * scale;
shape_coords[0][2][0] = 2535 * scale;
shape_coords[0][2][1] = 775 * scale;
shape_coords[0][3][0] = 2880 * scale;
shape_coords[0][3][1] = 1130 * scale;
shape_coords[0][4][0] = 3100 * scale;
shape_coords[0][4][1] = 1633 * scale;
shape_coords[0][5][0] = 2720 * scale;
shape_coords[0][5][1] = 1770 * scale;
shape_coords[0][6][0] = 2170 * scale;
shape_coords[0][6][1] = 1275 * scale;
shape_coords[0][7][0] = 1365 * scale;
shape_coords[0][7][1] = 1760 * scale;
shape_coords[0][8][0] = 725 * scale;
shape_coords[0][8][1] = 1160 * scale;
shape_coords[0][9][0] = 1520 * scale;
shape_coords[0][9][1] = 485 * scale;
shape_coords[0][10][0] = 2020 * scale;
shape_coords[0][10][1] = 1150 * scale;
shape_coords[0][11][0] = 2535 * scale;
shape_coords[0][11][1] = 1150 * scale;
}
void draw() {
strokeWeight (2);
//shaping
for (int j = 0; j < iterations; j++) {
stroke (118, 138, 0);
noFill();
beginShape();
for (int i = 0; i < shapelength; i++) {
curveVertex(lerp(shape_coords[0][i][0], shape_coords[1][i][0], float(j)/float(iterations)), lerp(shape_coords[0][i][1], shape_coords[1][i][1], float(j)/float(iterations)));
}
endShape();
}
}
Thanks a lot for any help!