3 ms·
I wanted to see how fast I could play the entire song: const interval = setInterval(() => document.getElementById('pixi-canvas').dispatchEvent(new MouseEvent("
by Nezteb 3y ago
I wanted to see how fast I could play the entire song:
const interval = setInterval(() => document.getElementById('pixi-canvas').dispatchEvent(new MouseEvent("mousedown", {bubbles: true})), 0);
- tiborsaas 3y agoThank 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
- rkuykendall-com 3y agoIt's fun adjusting the final number here. I found 100 to be entertaining.
- alana314 3y agorip headphone users :D