xxxxxxxxxx
var art;
let badblood;
let level;
let amplitude;
function preload(){
art = loadImage('soul_sista.jpg')
badblood = loadSound("badblood.mp3");
}
function setup() {
createCanvas(800, 750);
imageMode(CENTER)
badblood.play()
amplitude = new p5.Amplitude();
}
function draw() {
background(18);
level = amplitude.getLevel();
size = map (level, 0, 0.55,100, 400)
image(art, 400, 400, 550, 400)
stroke(210)
line(50, 100, 750, 100);
line(50, 700, 750, 700);
line(50, 100, 50, 700);
line(750, 100, 750, 700);
noStroke()
fill(114, 129, 214, 120)
ellipse(50, 100, level *250, 40);
ellipse(750, 100, level *250, 40);
ellipse(750, 700, level*250, 40);
ellipse(50, 700, level*250, 40);
}
function keyPressed(){
if (key == 'p'){
badblood.play();
}
if (key == 's'){
badblood.stop();
}
}