Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

refactor([issue-1025]): source note→frequency from the canonical pitchDetect module

Adam Eivyb9999be3c9e2
diff --git a/client/src/lib/colorMatch.js b/client/src/lib/colorMatch.js
index 0ce3e7ed7b..90b7a43723 100644
--- a/client/src/lib/colorMatch.js
+++ b/client/src/lib/colorMatch.js
@@ -13,9 +13,11 @@
// Timing mirrors `scorePlayback.buildSchedule` exactly (same global note index,
// same `(60/bpm)·(beatValue/4)` quarter-beat duration) so a color-match cursor
// lines up note-for-note with both the rendered staff and the reference-tone
-// playhead.
+// playhead. The note→frequency mapping comes from `pitchDetect` — the shared
+// note↔frequency source of truth the tuner and detector also use — so a target
+// note and a detected note are compared on one tuning reference.
-import { noteToFrequency } from './scorePlayback.js';
+import { noteToFrequency } from './pitchDetect.js';
// Grade levels — the same three buckets the tuner uses (`pitchDetect.tuningQuality`),
// plus `missed` (no clear pitch detected while the note was active). Exported so
diff --git a/client/src/lib/colorMatch.test.js b/client/src/lib/colorMatch.test.js
index a4317c622a..b51731403c 100644
--- a/client/src/lib/colorMatch.test.js
+++ b/client/src/lib/colorMatch.test.js
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest';
import { parseScore } from './scoreNotation.js';
-import { noteToFrequency } from './scorePlayback.js';
+import { noteToFrequency } from './pitchDetect.js';
import {
buildColorMatchTimeline,
noteAtTime,