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:
+1
-6
@@ -17,11 +17,6 @@ public class DrumDetector
|
||||
readonly bool[] _subSnare = new bool[4];
|
||||
readonly bool[] _subBrass = new bool[4];
|
||||
|
||||
static readonly byte[] FreqKick = Freq.Compress4(new[] { 150, 150, 150, 150 });
|
||||
static readonly byte[] FreqSnare = Freq.Compress4(new[] { 50, 50, 50, 50 });
|
||||
static readonly byte[] FreqBrass = Freq.Compress4(new[] { 10, 10, 10, 10 });
|
||||
static readonly byte[] FreqSilent = Freq.Compress4(new[] { 10, 10, 10, 10 });
|
||||
|
||||
public void ProcessWindow(double[] magnitude, int sampleRate, int windowSize, int subTickIndex)
|
||||
{
|
||||
if (subTickIndex < 0 || subTickIndex > 3) return;
|
||||
@@ -66,7 +61,7 @@ public class DrumDetector
|
||||
public WaveFrame BuildFrame()
|
||||
{
|
||||
var intensity = new byte[4];
|
||||
var freqBytes = new byte[16]; // 4 sub-ticks × 4 bytes (but we use per-sub-tick freq)
|
||||
var freqBytes = new byte[4];
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user