Skip to content

Commit 7e03a1d

Browse files
grauxmusicclaude
andcommitted
display(key): always show relative minor instead of major
Gmaj → Emin, Cmaj → Amin, etc. Detection algo unchanged; conversion happens at output stage only. Python mirror updated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9441ac3 commit 7e03a1d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Source/ChordDetector.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ ChordDetectResult chordDetectBpmAndKey (const float* mono,
265265
for (int k = 1; k < 24; ++k)
266266
if (keyScore[k] > keyScore[bestK]) bestK = k;
267267

268-
juce::String key = juce::String (kNotes[bestK % 12]) + (bestK < 12 ? "maj" : "min");
268+
// Always display as minor: if major detected, convert to relative minor (same notes, root -3 st)
269+
int displayK = (bestK < 12) ? (((bestK + 9) % 12) + 12) : bestK;
270+
juce::String key = juce::String (kNotes[displayK % 12]) + "min";
269271

270272
//==========================================================================
271273
// BPM — autocorrelation of full onset envelope (all frames, drums included)

0 commit comments

Comments
 (0)