xxxxxxxxxx
let counter=0;
//let mic;
let mySound;
let amplitude;
function preload() {
shape1 = loadImage("1.png");
shape2 = loadImage("2.png");
shape3 = loadImage("3.png");
shape4 = loadImage("4.png");
sound = loadSound('Cameo - Back And Forth (Official Video).mp3');
}
function setup() {
createCanvas(windowWidth, windowHeight);
sound.setVolume(1);
sound.loop();
amplitude = new p5.Amplitude();
//mic = new p5.AudioIn();
//mic.start();
}
function draw() {
background(255, 100);
translate(width/2, height/2);
let amp = map(amplitude.getLevel(), 0, 1, 10, 3000);
//tint(55, 10, 130);
//var r = map(sound.getLevel(), 0, 2, 0, 200*PI);
//var s = map(sound.getLevel(), 0, 1, 0, );
//rotate(r);
image(shape1, -500, -150, amp);
image(shape2, -350, 0, amp);
image(shape3, -200, -100, amp);
image(shape4, -50, -50, amp);
}