xxxxxxxxxx
45
function setup() {
createCanvas(400, 400);
mic = new p5.AudioIn();
mic.start();
rectMode(CENTER)
}
function draw() {
background("pink");
var vol= mic.getLevel();
translate(random(-25*vol,25*vol),random(-25*vol,25*vol));
drawALERT (0, 0)
}
function drawALERT(x, y) {
//side knobs
strokeWeight(15)
stroke(88, 133, 145);
line(x+100, y+100, x+150, y+150);
line(x+300, y+100, x+250, y+150);
//middle knob
fill(88, 133, 145);
noStroke();
rect(x+200, y+100, 20, 50, 30);
// rect(x+280, y+120, 20, 50, 30);
//clock body
fill("white");
strokeWeight(20);
stroke("navy");
ellipse(x+200, y+200, 200, 200);
}