fix(dock): TRAX ladder gets the mic's ballistics (and a 33 Hz beat)

Reported: the TRAX bar moves, but its sampling looks far slower than the mic meter.

Cause: the TRAX number was a raw instantaneous peak per metering block — a stutter sampled by the UI
timer, with no smoothing. The mic looks fluid because it is smoothed at audio-callback rate.

Fix: the player now smooths its measured level with the SAME curve the mic uses
(MeterScale.NextLevel: fast attack, gentle decay), and the dock's meter clock runs at ~30 Hz instead
of 20. Two ladders that move alike, because they are the same ballistics.

Guard: MeterScaleTests pins the attack/decay behaviour alongside peak-hold.
This commit is contained in:
2026-10-30 13:28:32 -07:00
parent 839bc991a2
commit 2607ecf210
4 changed files with 19 additions and 3 deletions
+2 -2
View File
@@ -179,10 +179,10 @@ public partial class MainViewModel : ViewModelBase
_saveDebounce = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(1500) };
// Dock meters beat on their own 20 Hz clock instead of riding the mic's level callback.
// Dock meters beat on their own ~30 Hz clock instead of riding the mic's level callback.
// Coupling them to capture was a bug: with a silent or absent mic the ladder never
// refreshed, so a playing TRAX showed nothing (creator, 2026-10-30).
_meterTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(50) };
_meterTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(33) };
_meterTimer.Tick += (_, _) => TickMeters();
_meterTimer.Start();
_saveDebounce.Tick += (_, _) => SaveLayoutNow();