Song Code Not Running not sure how to fix

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();
}

@starkid===
there are a lot of errors in your code:

  • your tableau is an array of String: bufferSize() does not mean nothing for it! - You have to apply buffersize() to your player: player.bufferSize()

  • you cannot getlinein (left, right or mixed ) without importing minim audioInput and instantiating it:

AudioInput in;
in = minim.getLineIn(Minim.STEREO, 2048, 44100);

I imported minim audioInput and instantiated it and also changed it to bufferSize() but I’m still getting errors that I’m not sure how to fix. I’m getting an error saying that global variable left does not exist and an error saying expecting EOF, found “in”. For the EOF error I selected all my code and pressed CTRL T to format the code and try to find any extra or missing curly braces but I’m not sure where the error is for the braces. Any suggestions on how to fix them?

import ddf.minim.*;
AudioInput in;
Minim minim;
AudioPlayer player;

boolean playeurInit = false;
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;

in = minim.getLineIn(Minim.STEREO, 2048, 44100);

wave jagged
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();
factor = float(width)/player.bufferSize();
}


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; 
   

  for (int i = 0; i < player.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();
}

I imported minim audioInput and instantiated it and also changed it to bufferSize() but I’m still getting errors that I’m not sure how to fix. I’m getting an error saying that global variable left does not exist and an error saying expecting EOF, found “in”. For the EOF error I selected all my code and pressed CTRL T to format the code and try to find any extra or missing curly braces but I’m not sure where the error is for the braces. Any suggestions on how to fix them? Thanks a ton!


import ddf.minim.*;
AudioInput in;
Minim minim;
AudioPlayer player;

boolean playeurInit = false;
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;

in = minim.getLineIn(Minim.STEREO, 2048, 44100);



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("NAME OF SONG.mp3");
  tableau.append("NAME OF SONG.mp3");
  tableau.append("NAME OF SONG.mp3");
 tableau.append("NAME OF SONG.mp3");
 tableau.append("NAME OF SONG.mp3");
 tableau.append("NAME OF SONG.mp3");
 

  shufflePlayList();
  String son = tableau.get(current++);
  println(son);
  player = minim.loadFile(son);
  player.pause();
  factor = float(width)/player.bufferSize();
}




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; 


    for (int i = 0; i < player.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();
}
}

@starkid====
not time enough to look at your code in details (for eof)
yet i can see at first sight that your way to instantiate in is wrong
you have to write this line of code inside setup, && after minim is instatiated: ```

minim = new Minim(this);
in = minim.getLineIn(Minim.STEREO, 2048, 44100);

Oh right, I don’t know why I didn’t put it inside setUp. Got it to work now thanks a ton!