Hacker News new | ask | show | jobs
by jigneshhk 4054 days ago
When you unfocus the tab drum beats produces different sound. Is it a feature or bug?
3 comments

I think it is more how any JS script works, Chrome and Firefox (at least) slow down the process (for CPU consumption, to save battery... etc). Since that script is working using a setInterval to look ahead, he needs to wrap the setInterval in a Web Worker, so that thread is never runned slowly.
It's how WebAudio works. If the tab loses focus, the callbacks to the Audio Thread are throttled so the sequencing might be a bit messed up.
Pull the tab into a new window and you can then layer sounds.