diff --git a/subwave_nowplaying.star b/subwave_nowplaying.star index e89e588..2faa533 100644 --- a/subwave_nowplaying.star +++ b/subwave_nowplaying.star @@ -596,9 +596,21 @@ def _glitch_jitter(zoom): # small periodic shifts are the only mechanism that actually works here. SCANLINE_COUNT = 4 SCANLINE_SPACING = ART_SLOT // SCANLINE_COUNT -SCANLINE_SWEEP_DURATION = 160 # 8s total at the default 50ms/tick -SCANLINE_CYCLES = 8 # how many times the sawtooth below repeats over that -_SCANLINE_CYCLE_TICKS = SCANLINE_SWEEP_DURATION // SCANLINE_CYCLES + +# Sized against the full show_static window (GLITCH_ACTIVE_SECONDS), not +# a fixed 8s -- it used to be a flat 160 ticks while GLITCH_ACTIVE_SECONDS +# only covered a short burst, which was fine since nothing animated past +# that burst anyway. Once GLITCH_ACTIVE_SECONDS was extended to cover the +# full window, this fell behind: animation.Transformation holds at its +# last keyframe once its own declared duration is up, so the scanline +# sweep visibly froze (while jitter/bands, sized against the full window, +# kept animating) for however much of the window was left after 8s. +# _SCANLINE_CYCLE_TICKS is kept fixed (same sweep speed as before) and +# SCANLINE_CYCLES derived from it, rather than the other way around, so +# extending the window doesn't also slow the sweep down. +_SCANLINE_CYCLE_TICKS = 20 # 1s per sawtooth cycle at the default 50ms/tick +SCANLINE_SWEEP_DURATION = GLITCH_ACTIVE_SECONDS * _GLITCH_TICKS_PER_SECOND +SCANLINE_CYCLES = SCANLINE_SWEEP_DURATION // _SCANLINE_CYCLE_TICKS def _glitch_scanlines(): # Modeled on SUB/WAVE's own scanlines, which sweep continuously via