bryanbraun / music-box-fun

A web app for making music box songs.
https://musicbox.fun
Other
53 stars 5 forks source link

Issues playing on Safari / Safari Mobile #7

Closed bryanbraun closed 4 years ago

bryanbraun commented 4 years ago

We fixed this once by switching to requestAnimationFrame, but it looks like it's back.

This time, I suspect it's a cross-browser intersectionObserver issue, because I can still hear some notes when scrolling up quickly.

bryanbraun commented 4 years ago

It looks like we can solve a lot of tempo issues if we use the WebAudio clock instead of the Javascript/computer clock for scheduling notes. This is a decent refactor, but early tests show a dramatic improvement in all browsers, so we're doing it.

Reference docs: https://www.html5rocks.com/en/tutorials/audio/scheduling/#toc-usingsettimeout

bryanbraun commented 4 years ago

I just pushed up a rebuilt playing and scrolling system that fixes this issue in all the browsers I've been able to test. I'm really happy about it!