diff --git a/index.html b/index.html index d9899d7..46a386a 100644 --- a/index.html +++ b/index.html @@ -1177,6 +1177,7 @@ function GuitarTuner({ onBack, onGoTuner, onGoBasics, onGoSongSearch }) { const [lockedString, setLockedString] = useState(null); const [tuned, setTuned] = useState({}); const [currentStringIdx, setCurrentStringIdx] = useState(0); + const [readyToMark, setReadyToMark] = useState(false); const ctxRef = useRef(null); const streamRef = useRef(null); const rafRef = useRef(null); @@ -1227,6 +1228,7 @@ function GuitarTuner({ onBack, onGoTuner, onGoBasics, onGoSongSearch }) { useEffect(()=>()=>stopMic(),[]); const inTune = Math.abs(cents) <= 8; + useEffect(()=>{ if(inTune && detectedFreq>0 && !tuned[activeString?.note]) setReadyToMark(true); },[inTune, detectedFreq]); const slightlyOff = Math.abs(cents) <= 20; const needleAngle = Math.max(-45, Math.min(45, cents * 0.9)); const needleColor = inTune ? C.sage : slightlyOff ? C.amber : C.coral; @@ -1320,7 +1322,7 @@ function GuitarTuner({ onBack, onGoTuner, onGoBasics, onGoSongSearch }) { const isActive = activeString && activeString.note===s.note; const isDone = tuned[s.note]; return ( -