feat(highway): render chord harmony fn.rn + voicing on 2D + 3D (§6.3.1, §6.6)#541
Merged
Conversation
….3.1, §6.6)
Add two OPTIONAL per-chord harmony annotations (feedpak 1.7.0), mirroring the
teaching-marks (fg/ch/sd) wire work:
- Chord.fn (instance): {rn, q, deg} harmonic-function object, key-dependent.
Validated by _validate_fn on BOTH decode and emit so a partial / out-of-range
fn (which would fail the schema's required-keys rule) never rides the wire.
Default-omitted, mirroring bend bnv.
- ChordTemplate.voicing (template): key-independent voicing-type string
("open", "triad", "shell", "drop2", "barre", ...). Emitted only when
non-empty; non-string wire values fall back to "".
Display/teaching only — never fed to a grader (honesty rule). fn auto-derivation
is DEFERRED (carry-only): a complete rn/q needs chord-quality analysis, and a
deg-only fn would be schema-invalid, so server.py carries author-provided fn
unchanged. GP import unchanged (no reliable per-chord function/voicing).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…1, §6.6) Draw the chord's harmonic-function Roman numeral (instance fn.rn) and its template voicing string, stacked above the chord name on both highways. A shared pure helper chordHarmonyLabels(fn, voicing) formats the two labels (empty when absent/malformed) and is node-tested against both files. Both labels are gated behind the EXISTING teaching-marks opt-in (_showTeachingMarks / teachingMarksVisible bundle flag) — they're chord-level teaching overlays, same class as sd/ch, so they stay off the default highway. 2D guards the empty-note-chord case; 3D reuses the gold chord-label sprite style. Render only — no scoring / NoteVerifier path is touched (honesty rule). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 21, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #334
PR 2 of 3 (stacked on #540). Renders the per-chord harmony annotations PR1 put on the wire. Editor authoring (PR3) follows.
What
Draws two chord-level harmony labels, mirroring the teaching-marks render (#538):
fn.rn— the chord instance's harmonic-function Roman numeral (e.g.ii7,V7).voicing— the template's key-independent voicing string (e.g.open,drop2).Both are stacked above the chord name on the 2D (
static/highway.js) and 3D (plugins/highway_3d/screen.js) highways. A shared pure helperchordHarmonyLabels(fn, voicing)formats them (''when absent/malformed) and is node-tested against both files via the extract-and-eval pattern.Gating
Both labels are gated behind the existing teaching-marks opt-in (
_showTeachingMarks/teachingMarksVisiblebundle flag) — they're chord-level teaching overlays, same class assd/ch, so they don't clutter the default highway.Honesty rule
Render only. No scoring / NoteVerifier path is touched.
Tested locally
node tests/js/highway_chord_harmony.test.js→ 6 passed (rn+voicing surfaced, whitespace trimmed, absent/non-string →'', both 2D and 3D helpers agree).node tests/js/highway_teaching_marks.test.jsstill passes.node --check static/highway.jsandnode --check plugins/highway_3d/screen.jsclean.sorted[0].fin the 2D fallback) — fixed by gating onsorted.length > 0; re-review clean.CI may be red on infra; the above was verified locally.
🤖 Generated with Claude Code