xxxxxxxxxx
let shape;
let mic;
let mySound;
let amplitude;
function preload() {
shape = loadImage("come_1x1.png");
sound = loadSound("come-on-kill-me.mp3");
}
function setup() {
createCanvas(windowWidth, windowHeight);
angleMode(DEGREES);
amplitude = new p5.Amplitude();
sound.setVolume(0.4);
sound.loop();
}
function draw() {
background(255, 100);
imageMode(CENTER);
translate(width/2, height/2);
let amp = map(amplitude.getLevel(), 0, 1, 10, 8000);
rotate(amp / 8);
image(shape, 0, 0, amp, amp);
}