3 ms·
Thank you for this snippet, it inspired me to play to add some randomish groove :) function play(i) { document.getElementById('pixi-canvas').dispat
by tiborsaas 3y ago
Thank you for this snippet, it inspired me to play to add some randomish groove :)
function play(i) {
document.getElementById('pixi-canvas').dispatchEvent(new MouseEvent("mousedown", {bubbles: true}));
const wave1 = Math.sin(i);
const wave2 = Math.sin(i * 8);
const mod = ((1 + wave1 * wave2 * wave2) * .5) * 350;
delay = 150 + mod;
i += 0.01;
setTimeout(() => {
play(i);
// console.log(delay);
}, delay);
};
play(Math.PI);
Here's the wave: https://www.desmos.com/calculator/aqs7thumdm https://www.desmos.com/calculator/aqs7thumdm