Phrase mode: QA updates (tempo timing verification, auto-continue, expanded library documented)

This commit is contained in:
2026-09-14 01:49:29 +02:00
parent 4f2ee8798a
commit fff512b4dd
5 changed files with 146 additions and 2 deletions

View File

@@ -344,6 +344,9 @@ export const PhraseTrainer = forwardRef<PhraseHandle, PhraseTrainerProps>(
if (localStorage.getItem('phraseDebug') === '1') {
w.__phraseDebug = () => ({
frames: rawFrameCount(),
audioNow: audioEngine.now(),
scoreStart: trainer.scoreStart,
spb: trainer.spb,
micGate: audioEngine.isAudible(),
micBlanked: audioEngine.isMicBlanked(),
phase: trainer.phase,
@@ -354,6 +357,7 @@ export const PhraseTrainer = forwardRef<PhraseHandle, PhraseTrainerProps>(
firstNote: events[0]?.pitch?.midi ?? null,
scoreOk,
material: phrase.material,
midis: events.map(e => (e.pitch ? e.pitch.midi : null)),
});
} else {
delete w.__phraseDebug;

View File

@@ -57,6 +57,10 @@ export interface PhraseTrainerApi {
/** Event index currently up (cursor for renderer/hints). */
readonly currentIdx: number;
readonly countInLeft: number;
/** Audio-clock start of the current run's score (diagnostics/QA). */
readonly scoreStart: number;
/** Seconds per quarter beat (diagnostics/QA). */
readonly spb: number;
readonly error: string | null;
readonly summary: PhraseSummary;
/** True when the current note is a repeated pitch still blocked by the
@@ -560,6 +564,8 @@ export function usePhraseTrainer(
statuses,
currentIdx,
countInLeft,
scoreStart: scoreStartRef.current,
spb: spbRef.current,
error,
summary,
start,