perf(viz): snappier reactivity across braille visualisers#59
Merged
Conversation
Users report the entire visualiser suite feels sluggish — not just the bar family. The shared sluggishness is the one-pole EnergyTracker used by ~20 viz with release=0.88 (tau ~258ms at 30fps), plus the PR #57 AGC whose 2.5s release was tuned for safety over feel. Tightening time constants where the viz is meant to track the beat (not slowly evolve textures) restores the "it's moving with the music" quality. scaling.rs (SpectrumScaler AGC, bars family): attack: 0.48 -> 0.735 (tau 50ms -> 25ms; kick snaps same frame) release: 0.013 -> 0.027 (tau 2.5s -> 1.2s; ceiling tracks sections) Per-viz EnergyTracker release retained 0.88 -> 0.75 (tau ~258ms -> 115ms): heartbeat, wave, scope, matrix, terrain, retro, rain, binary, butterfly, scatter, fire, sakura, ripples, bars_dot, bars_outline, classic_peak. bars_outline per-bar release: 0.85 -> 0.8 (tau 203ms -> 148ms, matches bars_dot). Deliberately untouched: - pulse, firework (0.3, 0.85) — delta-based transient detection needs a smoother baseline; tightening release defeats the spike trigger. - tunnel, vortex, plasma, metaballs, moire (>=0.9 retention) — these drive smoothly-evolving textures where jitter would read as noise, not snappiness. Existing scaling.rs unit tests (attack_faster_than_release, typical_listening_peak_fills_majority_of_pane, etc.) all pass under the new coefficients — the attack:release ratio is still ~27:1. Closes clitunes-lc4 / CLI-91
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SpectrumScalerAGC (attack 50ms → 25ms, release 2.5s → 1.2s) so the bar family snaps to transients and tracks song sections instead of averaging five seconds of audio into the ceiling.EnergyTrackerrelease coefficient 0.88 → 0.75 (tau 258ms → 115ms) on 16 viz whose energy drives amplitude, brightness, or spawn rate.bars_outlineper-bar release into line withbars_dot(0.85 → 0.80) so outline bars decay like their filled cousins.Why
Users reported the entire visualiser suite feels sluggish, not just the bar family. Two compounding sources:
PR fix(viz): log/dB scaling for bar visualisers #57's AGC was tuned for safety. A 2.5s release ceiling averages loudness over a whole song section; during that window bars lag behind the current dynamics. Tightening to 1.2s lets the ceiling track choruses/verses without strobing on brief dips. Attack also dropped to 25ms so a kick drum is reflected the same frame it arrives.
EnergyTrackerdefault pattern(0.5, 0.88, 500.0)is used by ~20 viz. The 0.88 retention on release means brightness and amplitude carry forward ~260ms of history — perceptually "moving on a delay". 0.75 retention halves that to ~115ms, which is still enough to hide FFT jitter but not enough to read as lag.The attack side (0.5 retention, tau ~48ms) was already fine and left alone. Transient-detection viz (pulse, firework at 0.3/0.85) deliberately use a slow baseline so their energy-delta triggers work — left untouched. Texture viz (tunnel, vortex, plasma, metaballs, moire at ≥0.9 retention) drive smoothly-evolving shaders where "snappy" reads as jitter — left untouched.
Per-viz changes
scaling.rsSpectrumScalerATTACKscaling.rsSpectrumScalerRELEASEbars_dot.rsEnergyTrackerreleasebars_outline.rsEnergyTrackerreleasebars_outline.rsbars_dot; bars stop hanging above the musicclassic_peak.rsEnergyTrackerreleaseheartbeat.rsEnergyTrackerreleasewave.rsEnergyTrackerreleasescope.rsEnergyTrackerreleasematrix.rsEnergyTrackerreleaseterrain.rsEnergyTrackerreleaseretro.rsEnergyTrackerreleaserain.rsEnergyTrackerreleasebinary.rsEnergyTrackerreleasebutterfly.rsEnergyTrackerreleasescatter.rsEnergyTrackerreleasefire.rsEnergyTrackerreleasesakura.rsEnergyTrackerreleaseripples.rsEnergyTrackerreleaseDeliberately untouched:
pulse,firework(transient detection needs slow baseline),tunnel,vortex,plasma,metaballs,moire(texture viz — jitter would read as noise, not snap).Test plan
scaling::+ per-viz tests pass under new coefficients)