xxxxxxxxxx
var mic;
function setup() {
createCanvas(500, 500);
rectMode(CENTER);
mic = new p5.AudioIn();
mic.start();
}
function draw() {
background(0, 230, 230,);
translate(width/2, height/2);
fill(0, 270, 270,);
stroke(0, 270, 270);
strokeWeight(2);
let r = map(mic.getLevel(), 0, 0.5, 0, height);
rotate(r/50);
line(0, 0, 400, 80);
rotate(r/100);
line(0, 0, 400, 80);
rotate(r/150);
line(0, 0, 400, 80);
rotate(r/200);
line(0, 0, 400, 80);
rotate(r/250);
line(0, 0, 400, 80);
rotate(r/300);
line(0, 0, 400, 80);
rotate(r/350);
line(0, 0, 400, 80);
rotate(r/400);
line(0, 0, 400, 80);
}