Skip to content

feat(player): 음악 이론 정량 하니스 + 조성·선법 음높이 배선 - #51

Merged
redsunjin merged 2 commits into
mainfrom
feat/player-music-theory-harness
Aug 4, 2026
Merged

feat(player): 음악 이론 정량 하니스 + 조성·선법 음높이 배선#51
redsunjin merged 2 commits into
mainfrom
feat/player-music-theory-harness

Conversation

@redsunjin

Copy link
Copy Markdown
Owner

요약

"알고리즘을 검증할 방법" 논의의 실행 — 정량 하니스를 만들었고, 하니스가 실제 결함을 즉시 검출해 함께 수정했다.
스펙: docs/superpowers/specs/2026-08-04-player-music-theory-harness-design.md

하니스 (CI 게이트, tests/musicTheoryHarness.test.mjs + src/lib/musicTheory.js)

  • 선법 스케일 적합률 ≥ 95% (발음 큐의 피치 클래스 vs 세션 선법)
  • 박 그리드 정합 100%, 밀도 ≤ 2/박, 리드 큐 옥타브 초과 도약 ≤ 40%
  • golden 3픽스처 + transition 픽스처 전체에 적용

검출된 결함과 수정

  • 결함: 오디오 엔진이 harmony(조성/선법)와 motif 음정을 무시하고 레인 번호 고정 주파수(항상 A·C·E·G)를 사용 — "F dorian"이 라벨로만 존재 (적합률 **53.3%**로 검출)
  • 수정: chartMapper가 노트에 pitchMidi 부여(registerBand 옥타브 + tonic + 모티프 음정을 선법 스케일에 스냅) → 엔진이 midiToFrequency로 발음 (hold −1옥타브/accent +1옥타브 — 피치 클래스 보존). pitchMidi 없는 노트는 기존 레인 주파수 폴백.
  • 효과: 브랜치별 조성·선법·모티프가 실제 소리에 반영 — "fix=dorian, revert=phrygian"이 귀로 성립하는 기반 완성. 화음 동시 발성(코드 컬러 보이싱)은 다음 단계.

검증

  • 하니스 4건 GREEN(수정 전 스케일 적합률 테스트는 53%로 RED — 진짜 결함 검출 확인), 전체 npm run qa(node 86 + UI 33 + 하니스 8) 무회귀 — golden fingerprint 결정성 유지, build:extension 통과.

경계

player/ + 스펙 문서만 수정.

🤖 Generated with Claude Code

selimDGAX and others added 2 commits August 4, 2026 19:13
오디오 엔진이 harmony/motif를 무시하고 레인 고정 주파수를 쓰는 결함을
문서화하고, 스케일 적합률 등 정량 게이트와 pitchMidi 배선을 설계.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
정량 하니스(스케일 적합률·박 그리드·밀도·도약)를 CI 게이트로 추가.
하니스가 검출한 결함 — 오디오 엔진이 세션 조성/선법/모티프를 무시하고
레인 고정 주파수(항상 Am계)를 쓰던 문제(F dorian 적합률 53%) — 를
chartMapper의 pitchMidi 배선(registerBand 옥타브 + 모티프 음정을 선법
스케일에 스냅)과 엔진의 midiToFrequency 사용으로 수정. 이제 브랜치별
조성·선법이 실제 소리에 반영된다(적합률 95%+). pitchMidi 없는 노트는
레거시 레인 주파수 폴백으로 하위 호환.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b654585b0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

test('모든 픽스처: 발음 큐의 선법 스케일 적합률 ≥ 95%', () => {
for (const fixture of collectFixtures()) {
const { plan, cuePlan } = renderFixture(fixture.events);
const conformance = scaleConformance(cuePlan, plan[0].harmony);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate each session against its own harmony

When a fixture spans multiple branches or session gaps, buildMusicPlan returns multiple sessions while renderFixture combines all their notes into one cue plan. Passing plan[0].harmony therefore judges every later session against the first session’s tonic and mode, so correctly pitched later cues can make this gate fail—and later-session pitch defects can pass when they happen to fit the first scale. Partition the cues by session/event references and run conformance against each session’s own harmony.

Useful? React with 👍 / 👎.

@redsunjin
redsunjin merged commit 0b83eb9 into main Aug 4, 2026
4 checks passed
@redsunjin
redsunjin deleted the feat/player-music-theory-harness branch August 4, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants