Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuously holds the same notes when tab/window is inactive. #3

Open
DylanDavidson opened this issue Apr 7, 2015 · 1 comment
Open

Comments

@DylanDavidson
Copy link

I noticed in Chrome 41 on Windows, that if I played the sample score from the demo and then switched tabs when a note was playing it would just continue playing that note continuously until I went back to the tab.

I imagine that it would be preferred for the score to continue playing when the user changes tabs/minimizes the window.

I believe this issue is tied to using requestAnimationFrame, as almost all browsers seem to pause this method when the tab is inactive, as explained in this StackOverflow post.

An alternate solution is to just stop the score temporarily if the tab is inactive, which should be easier.

@stewdio
Copy link
Owner

stewdio commented Apr 7, 2015

Hi Dylan. I see what you mean. My plan is to replace my poor excuse for a scheduling system with something that relies on either a continuous square wave oscillator (so I can change its frequency and thereby smoothly change speed) or anything else more accurate than what I’m doing right now. Sounds like part of that upgrade will require giving up on requestAnimationFrame as well. And yup—I do want the music to continue when a user switches tabs or windows or even applications because this would allow you to operate multiple Beep windows, other music applications, recording software, etc. I’m finishing up some other bits first but I’ll get to that shortly. (And thank you for pointing this out!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants