diff --git a/src/App.jsx b/src/App.jsx index d894fec..4691d2d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -17,15 +17,17 @@ const KEY_VOTE_THRESHOLD = 9 // out of 12 const CHORD_NOTE_BOOST = 3 // confirmed chord tones injected N× into note history // Chord detection tuning -const CHROMA_SMOOTH = 12 // frames to average (~200ms at 60fps) -const CHORD_VOTE_THRESHOLD = 3 // consecutive identical detections required +const CHROMA_SMOOTH = 8 // frames to average — more responsive +const CHORD_VOTE_THRESHOLD = 2 // consecutive identical detections required +const CHORD_MIN_SCORE = 0.38 // lower = more chord types detected export default function App() { // ── Listening state ────────────────────────────────────────────────────── const [isListening, setIsListening] = useState(false) - // ── Instrument view ─────────────────────────────────────────────────────── + // ── Instrument view + tuner ─────────────────────────────────────────────── const [instrument, setInstrument] = useState('guitar') // 'guitar' | 'piano' + const [showTuner, setShowTuner] = useState(false) // ── Key: auto-detected + optional lock ─────────────────────────────────── const [keyInfo, setKeyInfo] = useState(null) // auto-detected @@ -168,7 +170,7 @@ export default function App() { for (const frame of ring) for (let i = 0; i < 12; i++) avg[i] += frame[i] for (let i = 0; i < 12; i++) avg[i] /= CHROMA_SMOOTH - const chord = matchChordFromChroma(avg, key, bassPC, false) + const chord = matchChordFromChroma(avg, key, bassPC, false, CHORD_MIN_SCORE) if (!chord) { // Ambiguous moment (transition, silence) — reset streak, history is untouched chordVotesRef.current = [] @@ -203,26 +205,27 @@ export default function App() { const currentChord = chordHistory[chordHistory.length - 1] return ( -
Real-time key detection for real humans
+Real-time key detection for live jams