From 7156fa71aeadf4ca3a48e4e38082cc9682fef75e Mon Sep 17 00:00:00 2001 From: jim kolpack Date: Fri, 9 Oct 2026 18:54:40 -0400 Subject: [PATCH] Extend scanline sweep to cover the full glitch window SCANLINE_SWEEP_DURATION was still a flat 160 ticks (8s) from when GLITCH_ACTIVE_SECONDS only covered a short burst -- fine at the time, since nothing animated past that burst anyway. Once GLITCH_ACTIVE_SECONDS was extended to cover the full show_static window, this fell behind: animation.Transformation holds at its last keyframe once its own declared duration elapses, so the scanline sweep visibly froze partway through while jitter/bands (sized against the full window) kept animating -- reported as "scanlines stop, but everything else is running." SCANLINE_SWEEP_DURATION is now derived from GLITCH_ACTIVE_SECONDS, same as jitter already is. _SCANLINE_CYCLE_TICKS (sweep speed) is kept fixed and SCANLINE_CYCLES derived from it, rather than the reverse, so the sweep doesn't also slow down as the window gets longer. Verified 1 negligible black-corner hit across 250 frames (consistent with the known benign corner-tick color blend, not a structural issue), 327KB worst-case payload (strong zoom + random position), well under the 460KB limit. --- subwave_nowplaying.star | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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