but like on my RPI i can’t even preload more as 6 files…
so after you get that running you can try to
step 2
make that loop / pause logic by a mouse distance / circle
what might mean overlapping possible
fading would be step 3
i try a simple volume mouse slider and it works fine
https://editor.p5js.org/kll/sketches/JBJClAVCA
function mouseVolume() {
if ( song.isLooping() ) {
fill(200);
triangle(10,height-10, width-10,height-30,width-10,height-10);
let amp = map(mouseX, 0, width,0,1);
fill(200,0,0);
rect( amp*width,height-30,5,20);
//print(amp);
masterVolume(amp);
}
}