strudel icon indicating copy to clipboard operation
strudel copied to clipboard

inactive window is throttled

Open felixroos opened this issue 2 years ago • 5 comments

when running the desktop app on macos (potentially also linux), the audio is throttled when the window is no longer visible. potentially related to https://github.com/tidalcycles/strudel/issues/549

it might work to move the scheduling to a web worker...

Maybe it's also a feature and not a bug, because it keeps you focused on the music, as it punishes you with choppy audio when you're alt tabbing away to your doom scrolling session :P

felixroos avatar Jun 29 '23 09:06 felixroos

this throttling can be avoided if the strudel window is the largest of them all (so at least 1px is always visible)

felixroos avatar Jun 29 '23 20:06 felixroos

Just to add a bit of use case to this - this (throttling of background tab on Safari) was the reason I had to look around for alternatives when I had first started using Strudel. I was hoping that this issue would’ve gone away by now 👻 (either by Strudel having changed something, or Safari having grown up a bit - this problem doesn’t happen in Chrome), but unfortunately it is still there.

The use case is to have a bit of generative music running, and expecting people to switch tabs: that music is intended to be played in the background. However because of this throttling, such a thing can’t be done in strudel currently. I had earlier worked around this by rendering the music to stems, and then using the “onended” callback from webaudio (which is not throttled) to schedule the next n+2 bars.

BTW I fully understand that the main focus of Strudel is live coding, where this isn’t a problem. Just sharing my use case.

mnvr avatar Jan 19 '24 16:01 mnvr

thanks for the insight, this might be fixed with https://github.com/tidalcycles/strudel/pull/900

felixroos avatar Jan 19 '24 16:01 felixroos

thanks for the insight, this might be fixed with #900

the clock doesnt fall appart but the audio engine can still produce cracks when it is not focused. Its definitely an improvement though

daslyfe avatar Jan 20 '24 16:01 daslyfe

Adding another use case here: in Chrome, i'm using Strudel to send midi patterns to my DAW (here Ableton) for a live set that combines live coding and performing with midi controllers connected to Ableton. This involves switching back and forth between Strudel and Ableton. Would greatly appreciate the fix to be able to use both softwares flexibly (e.g. in separate full screen views) <3 Thanks for this great product!

vincentreynaud avatar Jan 22 '24 16:01 vincentreynaud

fixed with https://github.com/tidalcycles/strudel/pull/900 / https://github.com/tidalcycles/strudel/pull/1004

felixroos avatar Mar 24 '24 21:03 felixroos