Cleanup pass: remove dead code, fix bugs, simplify

Dead code removed:
- MusicAnalyzer.BuildWaveFrame (replaced by DrumDetector + BuildMelodyFrame)
- MusicAnalyzer.ExtractFeatures simplified to melody-only (removed rhythm band)
- MusicAnalyzer.RhythmLow/RhythmHigh constants, TickFeature.RhythmFlux
- LiveCapture._liveMaxFlux + _prevRhythmMag (computed, never read)
- State.ActualA/ActualB, State.LastSentA/LastSentB (set, never read)
- Program.cs StrengthChanged handler (only wrote to dead fields)
- Command.Mode property (never referenced)
- DrumDetector.FreqKick/Snare/Brass/Silent static arrays (unused)

Bugs fixed:
- DrumDetector.BuildFrame: freqBytes was byte[16], now byte[4]
- CoyoteDevice fallback: use nameFilter param instead of hardcoded string

Refactoring:
- Server.DoStatus calls BuildStatusPush(null) instead of duplicating
- HeatMap: removed redundant colW assignment
- Removed unused System.Numerics imports from LiveCapture, MusicAnalyzer
This commit is contained in:
2026-08-09 14:01:19 +00:00
parent badc599dee
commit 1ab397767a
9 changed files with 8 additions and 103 deletions
-5
View File
@@ -15,8 +15,6 @@ public class State
public readonly ConcurrentQueue<WaveFrame> StreamA = new();
public readonly ConcurrentQueue<WaveFrame> StreamB = new();
public int ActualA, ActualB;
public int LastSentA, LastSentB;
public double LimitScaleA, LimitScaleB;
public byte[]? LastFreqA, LastIntA, LastFreqB, LastIntB;
public bool LastActiveA, LastActiveB;
@@ -133,8 +131,6 @@ public class State
: (byte)Math.Clamp(desired, 0, max);
var valA = ApplyLimit(DesiredA, MaxA, LimitModeA);
var valB = ApplyLimit(DesiredB, MaxB, LimitModeB);
LastSentA = valA;
LastSentB = valB;
LimitScaleA = DesiredA > 0 ? (double)valA / DesiredA : 0;
LimitScaleB = DesiredB > 0 ? (double)valB / DesiredB : 0;
DirtyA = false;
@@ -167,7 +163,6 @@ public class State
(modeA, modeB) = (modeB, modeA);
(freqA, freqB) = (freqB, freqA);
(intA, intB) = (intB, intA);
(LastSentA, LastSentB) = (LastSentB, LastSentA);
(LastFreqA, LastFreqB) = (LastFreqB, LastFreqA);
(LastIntA, LastIntB) = (LastIntB, LastIntA);
(LastActiveA, LastActiveB) = (LastActiveB, LastActiveA);