Minim: Play a random song out of an array

i cut your main program flow out and put in prints:

float start, runtime;
void setup() {
  size(1200,100, P3D);
  start = millis();
}
 int loop = 0;
 
void draw() {
  loop++;
  runtime = millis() - start;
  if (mouseX > 1100) {
    println(loop+" > 1100 "+(int)random(3));
  } else if ((mouseX < 1100) && (runtime > 5000)) {
    println(loop+" < 1100 &&  runtime > 5000 "+(int)random(3));
  } else {
    println(loop+" walking");
  }
  if (runtime >= 20000) {
    start = millis();
    println(loop+" runtime >= 20000");
  }
}


now you see what you are doing to the computers audio player!

1 Like