Adding color to a spectrogram and making it round

This may help:

int time;
float angle;

void setup() 
  {
  size(500, 500);
  background(0);
  //angle = TAU/360; // this is 1 deg
  angle = TAU/90; // this is 4 deg
  }

void draw() 
  {
  translate(width/2, height/2);
  
  rotate(time*angle); //Increase angle with each increment of time
  
  strokeWeight(3);
  for(int rad = 0; rad<255; rad++) //Think of each step along radius as frequency
    {
    // if each frequency has an amplitude in an array you can use that for color!
    
    //float col = 128;
    int col = int(128 + 128*cos(rad*TAU/255)); // This was just for fun!
    
    //println(col);
    //stroke(col);   
    stroke(255 - col, 255-col, 0);
    point(rad, 0); 
    }
  
  time++; //time increases with each frame
  
  if (time >= 90) noLoop();
  }

I will leave the rest with you!
Lots of good resources here at the processing.org website!

:)

2 Likes