tidalcycles / strudel

Web-based environment for live coding algorithmic patterns, incorporating a faithful port of TidalCycles to JavaScript
https://strudel.cc/
GNU Affero General Public License v3.0
584 stars 105 forks source link

refactor .draw to query once per frame #1018

Closed felixroos closed 1 month ago

felixroos commented 3 months ago

onPaint already queries once per frame at x cycles in the future and remembers all events until they are y cycles in the past. On each evaluation, all haps that are in the future are invalidated and queried again. this is a much more performance friendly approach, as each frame consistently queries 1/60s, while .draw currently queries a whole second at once, which can lead to visual jank. draw could also just invalidate / requery at eval time and query only one frame in the future at draw time.

felixroos commented 1 month ago

fixed with https://github.com/tidalcycles/strudel/pull/1024