Expanded chord detection, real-time tuning, improved FFT
Expanded chord detection to support 9 chord types (maj, min, sus2, sus4, dim, aug, 7, maj7, min7) with updated scoring and voting logic. Added pitch-filtered FFT path for improved tonal analysis. Introduced real-time, per-mode tuning of detection thresholds (harmonicity, separation, vote consensus) via keyboard shortcuts, with HUD display of current values. Refactored chord display and voting logic to handle expanded chord space. Added thread-safe tuning adjustment and helper methods. Overall, improved flexibility, accuracy, and user control for audio analysis.
This commit is contained in:
@@ -1253,7 +1253,9 @@ public sealed class FractalRenderer : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
int chordCode = features.DetectedChordRootIndex < 0 ? -1 : (features.DetectedChordRootIndex * 2 + (features.DetectedChordType == 1 ? 1 : 0));
|
||||
int chordCode = features.DetectedChordRootIndex < 0
|
||||
? -1
|
||||
: (features.DetectedChordRootIndex * 9 + Math.Clamp(features.DetectedChordType, 0, 8));
|
||||
if (chordCode != _lastChordCode)
|
||||
{
|
||||
_lastChordCode = chordCode;
|
||||
@@ -1609,7 +1611,19 @@ public sealed class FractalRenderer : IDisposable
|
||||
}
|
||||
|
||||
string root = NoteNames[features.DetectedChordRootIndex];
|
||||
return features.DetectedChordType == 1 ? root + " MIN" : root + " MAJ";
|
||||
return features.DetectedChordType switch
|
||||
{
|
||||
0 => root + " MAJ",
|
||||
1 => root + " MIN",
|
||||
2 => root + " SUS2",
|
||||
3 => root + " SUS4",
|
||||
4 => root + " DIM",
|
||||
5 => root + " AUG",
|
||||
6 => root + " 7",
|
||||
7 => root + " MAJ7",
|
||||
8 => root + " MIN7",
|
||||
_ => root + " MAJ"
|
||||
};
|
||||
}
|
||||
|
||||
private void SpawnFireworkRocket(float intensity)
|
||||
|
||||
Reference in New Issue
Block a user