B. Circular moving → Play sounds

Freesound - Freesound


https://openprocessing.org/sketch/1924619

サウンドの読み込み

let sound;

function preload(){
	//Load Sound
	sound = loadSound("680153__florianreichelt__rain-water-dripping.mp3");
}

サウンドのパン

let panning = map(posX,0,width,-1,1);
sound.pan(panning);

再生速度を縦軸で変更

let playbackRate = map(posY, 0.1, height, 2, 0);
playbackRate = constrain(playbackRate, 0.01, 4);
sound.rate(playbackRate);

マウスクリックで再生

function mousePressed(){
	playSound();
}