What I fixed today in MacAmp. The volume slider and the balance slider used to freeze the spectrum analyzer. Not anymore. The visualizer window freezing was caused by a run-loop mode mismatch: VisualizerPipeline.startPollTimer used Timer.scheduledTimer(withTimeInterval:repeats:block:), which schedules the timer on the run loop in .default mode only. During an active DragGesture (slider drag, click-and-hold), the main run loop switches to .eventTracking mode, pausing the .default-mode poll timer for the duration of the gesture. The visualizer's timer (already on .common mode) kept firing the body at 30 Hz, but it kept reading the same stale levels snapshot because the producer-side pollVisualizerData() had stopped running โ so the body re-evaluated with identical data and the spectrum looked frozen.
The fix replaces Timer.scheduledTimer(...) with a manually constructed Timer(...) registered via RunLoop.main.add(timer, forMode: .common). .common mode includes .eventTracking, so the data-poll timer keeps firing during gestures, the visualizer reads fresh frames, and the spectrum animates continuously through slider drags and click-and-holds.