I’m trying to get this code to run but I’m getting an error saying bufferSize does not exist and .in & .left cannot be recognized/exist. Not sure how to fix this error any suggestions? I’m trying to move the wave length according to the frequency of the shuffled song. Thanks. (put ** HERE for where I have errors)
//minim is the audio library allowing for us to play and pull the music in
import ddf.minim.*;
Minim minim;
AudioPlayer player;
boolean playeurInit = false;// que leplayer n'est pas lancé
boolean stop = true;
StringList tableau;
int current=0;
Star[] stars = new Star[100];
float speed;
color c;
int linesX = 40;
int linesY = 26;
float magnitude;
boolean voice = false;
float stepsX, stepsY, radius, intensity, movement, last_sum, scale, factor, wave, sum;
void setup() {
fullScreen();
noSmooth();
for (int i = 0; i < stars.length; i++) {
stars[i] = new Star();
}
minim = new Minim(this);
tableau=new StringList();
tableau.append("PUT SONG NAME HERE.mp3");
tableau.append("PUT SONG NAME HERE.mp3");
tableau.append("PUT SONG NAME HERE.mp3");
tableau.append("PUT SONG NAME HERE.mp3");
tableau.append("PUT SONG NAME HERE.mp3");
tableau.append("PUT SONG NAME HERE.mp3");
shufflePlayList();
String son = tableau.get(current++);
println(son);
player = minim.loadFile(son);
player.pause();
**HERE
factor = float(width)/tableau.bufferSize();
}
noCursor just makes the cursor diappeared
void draw(){
noCursor();
{
speed = map(mouseX, 0, width, 0, 20);
background(0);
translate(width/2, height/2);
for (int i = 0; i < stars.length; i++) {
stars[i].update();
stars[i].show();
}
}
{
translate(-width /2, -height /2);
c = color(170 + wave/2, wave*5, 255,255);
fill(random(0,255), random(0,255), random(0,255));
stroke(random(0,255), random(0,255), random(0,255));
strokeWeight(2);
sum = 0;
****HERE
for (int i = 0; i < tableau.bufferSize() - 1; i++)
{
if (voice) {
line(i*factor, height/2 + in.left.get(i)*last_sum + 1, i*factor+1, height/2 + in.left.get(i+1)*last_sum + 2);
sum += abs(in.left.get(i));
} else {
line(i*factor, height/2 + tableau.left.get(i)*last_sum + 1, i*factor+1, height/2 + tableau.left.get(i+1)*last_sum + .05);
sum += abs(tableau.left.get(i));
}
}
}
last_sum = sum;
{
fill(random(0,255), random(0,255), random(0,255));
ellipse(width /2, height /2, 500, 500);
noStroke();
}
{
ellipseMode(CENTER);
fill (0);
ellipse(width /2 -50,height /2 -50, 460, 450);
noStroke();
}
{
strokeWeight(2);
}
if (!stop) {
if (player.isPlaying() == false) {
if (current==tableau.size()-1) {
shufflePlayList();
}
String son = tableau.get(current++);
player = minim.loadFile(son);
player.play();
playeurInit = true;
}
}
}
void mouseReleased() {
if (stop == true) {
stop = false;
} else {
stop = true;
if (player.isPlaying() == true ) {
player.pause();
}
}
}
void stop() {
player.close();
minim.stop();
super.stop();
}
void shufflePlayList() {
current=0;
tableau.shuffle();
}