submission by jtoy
var fft,mic;
function setup(){
  var myCanvas = createCanvas(800,800); //you must keep this line unmodified
  band_count = 64
  fft = new p5.FFT(0,band_count);
  ellipse(400,400,50,50)
  //colorMode(HSB,100)
  spectrums=[]
  mic = new p5.AudioIn();
  mic.start();
  fft.setInput(mic);

  last_time = millis()
  prevs = []
}

function recurse(x,y,v,space,index){
  //fill(i,y*33%100,i+3%100)
stroke(i,255-y,i+y)
strokeWeight(10)
   w= map(frameCount%10,0,255,0,space)
 wtf = frameCount%space
newx=x+wtf
newy = y+sin(v)*space
//ellipse(x+wtf,y+sin(v)*space,10)
prevs[index] = {x:newx,y:newy}
if(prevs[index] !== undefined){
line(prevs[index].x,prevs[index].y,newx,newy)
}
 // ellipse(x,y,v,v)
  /*
  ellipse(x,y, v/4,v/4)
  rect(x*2,y/2,v/3,v/3)
  //stroke(255,12,100)
  stroke(v,v,v*3%100)      
  line(x,y,x+v,y*1.2)
 line(-x,-y,-x-v,-y*1.2)
  if(v/2 > .5){
    //recurse(x*1.3,y*1.1,v*.7)
  }
*/
}

function draw() {
  background(0,5)
  //background(255)
  //noStroke()
//frameRate(10)
  ellipse(mouseX,mouseY,20,20)
   s = fft.analyze()
   //console.log(s.length)
   d= sqrt(band_count)
   //console.log(d)
space = width / d
if(millis() - last_time > 100){
   for(i=0;i<d;i++){
   for(y=0;y<d;y++){
     //console.log(d*i+y)
         r=map(s[d*i+y],0,255,0,10)
index = d*i+y
//prevs[index] = {x:newx,y:newy}
     recurse(i*space,y*space,s[d*i+y],space,index)
   }
  }
  last_time=millis()
}

}