xxxxxxxxxx
43
// MGOBRIAL : 20210920-MG MusicVisualizer-Bézier
//https://editor.p5js.org/MGOBRIAL/sketches/imSjRRYpM
/*
option + shift + ( : []
option + shift + / : \
option + Maj + ( : {}
Alt + Maj + L : ||
*/
function preload(){
compoSound=loadSound(compoSoundName);
}
function setup() {
frameRate(60);
cnv=createCanvas(600, 400);
W=width;
H=height;
cnv.mouseClicked(togglePlay); // user starts
compoSound.setVolume(0.5);
//noiseSeed(50);
//timeSlider = createSlider(1, 40, 20, 1)
/*______________
PREPARE sldArr
--------------*/
sldArrW=[2*W];
sldArrW=createSliderArray(sldArrW,0,W,1);
sldArrH=[2*H];
sldArrH=createSliderArray(sldArrH,0,H,1);
sldArrR=[2*R];
sldArrR=createSliderArray(sldArrR,0,R,1);
sldArrC=[2*C];
sldArrC=createSliderArray(sldArrC,0,C,1);
}
function draw() {
displayText();
changeBackground();
if(isCompoPlaying){
animBezierOnMusic();
}
}