I'm confused why you would have more than one variable used for the rotation.
Here's an example I have where the rotation amount increases constantly each frame, but does additional rotation if it detects the mouse has moved horizontally. You should be able to replace that with an amount based on the sound input...
- float rot = 0;
- void setup(){
- size(220,220);
- noStroke();
- smooth();
- rectMode(CENTER);
- }
- void draw(){
- rot+=.01; // Constant rotation.
- rot+=map( abs(mouseX-pmouseX),0,width,0,1); // Additional rotation.
- rot%=TWO_PI;
- background(0);
- translate(110,110);
- fill(255,0,0);
- rotate( rot );
- rect(0,0,90,90);
- }