Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c18c71598 | |||
| e87b2bbdcc | |||
| a7dbd6a8b1 | |||
| d24bf352e1 | |||
| 70263e221e | |||
| c999c958cb | |||
| ffc1bb1d18 | |||
| 5f4e2b715d | |||
| b753b58f70 | |||
| 272f88a7b4 | |||
| acb178e8d8 | |||
| 218c0ba4ca | |||
| af7c3cc0a7 | |||
| 4650494f0d | |||
| 677d7b99d1 | |||
| 7d6fe8ad50 | |||
| c899132b94 | |||
| 01a7c32f55 | |||
| 2450318d42 | |||
| 996218f39c | |||
| 7d1f64c718 | |||
| 090d3a9cbf | |||
| 6f59add11b | |||
| facf6c8cc3 | |||
| 9772e951b7 | |||
| 81cd230a4c | |||
| 0b982f9514 | |||
| ce24d5490f | |||
| c78baf4943 | |||
| 5e9b4c5925 | |||
| 4cc0009983 | |||
| b51daa1339 | |||
| 7926783778 | |||
| 6c7a1a7828 | |||
| fdd93c7158 | |||
| 0945a08497 | |||
| 401d9d1f17 | |||
| 3077ae2ac0 | |||
| fab385a612 | |||
| b5073353ef | |||
| 0f24c757a1 | |||
| 72c6d457b0 | |||
| 2165bb571c | |||
| 564a9e0a3a | |||
| b4e8f12539 | |||
| e24aa4b6ed | |||
| ee009a708d | |||
| 0f9c87c1e8 | |||
| e2110ae21f | |||
| db397f6ceb | |||
| ee81326db0 | |||
| 9e2567cf20 | |||
| 78706ce5ba | |||
| 6ea1089295 | |||
| 432a238c15 | |||
| c08b334bad | |||
| 951d5440e1 | |||
| f4e0ac67e0 | |||
| 3c903ad1d9 | |||
| 44d9c4f0e8 | |||
| 0eeb308aa8 | |||
| 793e60ab05 | |||
| 96dda6a3ef | |||
| 7b669f8c11 | |||
| 4b0f0c84a7 | |||
| 396c6ba562 | |||
| 4424e8d72c | |||
| 4727645bb9 | |||
| f98528733d | |||
| fe49af36ac | |||
| 096e431157 | |||
| e2a1552843 |
+216
-2
@@ -7,7 +7,186 @@ The shared queue all agents read and write. Lifecycle and rules: [`PROTOCOL.md`]
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Active sprint: `sprint-jam-guide` (branch: `sprint-jam-guide`)
|
## Active sprint: `sprint-roulette-kb` (branch: `sprint-jamguide-piano` — runs CONCURRENTLY with sprint-one-screen below; hourly cron, file-locks keep them disjoint)
|
||||||
|
|
||||||
|
**Goal (user directive 2026-07-11):** "a 12h loop with one iteration per hour for adding more piano licks and knowledge base voicings, potentially including some sort of circle of fifths etc in the knowledge center. on top of that … one button that would be a random chord progression selection. a button up top 'jam roulette' and then select a genre (like we have jazz, blues rock etc) and then have a random key chosen and an interesting progression show up as a loop in the screen. it would fill in the loop section and a 4 bar progression or something so that everyone can see the key and the chords to be played with different voicing so they can start playing… then musicians can start playing and it continues from it."
|
||||||
|
|
||||||
|
**Loop:** `/jam-loop` hourly × 12 (12 h), started 2026-07-11. Engineering tasks that need one-screen's files are dep-blocked on C-50 — content tasks fill the early iterations. Weights: Professor 3, Muse 2, Luthier 2, Critic gate.
|
||||||
|
|
||||||
|
| id | title | domain | status | depends-on | files (lock) | definition of done |
|
||||||
|
|----|-------|--------|--------|-----------|--------------|--------------------|
|
||||||
|
| M-07 | Seed `sprint-roulette-kb`; schedule hourly cron | maestro | done | — | `docs/agents/LEDGER.md` | seeded, cron created |
|
||||||
|
| C-60 | **Piano lick schema** (additive): licks today are guitar-tab-only — design the piano-lick shape reusing the bass-pattern language (per-note `deg` XOR typed `approach`, `beat`, `octave`, technique from a PIANO-appropriate vocab subset — decide which of the 8 words apply to keys and whether grace-note/roll style additions are needed; keep it validateable like C-41 did) in SCHEMA.md + validate-kb.mjs + smoke bite-test | quality | ready | — | `src/data/kb/SCHEMA.md`, `scripts/validate-kb.mjs`, `scripts/smoke.mjs` | schema documented; validator enforces; existing KB green; smoke proves it bites |
|
||||||
|
| D-60 | **PianoLickCard** renderer — visual rhyme with LickCard's tab idiom but for keys (timeline + MiniPiano-style pitches or a degree ladder — pick per readability at strip size); playback via chordAudio like BassPatternCard | design | backlog | C-60 | `src/components/PianoLickCard.jsx` (new) + LicksStrip wiring (re-lock at promotion — JamGuide.jsx is one-screen-locked until C-50) | renders every P-60 lick; playable; graceful empty/malformed |
|
||||||
|
| P-60 | Piano licks pack #1: 3-4 each for **jazz + blues** piano (C-60 schema; arithmetic-verified prose, the P-41 bar) | content | backlog | C-60 | `src/data/kb/jazz/piano.js`, `src/data/kb/blues/piano.js` | validator green; every lick playable as written |
|
||||||
|
| P-61 | Piano licks pack #2: 3-4 each for **gospel + rnb** piano | content | backlog | P-60 | `src/data/kb/gospel/piano.js`, `src/data/kb/rnb/piano.js` | validator green |
|
||||||
|
| P-62 | KB voicings expansion: **pop piano cell** (next per kb-backlog) + audit `GUITAR_SHAPES` for qualities with <3 placeable shapes and author additions where idiomatic | content | ready | — | `src/data/kb/pop/piano.js`, `src/data/kb/index.js`, `src/lib/voicings.js` (additive shapes only) | validator green; every new shape hand-verified (L-23 lesson: base-fret convention) |
|
||||||
|
| D-61 | **Circle of fifths** in the Knowledge Center: interactive SVG (12 keys around the circle, live/locked key highlighted, relative minor ring, diatonic chords on tap-free hover/inline, key-signature glyphs), mounted inside ExploreSection; educational copy in the app's voice | design | ready | — | `src/components/CircleOfFifths.jsx` (new), `src/components/ExplorePanel.jsx` (ExploreSection integration only) | renders any key incl. none-detected; follows effectiveKey live; tokens + AA; zero clicks for the core view |
|
||||||
|
| D-62 | **Jam Roulette UX spec** (doc): button up top ("Jam roulette", controls bar per one-screen's layout), genre picker (the 10 KB styles), randomization rules (random key; "interesting" progression selection — weight intermediate level + variety, avoid repeats within a session), how the seed fills the screen (seeds the committed loop + locked key so the banner/strip, voicing rail, licks, related progressions all populate exactly as if detected — reuse, don't duplicate), and the **detection handoff**: musicians start playing and live detection continues from the seed (spec the interplay with the L-31 commit layer: the seed behaves like a committed loop — replacement needs the same consistent evidence; New Song clears it) | design | ready | — | `docs/design/jam-roulette.md` | mechanism spec'd against the real App state (lockedKey, detectedProgression, progressionVoteRef); no state duplication; L-60 scope bounded |
|
||||||
|
| L-60 | Implement Jam Roulette per D-62 (App.jsx UI-state + seeding fn; the roulette button + genre menu; 🚨 audio contract grep-gated — seeding touches display state and the progression refs ONLY, never callbacks) | engineering | backlog | D-62, C-50 | `src/App.jsx` (+ per D-62 — re-lock at promotion) | one click → genre → key+progression fills the jam dashboard; detection continues from it; New Song clears; build + smoke green; contract grep clean |
|
||||||
|
| C-61 | Sprint-end sweep + PR #3 update | quality | backlog | L-60, D-60, P-61, P-62, D-61 | (none — verification) | all green; PR updated |
|
||||||
|
|
||||||
|
> Sequencing: C-60 ‖ P-62 ‖ D-61 ‖ D-62 are file-disjoint and ready now (none touch one-screen's locks). Then C-60 → {D-60, P-60 → P-61}, and D-62 + C-50(one-screen) → L-60. C-61 closes. Critic gates every task.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Active sprint: `sprint-one-screen` (branch: `sprint-jamguide-piano` — continued; commits extend PR #3)
|
||||||
|
|
||||||
|
**Goal (user directive 2026-07-11, after testing integrated-glance — "i like it a lot, so i would like to make some alterations"):**
|
||||||
|
|
||||||
|
1. **The top block is too big** — "the chord view and the chord loop incl the instrument below is too big, it takes up too much space… this main view doesnt really add value." Compress the detection area and the instrument view.
|
||||||
|
2. **Kill the big now-playing chord** — "seeing the big chord 'now playing' in big is also unnecessary as you already see that one in the chords (loop) part." The loop chips already carry it (playhead chip).
|
||||||
|
3. **Rethink ProgressionSuggestions** — "the suggested progressions on the right are also almost useless… we need to rethink them in the form of SUGGESTED VOICINGS and the progressions we add relating to the loop." Replace the generic genre table with (a) the suggested-voicings rail and (b) KB-sourced progressions RELATED to the detected loop.
|
||||||
|
4. **Voicings on the right** — "i'd like to have the suggested voicings on the right side of the screen (the jam guide)." The Jam Guide rail becomes a right column. (Overrides D-40's rejected side-by-side alternative — user directive wins.)
|
||||||
|
5. **One screen** — "i wanna see the chords, the loop, the voicings, the progressions, the licks all on one screen, everything you need to follow the jam correctly."
|
||||||
|
6. **Jam mode / fullscreen (refinement 2026-07-11):** "it can still have a scroll down, but the main concept needs to be in one screen: potentially we add a fullscreen button so we can just show that when we are playing a jam… everything that is learning and behind the scenes etc you can keep below/scrollable but we need one main view for live jams where we see everything at once." The dashboard fits 100vh as a hard constraint; a fullscreen/jam-mode button shows only it; KnowledgeDock/Debug/Tuner (LoopStation per Muse's call) live below in normal mode.
|
||||||
|
|
||||||
|
Standing principles (memory): scroll > click; nothing duplicated; one global instrument selector; playhead highlights, never hides. Weights: Muse 3, Luthier 3, Critic gate. No cron this sprint — Maestro drives on notifications. ⚠️ Spend-limit risk: the account limit was hit 2026-07-10; first dispatch is the probe.
|
||||||
|
|
||||||
|
| id | title | domain | status | depends-on | files (lock) | definition of done |
|
||||||
|
|----|-------|--------|--------|-----------|--------------|--------------------|
|
||||||
|
| M-06 | Seed `sprint-one-screen` | maestro | done | — | `docs/agents/LEDGER.md` | seeded |
|
||||||
|
| D-50 | One-screen dashboard concept doc: full-viewport grid at 1280×900 — LEFT: slim loop strip (banner without the big now-playing chord; playhead chip is the "now"), compact instrument view (decide the mechanism: height cap / reduced fret range / scale — honest about legibility), licks strip, related-progressions card; RIGHT column: the suggested-voicings rail (GlanceRail adapted to ~420-520px — decide cell strategy: recommended voicing prominent + gallery wrapped, sizes recomputed honestly per the D-40 corrected math); where LoopStation/collapsibles/KnowledgeDock land; what "related progressions" means computationally (KB-sourced: same style + level + degree-shape overlap with the loop — spec the ranking); narrow-viewport plan (columns stack); migration order with bounded L-50/D-51/L-51 scopes; ≥2 rejected alternatives. No user gate: pick strongest, record rationale | design | claimed | — | `docs/design/one-screen.md` | every component named incl. what's removed (big chord display, ProgressionSuggestions); honest space math (everything visible at 1280×900 with at most the licks/progressions row below a fold-flick); bounded scopes |
|
||||||
|
| L-50 | App restructure per D-50: grid columns, banner slimmed (big now-playing chord removed — ProgressionBanner edit), JamGuide rail moves to the right column, ProgressionSuggestions unmounted (file kept), instrument view compacted per doc, licks strip placed per doc. 🚨 App.jsx = layout/mounts/UI-state only, audio contract grep-gated | engineering | backlog | D-50 | `src/App.jsx`, `src/components/ProgressionBanner.jsx`, `src/components/JamGuide.jsx` (+ per doc — re-lock at promotion) | one-screen layout live; no duplicated info; build + smoke green; contract grep clean |
|
||||||
|
| D-51 | Rail right-column adaptation per D-50: GlanceRail/VoicingBrowser sizing for the narrow column (recommended-first cell strategy per doc), playhead highlight preserved, wrap never horizontal-scroll | design | backlog | D-50, L-50 | `src/components/GlanceRail.jsx`, `src/components/VoicingBrowser.jsx` (+ per doc) | rail readable at column width for guitar/piano/bass; zero clicks; build + smoke green |
|
||||||
|
| L-51 | RelatedProgressions component per D-50: KB-sourced, loop-relative (style + level + degree-shape overlap ranking per the doc's spec), replaces the old generic suggestions; mounts in the D-50 slot | engineering | backlog | D-50, L-50 | `src/components/RelatedProgressions.jsx` (new) + mount slot per doc | shows genuinely related KB progressions for a live loop; honest empty state; build + smoke green |
|
||||||
|
| C-50 | Sprint-end sweep + PR #3 update per PROTOCOL §6 | quality | backlog | L-50, D-51, L-51 | (none — verification) | all green; PR updated |
|
||||||
|
|
||||||
|
> Sequencing: D-50 first (everything hangs off it) → L-50 → D-51 ‖ L-51 (re-lock at promotion to enforce disjointness) → C-50. Critic gates every task.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Shipped sprint: `sprint-integrated-glance` (branch: `sprint-jamguide-piano` — complete 2026-07-10, 4 iterations, PR #3 updated)
|
||||||
|
|
||||||
|
**Goal (user directive 2026-07-10, after testing the glance-mode sprint — "its already a lot better, but"):**
|
||||||
|
|
||||||
|
1. **Move it up & integrate** — "i would like to move it up and integrate it somewhat in the space of the main module up top. or maybe right below it as it is super important." The Jam Guide content is currently the LAST mount in App.jsx (line ~712); the main module (ProgressionBanner + instrument view) is at ~609-622.
|
||||||
|
2. **One loop display** — "i would like to be able to see the loop clearly, no need to have this repeated again. as its already in the main module." ProgressionBanner (top) and the Roadmap track (inside JamGuide) both show the detected loop — exactly one clear loop display must survive.
|
||||||
|
3. **One instrument selector** — "only one selection for GUITAR/PIANO/BASS and everything should show in that instrument." App.jsx line 58 ALREADY holds global `instrument` state ('piano'|'guitar'|'bass') driving the main views; JamGuide ignores it and has its own internal tabs. Everything (voicings, licks, guide) must follow the one selector. Bass has a main-view BassFretboard but zero KB content — needs an honest state (and a stretch chain to make it real).
|
||||||
|
4. **All chords' voicings visible at once** — "it's difficult to see as it changes when the chord is not playing so i'd like to see all the chords and their voicings in a specific way in case a loop is detected (or at least just like 4 chords or something at least, so you can follow and potentially learn new ways to play it while you are playing the loop." The playhead accordion (only the active station expanded) is hard to follow live — show EVERY loop station's voicings simultaneously (≥4 chords), playhead highlights rather than reveals.
|
||||||
|
5. **Scroll-first** — "scrolling is easier then clicking." Layout principle for everything above.
|
||||||
|
|
||||||
|
**Loop:** `/jam-loop` every 30 min for 12 h (24 iterations), started 2026-07-10 evening (cron 13,43). "let each agent do a part and revise the work" — standard ensemble + gates. Weights: Luthier 3, Muse 3, Professor 2, Critic gate.
|
||||||
|
|
||||||
|
| id | title | domain | status | depends-on | files (lock) | definition of done |
|
||||||
|
|----|-------|--------|--------|-----------|--------------|--------------------|
|
||||||
|
| M-05 | Seed `sprint-integrated-glance`; schedule the 24×30m loop | maestro | done | — | `docs/agents/LEDGER.md` | seeded, cron created |
|
||||||
|
| D-40 | Integration concept doc: (a) where the Jam Guide content lands relative to the main module (in it vs right below — pick, record rationale); (b) which loop display survives (ProgressionBanner vs Roadmap track — the loser's unique value, e.g. guide-tone rails, must be honestly dispositioned); (c) JamGuide obeys App's existing global `instrument` — internal tabs retired; honest bass state until the bass chain lands; (d) the all-stations-expanded voicings layout (≥4 chords visible, playhead HIGHLIGHTS not reveals, scroll-first — the user explicitly licensed scrolling, so D-31's "everything expanded" rejection is overturned by directive); (e) what remains of the four-section dock below; (f) honest space math + migration order. No user gate: pick strongest, record rejected alternatives. **Returned once (2026-07-10):** piano worst-case Dm7-specific (G7 gallery ≈1,178px, roots above D need 2-octave crops → rows WRAP, screenful counts restated); LicksSection lives in JamGuide.jsx not ExplorePanel; ChordBox keeps importers (only RiffDiagram orphans); L-40 interim would ship the page-yank (GlanceRail scrollIntoView in page flow) — doc added the one-line effect deletion to L-40's lock, same-commit mandatory. Fixed + re-gate PASS (pixel-exact recompute: gallery 1,178, row 1,470, all table arithmetic verified) | design | done | — | `docs/design/integrated-glance.md` | doc names every component, the single-loop-display call, the instrument-threading contract, ≥2 rejected alternatives, bounded L-40/D-41 scopes |
|
||||||
|
| L-40 | App restructure per D-40: promote the Jam Guide content to the D-40 position; retire the duplicated loop display per the doc's call; JamGuide takes `instrument` as a prop from App's existing selector (internal tabs removed; VoicingsSection/LicksSection/ExplorePanel mounts follow too); honest bass empty-state. Ride-along (C-40 follow-up): add an export-only line to JamGuide's `resolveDegree` (JamGuide.jsx:73) so smoke §7 can sweep both copies directly (today it pins the validator side behaviourally). 🚨 App.jsx changes = layout/mount/UI-state ONLY — audio callbacks/refs/AudioCapture untouched (grep-gated) | engineering | done | D-40 | `src/App.jsx` (layout + UI-state only), `src/components/JamGuide.jsx`, `src/components/ExplorePanel.jsx` (VoicingsSection instrument prop), `src/components/GlanceRail.jsx` (scrollIntoView effect deletion ONLY, same commit as band promotion — D-40 §6.1) | one selector drives everything; guide content up top; loop shown exactly once; build + smoke green; audio contract grep-clean |
|
||||||
|
| D-41 | All-expanded voicings rail per D-40: every station's gallery visible simultaneously (≥4 chords), active station highlighted by the playhead (accent ring/header, NO reveal/hide), scroll-first reflow, licks strip follows the global instrument per the doc. **Folded (L-40 flag, 2026-07-10):** VoicingBrowser's `show` prop falls through unknown values to 'both' — the dock's VoicingsSection under bass passes show='bass' and renders BOTH galleries, violating D-40 §3 prose; fix in VoicingBrowser (honest bass empty-state or explicit 'bass' handling), lock extended accordingly. Also: bass row headers gain solo-scale/aim-dots here per D-40 row anatomy | design | done | D-40, L-40 | `src/components/GlanceRail.jsx`, `src/components/VoicingBrowser.jsx` (dense styling + show='bass' handling), `src/components/JamGuide.jsx` (row anatomy per doc) | all voicings of all loop chords on screen/scroll with zero clicks; playhead never hides content; AA + tokens; build + smoke green |
|
||||||
|
| C-40 | Drift guards in smoke (two hand-synced duplications, backlog debt): (a) JamGuide's `resolveDegree` copy vs validator's — 16-degree × 14-quality truth table; (b) technique vocab `validate-kb.mjs` LICK_TECHNIQUES ↔ `LickCard.jsx` TECHNIQUE_VOCAB. Ride-along: fix `scripts/loop-fixtures.mjs` header's stale "App.jsx:322-324" line-ref (C-31 sweep finding) | quality | done | — | `scripts/smoke.mjs`, `scripts/loop-fixtures.mjs` (comment only) | drift in either duplication turns smoke red (sabotage-proven); header ref current; smoke green |
|
||||||
|
| P-40 | Refresh `docs/kb-backlog.md`: mark all shipped cells done (gospel/pop guitar; jazz/gospel/rnb/blues piano), set the bass column as next (blues → jazz → funk per plan) | content | done | — | `docs/kb-backlog.md` | backlog reflects reality; next-cell pointer correct |
|
||||||
|
| C-41 | Bass play schema (additive): SCHEMA.md + validator + smoke bite-test for bass patterns (per-station patterns: root/fifth/approach-note walks — design the minimal honest shape with 4-string, fret 0-15 representation). Ride-along (C-40 gate finding): document in SCHEMA.md that `resolveDegree('7', maj6|min6)` = 9 (the 6th) in both hand-synced copies — a contract quirk, never misspells a chord, but authors should write `'6'` explicitly | quality | done | C-40 | `src/data/kb/SCHEMA.md`, `scripts/validate-kb.mjs`, `scripts/smoke.mjs` | schema documented; validator enforces; existing KB untouched-green; smoke proves the check bites |
|
||||||
|
| P-41 | First bass cell: **blues bass** (kb-backlog order blues → jazz → funk). C-41 gate notes: offset 11 (maj7 over qualities lacking it) is unrepresentable — if you hit it, STOP and report (schema extension, not workaround); approaches are terminal-only but mid-pattern passing tones are expressible as fixed degrees (b9/9/b3/11/b5/b13/6/b7 all covered) | content | done | C-41 | `src/data/kb/blues/bass.js`, `src/data/kb/index.js` | validator green; every pattern playable as written; prose arithmetic-verified |
|
||||||
|
| L-42 | Minimal bass pattern renderer for the guide (per-station BassPatternCard per D-40 §3; the computed root·fifth·approach line stays as fallback) — makes the BASS selector real end-to-end. C-41 gate note: `chrom-below` into a next root at open E has no pitch below the instrument — renderer must octave-displace the approach or place the root higher | engineering | done | C-41, P-41, L-40 | per D-40 doc — re-lock at promotion | bass stations render the authored patterns; guitar/piano paths untouched; build + smoke green |
|
||||||
|
| C-42 | Sprint-end sweep + PR #3 update per PROTOCOL §6. Folded (L-40 gate): wire smoke §7 to import JamGuide's now-exported `resolveDegree` (the jsx load hook already exists) and refresh the stale "unexported (checked 2026-07-10)" comment at smoke.mjs:855-862 — tiny Critic-owned fix inside the sweep | quality | done | L-40, D-41 | `scripts/smoke.mjs` (§7 wiring only) | all green; smoke sweeps both resolveDegree copies; PR updated |
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **P-40 PASS** — validator totals verbatim-match; ALL 14 cell play-counts recounted from the real registry (sum 164 ✓); lick arrays counted per style (4/4/4/4/4/3 = 23 ✓); 10 dates cross-checked against ledger + git commits, all hold; diff +36/−15 confined, format preserved. Non-blocking: piano next-cell = pop is a priority call (plan's default ranks bossa first — doc licenses reorder, accepted as Professor's call); L-42 row omits its L-40 dep (one word, fix if touched).
|
||||||
|
|
||||||
|
> Sequencing: D-40 ‖ C-40 ‖ P-40 file-disjoint, ready now. Then D-40 → L-40 → D-41 (App/JamGuide/GlanceRail serialized — same surfaces), and C-40 → C-41 → P-41 → L-42 (bass chain, stretch). C-42 closes. Critic gates every task.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Shipped sprint: `sprint-glance-and-loop` (branch: `sprint-jamguide-piano` — complete 2026-07-10, 4 iterations, PR #3 updated)
|
||||||
|
|
||||||
|
**Goal (user directive 2026-07-10):** three asks, in the user's words:
|
||||||
|
|
||||||
|
1. **All voicing variations in one view** — "in the music theory … see all the variations G shape, C shape, etc in one view without having to push a button. so they all line up next to each other." VoicingBrowser currently chip-switches one shape at a time; replace with a gallery that renders every shape/style side by side, each independently playable.
|
||||||
|
2. **Fix the loop logic** — "it doesn't recognize when 3 chords return, or when its 5 and then 2 others." `detectRepeatingProgression` (theory.js) does exact contiguous block matching, lengths 2–6: one spurious misdetected chord breaks a rep; a 5-chord loop followed by 2 foreign chords (tag/turnaround) is missed; 7–8-chord loops can't be found at all. Redesign to be noise-tolerant; tune the App.jsx commit layer so a committed loop survives fills.
|
||||||
|
3. **Glanceable learn session** — "expand the learn session so we see as much as possible in voicing variations and styles without having to click buttons, the idea is to have it open as the jam is playing." Knowledge Center should auto-follow the live jam with zero clicks.
|
||||||
|
|
||||||
|
**Loop:** `/jam-loop` every 30 min for 12 h (24 iterations), started 2026-07-10 (cron 13,43). User is away — no user-gated tasks; Muse picks the strongest option and records rationale. Weights: Luthier 3, Muse 3, Professor 1, Critic gate, Herald 0.
|
||||||
|
|
||||||
|
| id | title | domain | status | depends-on | files (lock) | definition of done |
|
||||||
|
|----|-------|--------|--------|-----------|--------------|--------------------|
|
||||||
|
| M-04 | Seed `sprint-glance-and-loop` from user directive 2026-07-10; schedule the 24×30m loop | maestro | done | — | `docs/agents/LEDGER.md` | sprint seeded, cron created |
|
||||||
|
| C-30 | Loop-detection truth fixtures: new `scripts/loop-fixtures.mjs` (+ smoke wiring) — realistic chord-history cases with expected loops: (a) clean 3-chord loop ×2–3 reps; (b) 3-chord loop with one spurious misdetection inside a rep; (c) consecutive duplicate commits of the same chord; (d) 5-chord loop followed by 2 foreign chords — loop must survive; (e) 7- and 8-chord loops; (f) section change loop-A→loop-B — detection must switch; (g) chromatic non-loop → null. Run each against the CURRENT `detectRepeatingProgression` and mark which fail today (`expectedFail: true`) so the suite is green now and L-30 flips the markers off | quality | done | — | `scripts/loop-fixtures.mjs`, `scripts/smoke.mjs` | fixtures runnable via smoke; failure map of the current algorithm documented in the fixture file header; smoke green (expected-fails annotated, not silently skipped) |
|
||||||
|
| L-30 | Redesign `detectRepeatingProgression` in `theory.js`: collapse consecutive duplicate chords before matching; tolerate ≤1 substitution/insertion per cycle (noise from misdetection); support loop lengths 2–8; recency-weighted scoring so an old section can't outvote the current loop; keep the pure signature, the rotation-`canonicalize` output, and every other export byte-untouched. Flip all C-30 `expectedFail` markers to passing. **C-30 findings folded in (2026-07-10):** (a) the `reps × len²` scoring artifact is the primary everyday bug — a clean 2-chord vamp ×4 reports a bogus 3-chord `[Am,Am,G]` via self-overlapping occurrences; candidate generation must reject candidates that are rotations/overlaps of a shorter period (not just exact periodic patterns at len ≥ 4); (b) 7/8-loops contain realistic non-adjacent internal chord repeats (`Am … Am`) — period detection must not collapse those into shorter false loops | engineering | done | C-30 | `src/lib/theory.js` (detectRepeatingProgression + private helpers only) | all C-30 fixtures green with zero expectedFail markers (incl. `vamp-2x4`/`vamp-2-sustained`); no other theory.js export changed; build + smoke green |
|
||||||
|
| L-31 | Commit-layer tuning in App.jsx's progression effect (lines ~154-173): a committed loop must survive transient misses (the miss-4-then-clear rule drops the loop during fills/turnarounds); a new loop replaces the old only with consistent evidence; first commit shouldn't need extra rounds when detection is already stable. **Primary trace case (C-30 finding, 2026-07-10):** pre-L-30 detection flaps between the true loop and ghost 4-patterns, so `progressionVoteRef` never sees 2 consecutive identical keys and nothing ever commits — verify post-L-30 stability makes the 2-vote commit reachable in the noisy fixtures, then tune (post-L-30 status: done). **L-30 gate findings folded in (2026-07-10):** (a) a 2-rep loop with one corrupted rep FLAPS through data-faithful sub-cycles commit-to-commit until the next clean rep — faster first-commit must NOT let a single transient sub-cycle detection replace an already-committed loop (replacement needs consistent evidence); note non-null detection resets the miss counter, so today's committed loop already survives the flap; (b) ride-along one-line fix: theory.js ~line 601-603 docstring overclaims "ghost occurs exactly once by construction" — false for same-chord-same-phase corruption (behavior fine, comment too strong); (c) deletions untolerated by design — fine at ≥3 reps, degrades to (a)'s flapping at exactly 2. 🚨 **Audio contract: touch ONLY the progression useEffect + its refs — no callback, ref-sync, or AudioCapture change** | engineering | done | L-30 | `src/App.jsx` (progression effect only) | loop survives fixture-style fills end-to-end (hand-trace documented in commit); App.jsx diff confined to the progression effect block; build + smoke green |
|
||||||
|
| D-30 | VoicingBrowser gallery: render ALL matching guitar shapes side by side (each = label + ChordDiagram + its own ▶) and all four piano styles side by side (label + MiniPiano thumb + ▶) — no chips, no selection state; grid wraps on narrow viewports; one-at-a-time playback preserved (new play stops the previous). All existing mounts (Voicings section, ChordDetailModal tabs, JamGuide station-enlarge) get the gallery automatically; `show` prop semantics unchanged | design | done | — | `src/components/VoicingBrowser.jsx` | every placeable shape/style visible simultaneously with zero clicks; AA contrast + tokens; keyboard-reachable play buttons; build + smoke green |
|
||||||
|
| D-31 | Glance-mode concept doc: the Knowledge Center panel open WHILE the jam plays — what auto-follows live detection with zero clicks (current station's voicing gallery inline? licks strip for the style? what stays on screen vs behind interaction), density/space budget vs the Roadmap track, narrow-viewport plan, and the migration order for L-33. No user gate: pick the strongest layout, record rationale + rejected alternatives. **Returned once (2026-07-10):** piano gallery width understated ~45% (2-octave crops for rootless 7th-chord voicings → ~940px not 640; scroll is the piano rail's normal state on most loops) + licks strip ~190px not 150 + 4 clarifying notes; layout itself held — fixed + re-gate PASS | design | done | — | `docs/design/glance-mode.md` | doc names every component to touch, the auto-follow rules, and honest space math (what fits at 1280×900 and at narrow) |
|
||||||
|
| L-33 | Implement glance mode per D-31 (`docs/design/glance-mode.md` — the "playhead accordion"): the station column at canonicalPos expands to the full D-30 gallery and advances with the playhead; licks strip below (level-filtered, token-boundary context match, strip-owned "fits — now" chrome, guitar licks under piano tab with honest heading); pin gesture inherits onFocusChord semantics; auto-follow never emits focus-chord and never auto-plays audio; piano rail EXPECTED to scroll (never assert one-row fits); follow the doc's 5-commit migration order | engineering | done | D-30, D-31 | `src/components/GlanceRail.jsx` (new), `src/components/JamGuide.jsx`, `src/components/VoicingBrowser.jsx` (optional additive `dense` prop only) | glance behaviours live per the doc; audio contract intact (App.jsx untouched or additive-only); build + smoke green |
|
||||||
|
| P-30 | KB expansion: **neo-soul/rnb piano** cell (next per `docs/kb-backlog.md` after jazz/gospel) | content | done | — | `src/data/kb/rnb/piano.js`, `src/data/kb/index.js` | validator green + registered; renders in the piano tab; prose claims arithmetic-verified |
|
||||||
|
| P-31 | KB expansion: **blues piano** cell. **Returned once (2026-07-10):** turnaround jump-kicks bars 3-4 dyad orientations flipped (breaks the play's own only-leap law — gate pre-verified the exact swap) + 2 prose rewordings (♭7 "unmoved all night" contradicted by bar 9; "octave-and-change" actually a major 7th) — fixed + re-gate PASS | content | done | P-30 | `src/data/kb/blues/piano.js`, `src/data/kb/index.js` | validator green + registered |
|
||||||
|
| C-31 | Sprint-end sweep: full build + validator + smoke + fixtures, then update PR #3 (push + PR body/comment summarising this sprint) per PROTOCOL §6 | quality | done | L-31, L-33, D-30 | (none — verification) | all green; PR #3 updated |
|
||||||
|
|
||||||
|
> Sequencing: C-30 ‖ D-30 ‖ D-31 ‖ P-30 are file-disjoint and ready now. Then C-30 → L-30 → L-31 (serial chain on theory.js/App.jsx), and D-30+D-31 → L-33. P-31 fills spare iterations. Critic gates every task.
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **D-30 PASS** (`0945a08`) — scope confined to VoicingBrowser.jsx; build green, smoke 809/809, validator green. SSR of the real component (Cmaj7/G7/Asus2/F#m7 × show variants): guitar cell count === independently re-derived matchingShapes count (4/4/3/3), all four piano labels honest, ZERO chips/aria-pressed (button count === cell count), every ▶ aria-labeled chord+voicing, rootPc badge guard proven (rootless voicings show 0 R badges, root/shell exactly 1; buggy variant rendered + diffed = absent), show prop scoping correct, E-add9 empty state graceful. Playback single-handle verified by read. *Non-blocking:* thumb-size diagrams drop finger numbers → backlogged.
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **C-30 PASS** — smoke 809/809 exit 0 with 8 annotated expected-fails (printed with today/contract values, never skipped); validator + build green. Failure map independently recomputed against the real function: vamp-2x4 self-overlap 2×3²=18 > pair 4×2²=16 → bogus `[Am,Am,G]` ✓; spurious-substitution ghost 4-pattern 2×16=32 > true 3×9=27 ✓; section-change stale-A 48 > 27 ✓; five-plus-tag genuinely passes pure-function (L-31 attribution honest) ✓. Sabotage ×3: broken guard → exit 1 named; stripped expectedFail → exit 1; stale marker → exit 1 with explicit STALE message — none can rot silently. `canonicalLoop` replica byte-equivalent to theory.js's private `canonicalize` + load-time self-check. clean-2x3 vs vamp-2x4 pins the exact boundary where the len² artifact kicks in. Nit (non-blocking): fixture header line 25 says `[Am,G,Am]` vs comment `[Am,Am,G]` — same loop pre/post canonicalization. NOTE: the transient smoke red the D-31 gate reported (`clean-3x3`) was this gate's own sabotage edit (a) running concurrently — tree restored, verified clean.
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **D-31 RETURNED → PASS on scoped re-gate** — first gate verified the playhead-accordion layout, the App.jsx-zero-changes claim (all 7 props already flow; pin inherits selectedStation semantics incl. reset effects), chordContext data support, and the vertical budget (256px at 1280×900 recomputed from real component geometry) but returned one arithmetic finding: expanded piano gallery ~640px understated ~45% (rootless A/B of true-7th chords → 2-octave D-24 crops = 266px thumbs) + licks strip 150→190px. Muse fixed: 940 / 1350–1550 (scrolls at ~1200, not "borderline") / 2300 / 3,500+ / 190 / 1070, "scroll is the piano rail's normal state on most loops", commit-5 must never assert one-row-fits, + 4 notes (token-boundary chordContext match; strip-owned "fits — now" chrome; guitar licks under piano tab stated; licksFor "lifted not reused"). Re-gate recomputed Dm7 rootlessA [17,21,24,28] → 266px from piano.js/MiniPiano.jsx, grep-verified no stale figures, no regression to passed sections. Nuance (non-blocking, for L-33): "any true-7th chord" slightly overgeneral — some rootless voicings fit 1 octave (e.g. Dm7 rootlessB); 940 is the correct conservative worst case.
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **P-30 PASS first try** (`b51daa1`) — validator 154 plays green, build green, shared-tree smoke 817/817. Independent arithmetic (own script from SCHEMA/CHORD_TYPES, not Professor's): max per-hand span 11 (≤15), ≤4 notes/hand, combined span ≤23 → every recipe renders for all 12 roots in the 36-key window (zero silent fallbacks); 11 hand-picked prose claims all recompute exactly (♭VI→V sink 1,1,1,1,2; 9sus RH = major triad on ♭7; So What [0,5,10,15,19]; I-RH ≡ vi7-RH pcs; 13sus = Type A bottom+1; ...). Rule-4 idiomatic difference genuine per pair; outside-key 9-on-iii honestly flagged; sources hedged. One chased-and-accepted oddity: ♭VI13 stab's C–F–G♭ pinch is deliberate voice-leading, not a stacking bug.
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **L-30 PASS** (`4cc0009`) — smoke 817/817 (all 17 fixtures plain guards, 9 original greens no regression), validator + build green. Diff confined: theory.js 2 hunks in the repeating-progression section only, `canonicalize` unchanged context; loop-fixtures.mjs = marker removals + historical rewordings, every history/expect array untouched (frozen contract intact). 15 novel generalization probes: 11 correct, 3 data-faithful (only phase-locked exactly-alternating corruption yields a doubled pattern — genuinely 6-periodic data no algorithm could distinguish), 1 better-than-expected (all-reps-edited loop found via clean rotation). Every reportable "ghost" now corresponds to a pattern that exactly recurred — the old structurally-fake ghosts are gone. Perf 0.21–0.73 ms/call ×1000. Consumer contract at App.jsx:154-173 type-matches. 3 non-blocking findings folded into L-31's row.
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **L-33 PASS** (`see commit`) — build green, smoke 817/817, validator green; diff exactly the 3-file lock (App.jsx/theory.js diffs attributed to L-31). SSR of the real JamGuide 37/37: expanded-column cell counts == independently derived shape counts (dom7@G=4, min7@D=4), aria-current one-per-list, mic microcopy exactly once (dense suppresses per-mount copies), pin semantics diffed line-by-line identical to old selectedStation (deps + emit/clear), GlanceRail imports no chordAudio + auto-follow has zero focus/audio side effects (scrollIntoView reduced-motion-guarded), heard-live + nothing-heard paths correct. Token matcher proven through the real render on a hostile country I-vs-I7 case (3 fits not 4) + full 23-lick chordContext audit — no false positive possible; exotic glyphs (♯/°/ø) outside the char class fail conservative (miss, never false-fit). `dense`-less VoicingBrowser SSR **byte-identical** to committed 0945a08. Zero-click audit: all variations + all licks in initial markup. Deviations accepted (staging cosmetic; heard-live licks strip musically right). Non-blocking: first-mount scroll on unknown playhead benign; LicksStrip perf fine unmemoized. Committed `c78baf4`.
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **L-31 PASS** (`ce24d54`) — 🚨 audio contract CLEAN: 1 hunk in the progression useEffect, contract-grep zero hits, no ref-sync/mount props; theory.js ride-along comment-only (verified zero executable lines). Independent re-trace with own mirror + real detector: spurious-substitution commits #7 zero drops; section change replaces with zero intermediate nulls; breakdown first-null at foreign-commit 28 (comment's "~28" numerically exact) and clears at exactly 6 nulls; 2-rep flap survives with rival counter provably reset. HOSTILE-1 proved REPLACE_VOTES=3 load-bearing (rival hit 2 before agreement reset — 2 would displace-and-flap); alternating rivals never accumulate; newSong null-shape defensively handled. Build/smoke 817/817/validator green. 2/3/6 judged musically sensible; v-a commit-then-upgrade UX accepted over blank display. Non-blocking: "consecutive" comment nuance (nulls are neutral, not resetting — amend to "consecutive non-null" if ever touched); threshold consts re-created per render (trivially cheap, hoisting would exceed the lock); Luthier's +53/−12 was arithmetic sloppiness for +47/−6.
|
||||||
|
|
||||||
|
> GATE 2026-07-10 (Critic) · **P-31 RETURNED → PASS on scoped re-gate** (`81cd230`) — first gate verified 90%+ of the pack exactly (♭VI7→V7 five-voice plane numerically perfect; all spans 11/4/22 legal; all 96 recipes render for 12 roots; rule-4 contrasts genuine) but returned 3 findings: jump-kicks bars 3-4 dyad orientations flipped (broke the play's own only-leap law; gate pre-verified the exact swap), "unmoved all night" contradicted by bar 9's own note, "octave-and-change" = actually a major 7th (11 semitones). Professor applied all 3; re-gate recomputed the lap chain from scratch: E4,B♭4 → G4,D♭5 → F4,C5 → F4,B4 → E4,B♭4 — "only leap" now provably unavoidable (all pairwise pc distances = 3), validator 164 plays / smoke 817/817 / build green, no fourth edit area.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Shipped sprint: `sprint-knowledge-center` (branch: `sprint-jamguide-piano` — complete 2026-07-09, PR #3)
|
||||||
|
|
||||||
|
**Goal (user directive 2026-07-08):** revise the **visual structure of the Knowledge Center** — today's knowledge lives in three disconnected surfaces (JamGuide/Roadmap, ExplorePanel, EducationPanel). Four user asks, verbatim priorities:
|
||||||
|
|
||||||
|
1. **Playable voicings per chord** — browse *and hear* alternative voicings for any chord (guitar shapes + generated piano voicings), with simple switching.
|
||||||
|
2. **Simple ways of seeing techniques for licks** — lick cards with technique markers (hammer-on, slide, bend…), per style.
|
||||||
|
3. **Intermediate-level progressions** — research them and find the *easiest* way to surface them in-app (level tags + filter, not a new panel).
|
||||||
|
4. **Keep expanding music knowledge** — continue KB cells per `docs/kb-backlog.md` in spare iterations.
|
||||||
|
|
||||||
|
**Loop:** `/jam-loop` every 30 min for 12 h (24 iterations), started 2026-07-08. User is away — no user-gated tasks this sprint; where the old sprint would have asked (concept selection), Muse picks the strongest option and records the rationale in the concept doc. Weights: Muse 3, Luthier 3, Professor 2, Critic gate, Herald 0.
|
||||||
|
|
||||||
|
| id | title | domain | status | depends-on | files (lock) | definition of done |
|
||||||
|
|----|-------|--------|--------|-----------|--------------|--------------------|
|
||||||
|
| M-03 | Seed `sprint-knowledge-center` from user directive 2026-07-08; carry L-11 forward (hold lifted — user asked to continue on this branch) | maestro | done | — | `docs/agents/LEDGER.md` | sprint seeded, loop scheduled |
|
||||||
|
| L-11 | Wire piano into `JamGuide.jsx`: Piano tab active; per station render `MiniPiano voicing={…}` from `pianoVoicing`/`pianoVoicingChain`; keep the guitar path intact. **Carried from piano sprint; user hold lifted 2026-07-08** | engineering | done | — | `src/components/JamGuide.jsx` | piano tab shows per-station keyboards synced to the loop; guitar unchanged; build + smoke green |
|
||||||
|
| D-20 | Knowledge Center concept doc: one unified IA for JamGuide (live) + ExplorePanel (browse) + EducationPanel (learn) — sections *Jam Guide / Explore / Voicings / Licks & Techniques*, where the voicing player and lick cards mount, level-filter placement, narrow-viewport plan. **No user gate: pick the strongest layout, record rationale + rejected alternatives in the doc** | design | done | — | `docs/design/knowledge-center.md` | doc names every component to touch, the target structure, and the migration order for L-22; honest about what stays untouched |
|
||||||
|
| L-20 | `src/lib/chordAudio.js` — Web Audio voicing playback: `playVoicing(notes, {strumMs, durMs})` (piano `notes` are absolute 0–36 above C3; also accept guitar `{string,fret}` arrays via a midi mapper), own `AudioContext` created lazily on first user gesture, simple triangle/partials envelope, `stopAll()`. **Must not touch the detection pipeline's contexts**; document mic-feedback caveat (playback may be heard by detection) | engineering | done | — | `src/lib/chordAudio.js` | pure module + tiny API; no import from AudioCapture/App; plays a Cmaj7 shell audibly in dev; build green |
|
||||||
|
| D-21 | `VoicingBrowser.jsx` — for `{rootPc, quality}`: guitar alternatives (all matching `voicings.js` shapes via `ChordDiagram`) + piano alternatives (`pianoVoicing` root/shell/rootlessA/rootlessB via `MiniPiano voicing`) as switchable chips, each with a ▶ button calling `chordAudio`. Note (D-20 gate): `GUITAR_SHAPES` is private — lock includes an **export-only** line in `voicings.js`; do not cite the D-20 doc for small-text AA on active chips (use surface-background rule) | design | done | L-20 | `src/components/VoicingBrowser.jsx`, `src/lib/voicings.js` (export-only) | renders + plays all styles for any KB quality in any key; design tokens; AA contrast; keyboard-reachable |
|
||||||
|
| L-21 | Integrate VoicingBrowser: `ChordDetailModal` (replace/extend its static voicing grids) + JamGuide station-enlarge view — tap any chord anywhere → browse + audition voicings | engineering | done | D-21, L-11 | `src/components/ChordDetailModal.jsx`, `src/components/JamGuide.jsx` | both entry points work; legacy modal content preserved where not superseded; build + smoke green; audio-callback contract intact (App.jsx untouched or additive-only) |
|
||||||
|
| C-20 | Schema + validator + smoke for the two new KB shapes (both **optional/additive**): (a) `level: 'foundation'\|'intermediate'` on progressions; (b) per-style `licks` — `{id, name, level, chordContext, techniques[]}` from a fixed technique vocab (hammer-on, pull-off, slide, bend, double-stop, ghost-note, chromatic-approach, vibrato) + `tab: [{string, fret, technique?}]` ordered notes. Existing KB stays green untouched | quality | done | — | `src/data/kb/SCHEMA.md`, `scripts/validate-kb.mjs`, `scripts/smoke.mjs` | validator enforces the vocab + tab shape when present; 10-style KB still green; smoke still 776+ green |
|
||||||
|
| P-20 | Intermediate progressions: research per `docs/progression-repertoire.md`, then tag existing KB progressions with `level` and author **2 new intermediate progressions each** for jazz, gospel, neo-soul/rnb (secondary dominants, chained ii-Vs, backdoor, borrowed iv…) with guitar plays | content | done | C-20 | `src/data/kb/**` (progressions + guitar files of jazz/gospel/rnb), `src/data/kb/index.js` | every progression carries `level`; 6 new intermediate progressions validator-green; tips written for the "confident enough to jam" player (GOAL Part 2 audience) |
|
||||||
|
| P-21 | Licks pack #1: author 3–4 licks each for **blues, jazz, funk** guitar using the C-20 lick schema — technique tags, chordContext (which station/quality it fits), honest attribution | content | done | C-20, P-20 (done) | `src/data/kb/blues/guitar.js`, `src/data/kb/jazz/guitar.js`, `src/data/kb/funk/guitar.js` | validator green; every lick playable as written (Critic hand-checks fret/string sanity) |
|
||||||
|
| L-23 | Fix latent `getGuitarVoicings` bug (found by L-20): `strIdx = shape.rootStr - 1` indexes `OPEN` (ordered s6…s1) wrongly — rootStr 5 reads the B string's pc, rootStr 4 reads G's; A-shape C major computes fret 1 instead of 3. Use the ChordDiagram convention `6 - rootStr`. Affects fret labels in ChordDetailModal/ExplorePanel/CurrentJamPanel for rootStr 4/5 movable shapes; ChordDiagram itself is correct. Also fix the `playChord` docstring octave example in `chordAudio.js` (Critic nit) | engineering | done | — | `src/lib/voicings.js`, `src/lib/chordAudio.js` (docstring only) | A-shape/C-shape fret labels correct (hand-verify 3 shapes × 2 keys); build + smoke green |
|
||||||
|
| D-22 | `LickCard.jsx` — tab-style SVG lick renderer: ordered notes on a string×fret window, technique glyphs (h, p, ⌒ slide, ↑ bend), compact card + technique legend; graceful on empty/malformed | design | done | C-20 | `src/components/LickCard.jsx` | renders every P-21 lick; glyph legend readable at card size; tokens; AA contrast |
|
||||||
|
| L-22 | Knowledge Center shell per D-20: restructure how JamGuide/ExplorePanel/EducationPanel mount into the unified IA; add the **level filter chip** (foundation/intermediate) wherever progressions list; mount Licks section (LickCard grid per style) | engineering | done | D-20, D-22, P-20, P-21 (licks commit may land empty-state-first per the D-20 doc). Ride-along polish (D-22 gate nit): LickCard stack-collision guard should check all same-column notes, not just prev (`LickCard.jsx:100`) | `src/components/JamGuide.jsx`, `src/components/ExplorePanel.jsx`, `src/App.jsx` (mount only) | unified structure live; level filter works; licks browsable per style; audio contract intact; build + smoke green |
|
||||||
|
| P-22 | KB expansion: **jazz piano** cell (first piano cell per `docs/kb-backlog.md`) — authored comp voicings override computed where they add signature value | content | done | L-11 | `src/data/kb/jazz/piano.js`, `src/data/kb/index.js` | validator green + registered (SCHEMA "Piano play" recipes); **rendering the authored pack is L-24, not this task** — status: done |
|
||||||
|
| C-22 | `checkPianoRecipe` span check: enforce SCHEMA rule 3 (each hand ≤ a 10th = 15 semitones) in the validator so future piano cells don't rely on hand-verification (P-22 gate follow-up) | quality | done | P-22 | `scripts/validate-kb.mjs`, `scripts/smoke.mjs` | span violation fails validator; existing KB green; smoke proves the check bites |
|
||||||
|
| D-23 | VoicingBrowser `show="guitar"\|"piano"\|"both"` prop (default both — zero change for existing mounts) + LickCard stack-collision guard checks ALL same-column notes not just prev (D-22 gate nit, `LickCard.jsx:100`) | design | done | D-21, D-22 | `src/components/VoicingBrowser.jsx`, `src/components/LickCard.jsx` | prop-gated rows; all existing mounts render identically with no prop; guard fixed; build + smoke green |
|
||||||
|
| L-25 | ChordDetailModal Guitar/Piano tabs pass `show="guitar"`/`show="piano"` to VoicingBrowser (JamGuide station-enlarge + Voicings section keep both rows) | engineering | done | D-23 | `src/components/ChordDetailModal.jsx` | tabs show only their instrument's row; build + smoke green |
|
||||||
|
| D-24 | MiniPiano voicing-path compact window: crop the keyboard to the voicing's octave span (+1 key padding each side) so Jam Guide station thumbs aren't ~390 px (L-11 gate observation); `size="full"` and the legacy lh/rh path byte-unchanged | design | done | D-10 | `src/components/MiniPiano.jsx` | thumbs materially narrower for ≤1-octave voicings; root/bass marks intact; legacy consumers render identically; build + smoke green |
|
||||||
|
| P-24 | Licks pack #2: 3–4 licks each for **rock, country, reggae** guitar (C-20 schema; same bar as P-21 — playable as written, honest sources) | content | done | C-20, P-21 | `src/data/kb/rock/guitar.js`, `src/data/kb/country/guitar.js`, `src/data/kb/reggae/guitar.js` | validator green with ~21+ licks; every note serves its chordContext (Critic verifies) |
|
||||||
|
| L-24 | JamGuide piano branch prefers an authored piano pack (SCHEMA piano recipes) over computed `pianoVoicingChain` when the style has one; fall back to computed otherwise. Recipe→notes convention: order inside each hand = voicing order low→high (documented at `jazz/piano.js:14`) | engineering | done | P-22, L-22 | `src/components/JamGuide.jsx` | jazz piano stations render the authored comp; other styles keep computed voicings; build + smoke green |
|
||||||
|
| P-23 | KB expansion: **gospel piano** cell | content | done | P-22 | `src/data/kb/gospel/piano.js`, `src/data/kb/index.js` | validator green; renders in the piano tab |
|
||||||
|
| C-21 | Sprint-end sweep: full build + validator + smoke, cross-browser sanity notes, PR body draft summarising the sprint for `main` | quality | done | L-21, L-22, P-21 | (none — verification) | all green; PR body ready |
|
||||||
|
|
||||||
|
> Sequencing: L-11 ‖ D-20 ‖ L-20 ‖ C-20 are all file-disjoint and ready now. Then D-21 → L-21, and P-20/P-21/D-22 → L-22. P-22/P-23 fill spare iterations. Critic gates every task as usual.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Shipped sprint: `sprint-jamguide-piano` (branch: `sprint-jamguide-piano` — piano resolver phase complete; L-11 carried into the sprint above)
|
||||||
|
|
||||||
|
**Goal:** extend the shipped Roadmap Jam Guide to **piano** (guitar→piano→bass roadmap). When the Piano instrument tab is selected, each Roadmap station shows a *generated* piano voicing on a mini-keyboard — voicings computed from the progression's `degrees`+`qualities` (GOAL G4: generate piano voicings from interval recipes; no authored data needed for the MVP). Branch cut off `sprint-jam-guide` HEAD. Weights: Luthier 3, Muse 2, Critic gate.
|
||||||
|
|
||||||
|
| id | title | domain | status | depends-on | files (lock) | definition of done |
|
||||||
|
|----|-------|--------|--------|-----------|--------------|--------------------|
|
||||||
|
| M-02 | Cut `sprint-jamguide-piano` branch off `sprint-jam-guide`; seed sprint | maestro | done | — | (branch) | branch cut, ledger seeded |
|
||||||
|
| L-10 | `src/lib/piano.js` — pure piano voicing resolver: `pianoVoicing({rootPc, quality}, opts?)` → shell (1-3-7), rootless A/B (3-5-7-9 / 7-9-3-5), root-position; picks the inversion minimizing movement from a previous voicing (voice-leading); returns absolute key positions + pcs + a label | engineering | done | M-02 | `src/lib/piano.js` | pure fns; correct tones for all 14 CHORD_TYPES; voice-leading-minimal vs a prev voicing; build + smoke green; output shape documented for D-10/L-11 |
|
||||||
|
| D-10 | **Extend** existing `src/components/MiniPiano.jsx` (already imported by `ChordDetailModal`/`ExplorePanel` via `{rootPc, lh, rh}`) with an ADDITIVE `voicing` prop that renders a `pianoVoicing` output (`{notes,pcs,bass,style,label}`) on a 2–3 octave keyboard — root in accent, bass marked, thumb/full sizes; **legacy lh/rh path unchanged** | design | done | L-10 | `src/components/MiniPiano.jsx` | renders any `pianoVoicing` in any key; **ChordDetailModal + ExplorePanel render identically (legacy path untouched)**; build green; design tokens; AA contrast |
|
||||||
|
| L-11 | Wire piano into `JamGuide.jsx` | engineering | **carried → sprint-knowledge-center** | L-10, D-10 | — | see the active sprint table above (hold lifted by user 2026-07-08) |
|
||||||
|
| C-10 | Extend `scripts/smoke.mjs`: assert `pianoVoicing` returns a valid voicing for every KB quality (no crash, notes in range, contains the chord's defining tones); also assert no duplicate absolute note across styles (the sus2 forced-rootless nit from L-10 gate) | quality | done | L-10 | `scripts/smoke.mjs` | smoke covers the piano resolver; exits non-zero on regression — **currently red (1/776): surfaces the sus2 dup-note nit → L-13 fixes the resolver** |
|
||||||
|
| L-13 | Resolver dedupe: `pianoVoicing` must never emit a **duplicate absolute note** (sus2 forced-`rootlessB` collides pc2 → `notes=[26,26,31]`). Drop/merge collided notes so every voicing's `notes` are distinct; keep `pcs`/`bass` valid; default + chain paths unchanged | engineering | done | L-10 | `src/lib/piano.js` | no duplicate absolute note for any quality×style; C-10 smoke goes green (776/776); build green; existing 56-voicing correctness preserved |
|
||||||
|
|
||||||
|
> Piano authored packs (signature comps overriding computed voicings) are deferred to a later sprint — computed voicings suffice for the piano MVP.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Shipped sprint: `sprint-jam-guide` (branch: `sprint-jam-guide`, PR #2 — complete)
|
||||||
|
|
||||||
Emphasis this sprint: **ship the Jam Guide MVP** (put the 8 guitar style packs on screen, synced to live detection) + **reframe the repo as a learning platform**. Weights this sprint: Luthier 3, Muse 3 (design-heavy), Professor 2, Herald 2, Critic gate.
|
Emphasis this sprint: **ship the Jam Guide MVP** (put the 8 guitar style packs on screen, synced to live detection) + **reframe the repo as a learning platform**. Weights this sprint: Luthier 3, Muse 3 (design-heavy), Professor 2, Herald 2, Critic gate.
|
||||||
|
|
||||||
@@ -49,13 +228,29 @@ Emphasis this sprint: **ship the Jam Guide MVP** (put the 8 guitar style packs o
|
|||||||
> GATE 2026-06-15 (Critic) · **C-01 PASS** — `node scripts/smoke.mjs` → `✓ Smoke test passed — 71/71 checks green (10 styles, 50 progressions)`, exit 0; reports the FULL final KB (10 styles, derived from the loaded registry, not hardcoded). Imports the REAL `kb/index.js` + `match.js` (no mocks); asserts registry integrity (every style meta/progressions[]/instruments.guitar, per-prog degrees/qualities/rn/bars consistency, cross-KB id uniqueness) and matcher correctness (ii–V–I matched:true + structural rebased-degree-shape check, rotation invariance to the SAME derived id with non-zero rotation, axis match guarded with skip-if-absent, chromatic → matched:false/id:null, findLoopPosition in-range/-1/-1-on-empty). Exits non-zero on failure (mirrors validate-kb). **Adversarial proof**: sabotaged `matchLoopToProgression` to always return no-match → smoke FAILED 4 checks, **exit code 1** (assertions are NOT too weak — a broken matcher cannot pass). match.js restored, no diff. **Resolve hook judged SOUND**: the inline `module.register` ESM hook retries ONLY on `catch`, ONLY for relative+extensionless specifiers (`/^\.{1,2}\//` && `!/\.[mc]?js$/`) — verified the regex skips `./theory.js`, `react`, `node:url`, `./a.mjs` and retries only `./theory`/`../lib/match`; it cannot mask a genuine missing module (the `.js` retry itself surfaces the real ERR_MODULE_NOT_FOUND). Correctly chosen over editing match.js (locked to L-01). **No npm script added** (validate-kb has none) — `package.json` untouched (git: only `src/data/kb/index.js` is modified; smoke.mjs/pop/CONTRIBUTING/templates are new untracked). No hardcoded fragile ids — expected ids derived from the loaded KB; survives KB growth.
|
> GATE 2026-06-15 (Critic) · **C-01 PASS** — `node scripts/smoke.mjs` → `✓ Smoke test passed — 71/71 checks green (10 styles, 50 progressions)`, exit 0; reports the FULL final KB (10 styles, derived from the loaded registry, not hardcoded). Imports the REAL `kb/index.js` + `match.js` (no mocks); asserts registry integrity (every style meta/progressions[]/instruments.guitar, per-prog degrees/qualities/rn/bars consistency, cross-KB id uniqueness) and matcher correctness (ii–V–I matched:true + structural rebased-degree-shape check, rotation invariance to the SAME derived id with non-zero rotation, axis match guarded with skip-if-absent, chromatic → matched:false/id:null, findLoopPosition in-range/-1/-1-on-empty). Exits non-zero on failure (mirrors validate-kb). **Adversarial proof**: sabotaged `matchLoopToProgression` to always return no-match → smoke FAILED 4 checks, **exit code 1** (assertions are NOT too weak — a broken matcher cannot pass). match.js restored, no diff. **Resolve hook judged SOUND**: the inline `module.register` ESM hook retries ONLY on `catch`, ONLY for relative+extensionless specifiers (`/^\.{1,2}\//` && `!/\.[mc]?js$/`) — verified the regex skips `./theory.js`, `react`, `node:url`, `./a.mjs` and retries only `./theory`/`../lib/match`; it cannot mask a genuine missing module (the `.js` retry itself surfaces the real ERR_MODULE_NOT_FOUND). Correctly chosen over editing match.js (locked to L-01). **No npm script added** (validate-kb has none) — `package.json` untouched (git: only `src/data/kb/index.js` is modified; smoke.mjs/pop/CONTRIBUTING/templates are new untracked). No hardcoded fragile ids — expected ids derived from the loaded KB; survives KB growth.
|
||||||
> GATE 2026-06-15 (Critic) · **D-03 FAIL (returned)** — build green (vite, 90 modules, 10.66s); validator green (`✓ KB valid — 10 style(s), 50 progressions, 100 plays`, no KB change). 🚨 **Audio contract INTACT**: `git diff -- src/App.jsx` is purely additive — exactly (a) one new `useState(jamFocusChord/null)` placed in the UI-state block (outside all audio-callback/ref logic, with a comment that it is not read by any callback), (b) `jamFocusChord={jamFocusChord}` on the existing `<Fretboard>` mount, (c) `onFocusChord={setJamFocusChord}` on the existing `<JamGuide>` mount. Grep of the **changed lines** for `handleNote|handleChroma|handleOnset|useCallback|AudioCapture|Ref|useEffect` → **NO MATCHES**. No callback, ref, ref-sync useEffect, or AudioCapture prop touched. Black-screen/infinite-restart risk avoided. **Wiring correct**: JamGuide emits `{rootPc, quality:qualities[i]}` (station's actual KB quality) on select, `null` on deselect; the existing `selectedStation→null` reset effect (loop/style/instrument change) flows through the new cross-link effect and clears the highlight; an unmount-cleanup effect also clears; all guarded `onFocusChord?.` so JamGuide stays standalone. Fretboard **null path verified unchanged** (`hasFocus=false` ⇒ `tag` always null ⇒ `if(!color&&!tag)` collapses to original `if(!color)`; no halo/badge/legend). Emphasis is visually distinct (purple ring `DOT_R+3` + degree badge, accent token `#a855f7`). Triad labeling **correct** for maj/min/dim/aug/sus4/sus2 (all `hasSeventh:false` → badge/legend read "5"). **DEFECT (blocking)**: `guideTones`' secondary-anchor heuristic is `hasSeventh = ints.length >= 4`, so the **4-tone non-seventh** KB qualities `add9` `[0,2,4,7]`, `maj6`/`min6` `[0,4,7,9]` return `hasSeventh:true` with `seventh = ints[last]` = the **5th** (add9) or **6th** (maj6/min6). D-03's `focusLabel` trusts that boolean and badges those tones **"7"**, legend reads **"3 / 7"** — a perfect fifth / sixth rendered to the user as a seventh on the flagship Fretboard. **Reachable**: `add9` is in gospel progression qualities (×4), `min6` in bossa + rnb qualities — tapping those stations mislabels a non-7th. Verified by running `guideTones(0,'add9')→{third:4,seventh:7,hasSeventh:true}` (G badged "7"), `guideTones(0,'min6')→{third:3,seventh:9,hasSeventh:true}` (A badged "7"). The DoD's "the chord's guide tones (3rd/7th)" / "badge reads 5 not 7 for a triad" contract is violated for these KB-present qualities. **Fix direction (return to Luthier):** make the secondary anchor honest for extended non-7th chords — either tighten `guideTones` so a chord with no minor/major 7th reports `hasSeventh:false` and falls back to the 5th (root cause, L-01b owns theory.js), or have `focusLabel`/the badge derive the actual interval of `seventh` above root (10/11 ⇒ "7", 9 ⇒ "6", 7 ⇒ "5", 2 ⇒ "9") rather than trusting the boolean. Re-gate after fix.
|
> GATE 2026-06-15 (Critic) · **D-03 FAIL (returned)** — build green (vite, 90 modules, 10.66s); validator green (`✓ KB valid — 10 style(s), 50 progressions, 100 plays`, no KB change). 🚨 **Audio contract INTACT**: `git diff -- src/App.jsx` is purely additive — exactly (a) one new `useState(jamFocusChord/null)` placed in the UI-state block (outside all audio-callback/ref logic, with a comment that it is not read by any callback), (b) `jamFocusChord={jamFocusChord}` on the existing `<Fretboard>` mount, (c) `onFocusChord={setJamFocusChord}` on the existing `<JamGuide>` mount. Grep of the **changed lines** for `handleNote|handleChroma|handleOnset|useCallback|AudioCapture|Ref|useEffect` → **NO MATCHES**. No callback, ref, ref-sync useEffect, or AudioCapture prop touched. Black-screen/infinite-restart risk avoided. **Wiring correct**: JamGuide emits `{rootPc, quality:qualities[i]}` (station's actual KB quality) on select, `null` on deselect; the existing `selectedStation→null` reset effect (loop/style/instrument change) flows through the new cross-link effect and clears the highlight; an unmount-cleanup effect also clears; all guarded `onFocusChord?.` so JamGuide stays standalone. Fretboard **null path verified unchanged** (`hasFocus=false` ⇒ `tag` always null ⇒ `if(!color&&!tag)` collapses to original `if(!color)`; no halo/badge/legend). Emphasis is visually distinct (purple ring `DOT_R+3` + degree badge, accent token `#a855f7`). Triad labeling **correct** for maj/min/dim/aug/sus4/sus2 (all `hasSeventh:false` → badge/legend read "5"). **DEFECT (blocking)**: `guideTones`' secondary-anchor heuristic is `hasSeventh = ints.length >= 4`, so the **4-tone non-seventh** KB qualities `add9` `[0,2,4,7]`, `maj6`/`min6` `[0,4,7,9]` return `hasSeventh:true` with `seventh = ints[last]` = the **5th** (add9) or **6th** (maj6/min6). D-03's `focusLabel` trusts that boolean and badges those tones **"7"**, legend reads **"3 / 7"** — a perfect fifth / sixth rendered to the user as a seventh on the flagship Fretboard. **Reachable**: `add9` is in gospel progression qualities (×4), `min6` in bossa + rnb qualities — tapping those stations mislabels a non-7th. Verified by running `guideTones(0,'add9')→{third:4,seventh:7,hasSeventh:true}` (G badged "7"), `guideTones(0,'min6')→{third:3,seventh:9,hasSeventh:true}` (A badged "7"). The DoD's "the chord's guide tones (3rd/7th)" / "badge reads 5 not 7 for a triad" contract is violated for these KB-present qualities. **Fix direction (return to Luthier):** make the secondary anchor honest for extended non-7th chords — either tighten `guideTones` so a chord with no minor/major 7th reports `hasSeventh:false` and falls back to the 5th (root cause, L-01b owns theory.js), or have `focusLabel`/the badge derive the actual interval of `seventh` above root (10/11 ⇒ "7", 9 ⇒ "6", 7 ⇒ "5", 2 ⇒ "9") rather than trusting the boolean. Re-gate after fix.
|
||||||
> GATE 2026-06-15 (Critic) · **D-03 PASS (re-gate)** — the returned defect is fixed at the root cause and hardened. `npm run build` green (vite, 90 modules, built in 3.25s); `node scripts/smoke.mjs` → `✓ Smoke test passed — 71/71 checks green (10 styles, 50 progressions)`, exit 0; `node scripts/validate-kb.mjs` → `✓ KB valid — 10 style(s), 50 progressions, 100 plays` (no KB change). **Root-cause fix VERIFIED by running the real `guideTones`**: `hasSeventh` now keys on the actual presence of interval 10 or 11 (`ints.find(i=>i===10||i===11)`), not `length>=4`. Independent truth table (root C): add9→{third:2,seventh:7,**hasSeventh:false**,anchor=5th G}; maj6→{4,7,false,5th}; min6→{3,7,false,5th}; dom7→{4,10,true,7=A♯}; maj7→{4,11,true,7=B}; min7→{3,10,true,7=A♯}; triads maj/min/sus4/sus2→false,anchor 5th(7); dim→anchor ♭5(6); aug→anchor #5(8); dim7→♭5(6); half_dim→true,10. Return shape `{third, seventh, root, hasSeventh}` **unchanged** (keys verified). **Badge hardening (Fretboard) VERIFIED**: `focusSeventhLabel` derives the label from the *actual* interval of the anchor pc above the chord root (10/11→"7", 9→"6", 8→"♭6", 7→"5", 6→"♭5"), so a wrong boolean can't mislabel — adversarial sweep of all 14 KB qualities × keys {3,7,11}: a "7" badge appears iff the interval is truly 10/11; **NO MISLABEL**. Unknown quality → `maj` fallback, no crash. **Null-focus path byte-equivalent**: `jamFocusChord=null` ⇒ `hasFocus=false` ⇒ `tag` always null ⇒ `if(!color&&!tag)` collapses to the original `if(!color) return null`; no halo/badge/legend; `focusSeventhLabel` is dead-but-harmless. **No collateral**: `voiceLeadingPairs`/`soloScale` signatures untouched (theory.js diff hits only `guideTones` body+jsdoc); ii–V–I rails still correct (Dm7→G7 C→B [0→11,−1]; G7→Cmaj7 F→E [5→4,−1]) and `voiceLeadingPairs` does NOT crash for the now-5th-anchored add9/maj6/min6 (Cadd9→G7, Cmaj6→F, Amin6→Dm7 all return smooth rails). match.js/RoadmapTrack/ChordDiagram/KB untouched (`git diff --name-only` = only the 4 declared D-03 files). 🚨 **Audio contract INTACT**: `git diff -- src/App.jsx` purely additive (one `useState(jamFocusChord/null)` outside the callback/ref block + an additive `jamFocusChord=` prop on `<Fretboard>` + `onFocusChord=setJamFocusChord` on `<JamGuide>`); grep of changed lines for `handleNote|handleChroma|handleOnset|useCallback|AudioCapture|Ref|configRef|useEffect` → NO MATCHES; the sole "−" line is the Fretboard mount being re-emitted with the added prop. *Non-blocking observation (pre-existing, out of D-03 scope):* `guideTones` uses `ints[1]` for the 3rd, so `add9` `[0,2,4,7]` reports its **9th (pc 2)** as `third`, not the major 3rd (pc 4) — true at L-01b time, unchanged by this fix, and D-03's bug was strictly the seventh/secondary anchor; worth a future tidy, not a return.
|
> GATE 2026-06-15 (Critic) · **D-03 PASS (re-gate)** — the returned defect is fixed at the root cause and hardened. `npm run build` green (vite, 90 modules, built in 3.25s); `node scripts/smoke.mjs` → `✓ Smoke test passed — 71/71 checks green (10 styles, 50 progressions)`, exit 0; `node scripts/validate-kb.mjs` → `✓ KB valid — 10 style(s), 50 progressions, 100 plays` (no KB change). **Root-cause fix VERIFIED by running the real `guideTones`**: `hasSeventh` now keys on the actual presence of interval 10 or 11 (`ints.find(i=>i===10||i===11)`), not `length>=4`. Independent truth table (root C): add9→{third:2,seventh:7,**hasSeventh:false**,anchor=5th G}; maj6→{4,7,false,5th}; min6→{3,7,false,5th}; dom7→{4,10,true,7=A♯}; maj7→{4,11,true,7=B}; min7→{3,10,true,7=A♯}; triads maj/min/sus4/sus2→false,anchor 5th(7); dim→anchor ♭5(6); aug→anchor #5(8); dim7→♭5(6); half_dim→true,10. Return shape `{third, seventh, root, hasSeventh}` **unchanged** (keys verified). **Badge hardening (Fretboard) VERIFIED**: `focusSeventhLabel` derives the label from the *actual* interval of the anchor pc above the chord root (10/11→"7", 9→"6", 8→"♭6", 7→"5", 6→"♭5"), so a wrong boolean can't mislabel — adversarial sweep of all 14 KB qualities × keys {3,7,11}: a "7" badge appears iff the interval is truly 10/11; **NO MISLABEL**. Unknown quality → `maj` fallback, no crash. **Null-focus path byte-equivalent**: `jamFocusChord=null` ⇒ `hasFocus=false` ⇒ `tag` always null ⇒ `if(!color&&!tag)` collapses to the original `if(!color) return null`; no halo/badge/legend; `focusSeventhLabel` is dead-but-harmless. **No collateral**: `voiceLeadingPairs`/`soloScale` signatures untouched (theory.js diff hits only `guideTones` body+jsdoc); ii–V–I rails still correct (Dm7→G7 C→B [0→11,−1]; G7→Cmaj7 F→E [5→4,−1]) and `voiceLeadingPairs` does NOT crash for the now-5th-anchored add9/maj6/min6 (Cadd9→G7, Cmaj6→F, Amin6→Dm7 all return smooth rails). match.js/RoadmapTrack/ChordDiagram/KB untouched (`git diff --name-only` = only the 4 declared D-03 files). 🚨 **Audio contract INTACT**: `git diff -- src/App.jsx` purely additive (one `useState(jamFocusChord/null)` outside the callback/ref block + an additive `jamFocusChord=` prop on `<Fretboard>` + `onFocusChord=setJamFocusChord` on `<JamGuide>`); grep of changed lines for `handleNote|handleChroma|handleOnset|useCallback|AudioCapture|Ref|configRef|useEffect` → NO MATCHES; the sole "−" line is the Fretboard mount being re-emitted with the added prop. *Non-blocking observation (pre-existing, out of D-03 scope):* `guideTones` uses `ints[1]` for the 3rd, so `add9` `[0,2,4,7]` reports its **9th (pc 2)** as `third`, not the major 3rd (pc 4) — true at L-01b time, unchanged by this fix, and D-03's bug was strictly the seventh/secondary anchor; worth a future tidy, not a return.
|
||||||
|
> GATE 2026-06-15 (Critic) · **L-10 PASS** — (re-gated cleanly after the prior dispatch died on an API error pre-verdict.) `npm run build` green (vite 7.3.1, 90 modules, built in 2.24s); `node scripts/smoke.mjs` → `✓ Smoke test passed — 71/71 checks green (10 styles, 50 progressions)` exit 0; `node scripts/validate-kb.mjs` → `✓ KB valid — 10 style(s), 50 progressions, 100 plays`. **Purity confirmed** by reading the full module: exports `pianoVoicing({rootPc,quality},opts?)`→`{notes,pcs,bass,style,label}` plus `pianoVoicingChain`, `hasTrueSeventh`, `voicingToneSet` (and re-exports `guideTones`); imports ONLY `{CHORD_TYPES, guideTones}` from `./theory`; no `Date`/`Math.random`/module-level mutable state — determinism verified (every quality voiced twice → byte-identical). **Music verified myself** via a throwaway ESM script (deleted): swept **all 14 CHORD_TYPES × 4 styles = 56 voicings** at rootPc 0 — every `pcs ⊆ voicingToneSet(...)` (**NO out-of-chord note**), real 3rd present (sus→2/5), every TRUE 7th (interval 10/11: dom7/maj7/min7/half_dim) present in shell+rootless, all `notes ∈ [0,36]` (≤3 octaves), `bass=min(notes)`. Spot-checks exact: **Cmaj7 shell→{0,4,11}** ✓, **Dm7 rootlessA→{5,9,0,4}=F-A-C-E** ✓, **G7 shell→{7,11,5}** ✓. **Awkward qualities honest**: half_dim shell→{0,3,10} (true ♭7 kept), rootlessA→{3,6,10,2} "3-5-7-9" ✓; **dim7 correctly NOT a true-7th chord** — its 7-slot is interval 9 (𝄫7 = enharmonic maj6, not 10/11), so `hasTrueSeventh('dim7')=false`, shells as R-3-5 {0,3,6}, no fabricated 7th; **min6/maj6** (no true 7th) → root {0,3,7,9}/{0,4,7,9}, rootless labels honestly read "3-5-6-9" using the 6th as upper colour — no wrong note. **Voice-leading confirmed**: `pianoVoicingChain([Dm7,G7,Cmaj7])` total semitone motion **16 vs 18** unthreaded (`opts.prev` slides whole shapes by octaves toward the previous voicing); pcs **unchanged** by threading (per-chord pc sets identical to unthreaded — re-registered only, never corrupted). **Adversarial**: bogus/empty/null chord → graceful `maj` fallback, no crash. **One non-blocking nit (NOT a defect):** forcing `rootlessB` (or `rootlessA`) explicitly onto a **sus2** chord produces a cosmetic duplicate absolute note (`notes=[26,26,31]`) because the suspended-2nd "3rd-slot" tone (pc2) and the synthesized 9th (pc2) collide — still no wrong pc, in range, and honestly labeled "no 7th, 9-3-5 colour". It is **unreachable on the shipping path**: `defaultStyle(sus2)='root'` and L-11/`pianoVoicingChain` use defaults, so sus2 renders as clean root `[0,2,7]`; the dup only appears under an explicit forced-rootless override of a sus chord (documented graceful degradation). Default-style sweep of all 14 qualities confirmed zero duplicate notes. Recommend a future tidy (dedupe collided absolute notes in the rootless fallback) — not a return. `src/lib/piano.js` NOT edited; throwaway script removed.
|
||||||
> GATE 2026-06-15 (Critic) · **D-02 PASS** — the load-bearing integration is correct. **Independent rotation check**: `canonicalPos = ((position − rotation) % n + n) % n` translates a `findLoopPosition` index (which is into the *detected loop*) into the KB-canonical station RoadmapTrack/stationVoicings render. Worked a rotated [ii V I VI] of KB [I VI ii V] (rotation=2, n=4): playhead@detected-idx1(V)→canonical 3(V), @2(I)→0(I), @3(VI)→1(VI), @0(ii)→2(ii) — NOW lands on the chord actually playing. ✓ **rootPc parity** confirmed: thumbnail `rootPc` and RoadmapTrack station root are byte-identical `(((keyRoot+deg)%12)+12)%12`, and `keyInfo.root` (a note *name*, e.g. `detectKey`→"F#") is converted once via `chordRootPC` → pc, guarded `>=0`. stationVoicings `chords[i]` aligns 1:1 with `degrees[i]` (canonical). Auto-scroll is prop-driven off `position` (no rAF on the audio thread). Reflows (`flex-wrap`/`sm:flex-nowrap`), keyboard-reachable, AA contrast. NO_MATCH path → dashed fallback, never empty/crash. *Non-blocking deferral*: the DoD's "tap-station → **fretboard** guide tones" cross-link and `tailwind.config.js` edit were not delivered — the implementation cross-links via an inline enlarged ChordDiagram instead (flagged in-code as deferred). Panel is fully functional without it; recommend Maestro file the fretboard cross-link as a phase-2 follow-up.
|
> GATE 2026-06-15 (Critic) · **D-02 PASS** — the load-bearing integration is correct. **Independent rotation check**: `canonicalPos = ((position − rotation) % n + n) % n` translates a `findLoopPosition` index (which is into the *detected loop*) into the KB-canonical station RoadmapTrack/stationVoicings render. Worked a rotated [ii V I VI] of KB [I VI ii V] (rotation=2, n=4): playhead@detected-idx1(V)→canonical 3(V), @2(I)→0(I), @3(VI)→1(VI), @0(ii)→2(ii) — NOW lands on the chord actually playing. ✓ **rootPc parity** confirmed: thumbnail `rootPc` and RoadmapTrack station root are byte-identical `(((keyRoot+deg)%12)+12)%12`, and `keyInfo.root` (a note *name*, e.g. `detectKey`→"F#") is converted once via `chordRootPC` → pc, guarded `>=0`. stationVoicings `chords[i]` aligns 1:1 with `degrees[i]` (canonical). Auto-scroll is prop-driven off `position` (no rAF on the audio thread). Reflows (`flex-wrap`/`sm:flex-nowrap`), keyboard-reachable, AA contrast. NO_MATCH path → dashed fallback, never empty/crash. *Non-blocking deferral*: the DoD's "tap-station → **fretboard** guide tones" cross-link and `tailwind.config.js` edit were not delivered — the implementation cross-links via an inline enlarged ChordDiagram instead (flagged in-code as deferred). Panel is fully functional without it; recommend Maestro file the fretboard cross-link as a phase-2 follow-up.
|
||||||
|
> GATE 2026-06-16 (Critic) · **D-10 PASS** — `npm run build` green (vite 7.3.1, 90 modules, built in 9.36s); `node scripts/smoke.mjs` → 776/776 exit 0; `node scripts/validate-kb.mjs` → 10 styles/50/100 (no KB change). **ADDITIVE confirmed** by reading the full diff: the public `MiniPiano` now dispatches `if (voicing) <VoicingPiano/> else <LegacyPiano/>`. The legacy `{rootPc,lh,rh}` path is the SAME code, only refactored to named constants holding the IDENTICAL hex values (`LH_BLUE=#3b82f6`, `ACCENT=#a855f7`, `WHITE_FILL=#f5f5f5`, `WHITE_STROKE=#374151`, `BLACK_FILL=#1f2937`, `BLACK_STROKE=#111827`) — geometry (OCTAVES=2, WW/WH/BW/BH, BLACK_OFFSETS), highlight map, R-label all unchanged. **Consumers render identically**: `grep` confirms `ChordDetailModal.jsx:86` and `ExplorePanel.jsx:85` both call `<MiniPiano rootPc lh rh />` with NO `voicing` prop → `voicing` is `undefined` → both hit `LegacyPiano` → byte-equivalent output. **Voicing path correct**: maps absolute `notes` (0=low C, [0,36]) to keys via `oct*12+pc`, root pc lights accent `#a855f7` + "R", bass key amber-ringed (`#fbbf24` AA), other tones soft accent `#c084fc`; OCTAVES auto-spans 2–3 to contain `max(notes)`. Worked example `pianoVoicing({rootPc:0,quality:'maj7'})` → default shell, pcs `{0,4,11}`=C-E-B (R-3-7): C lit accent+R, B & E soft purple, C bass-ringed — musically right. `role="img"`+`aria-label`. Design tokens used. No legacy regression, no colour/render bug.
|
||||||
|
> GATE 2026-06-16 (Critic) · **C-10 PASS** — `node scripts/smoke.mjs` → **776/776 exit 0** (was 71 pre-piano; +705 piano checks). Diff ADDED a piano block, kept ALL prior registry/matcher checks. Sweeps 14 qualities × {C,G} × {root,shell,rootlessA,rootlessB,default} asserting: valid shape (notes/pcs/bass/style/label), `pcs ⊆ voicingToneSet(quality,actualStyle)`, real 3rd (or sus tone) present, true 7th present in shell/rootless when `hasTrueSeventh`, `notes ∈ [0,36]`, `bass===min(notes)`, no-dup-note, determinism, and chain pcs-preservation. **Adversarially proven NON-vacuous**: inject pc1 into pcs → **125 fails, exit 1** (pcs⊆toneSet bites); `bass=max(notes)` → **140 fails, exit 1**; revert L-13 dedupe (`notes=placed`) → the no-dup check fails on exactly `sus2@0 [rootlessB] notes=[26,26,31]` + `sus2@7 [21,21,26]`, **exit 1**. So the suite now passes LEGITIMATELY because L-13 fixed the resolver, not because any check was weakened. piano.js restored to its L-13 diff after each sabotage (git: 9 insertions, clean).
|
||||||
|
> GATE 2026-06-16 (Critic) · **L-13 PASS** — minimal fix at the single funnel point in `pianoVoicing`: `const notes = [...new Set(placed)]` (dedupe ABSOLUTE notes), `pcs`/`bass` derived from the deduped array so both stay consistent. Verified via a throwaway resolve-hook ESM check (written + deleted): (a) `pianoVoicing({rootPc:0,quality:'sus2'},{style:'rootlessB'})` → `[26,31]` distinct (was `[26,26,31]`); (b) NO default-style voicing across all 14 qualities has a duplicate, so the dedupe is a pure **no-op on the default/chain path** — L-11's render is unaffected; ii-V-I chain `[14,17,24]|[19,23,29]|[24,28,35]` all distinct & voice-led. The full 56-voicing correctness is re-asserted by the now-776-green smoke (pcs⊆toneSet, 3rd, 7th, [0,36], bass for every quality×style). **Safety reasoning — dedupe NEVER drops a needed note**: a JS `Set` of absolute integers merges two entries only when they are the *identical integer*, i.e. identical pc AND identical octave — the *same physical key*, which can sound only one note anyway. Two musically-distinct intended tones (different pc, or same pc a different octave like 14 vs 26) yield different integers and are never merged. The sus2 collision is a genuine unison (pc2 stand-in 3rd at +24=26 vs synthesized 9th at +12=26, both pc2 same octave) — a redundant doubling, safe to drop. No information loss possible. build green; default + chain paths unchanged.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Backlog (future sprints)
|
## Backlog (future sprints)
|
||||||
|
|
||||||
- **Jam Guide phase 2:** `MiniPiano.jsx` + piano recipe resolver (unblocks piano packs); bass pattern renderer.
|
- **Retire `EducationPanel.jsx`** — confirmed orphaned (no importer anywhere in `src/`, D-20 gate verified); delete after the Knowledge Center ships. Fold `CurrentJamPanel`'s overlapping content (voicings/scales/similar progressions) into the Knowledge Center and retire it too.
|
||||||
|
- **Level-tag `FAMOUS_PROGRESSIONS`** (`src/lib/education.js`, Professor): famous-progression cards are exempt from the level filter this sprint (Maestro call 2026-07-08, per D-20 open question 1).
|
||||||
|
- **Drift guards in smoke (Critic, tiny):** two hand-synced duplications need permanent smoke checks — JamGuide.jsx's copy of the validator's `resolveDegree` (fold in the L-24 gate's 16-degree × 14-quality drift test) and the 8-word technique vocab duplicated between `validate-kb.mjs` `LICK_TECHNIQUES` and `LickCard.jsx` `TECHNIQUE_VOCAB` (C-21 finding).
|
||||||
|
- **`pianoVoicing` should return `rootPc` (Luthier, tiny):** callers currently must attach it themselves (JamGuide and VoicingBrowser both do); returning it at the source removes the false-"R" foot-gun for future consumers (D-24 gate observation — NOT a live bug, both call sites verified correct 2026-07-08).
|
||||||
|
- **`docs/kb-backlog.md` is stale (Professor, tiny):** still lists gospel/pop guitar + jazz/gospel piano as "todo" though shipped; P-30 (rnb piano) AND P-31 (blues piano, both 2026-07-10) need done entries — refresh next content iteration (flagged by P-30 + C-31 sweep, outside their locks).
|
||||||
|
- **`scripts/loop-fixtures.mjs` header comment drift (tiny):** cites "App.jsx:322-324" for adjacent-dup suppression; L-31 shifted it to ~line 364 — comment-only, fix when the file is next touched (C-31 sweep finding).
|
||||||
|
- **Matcher blues/jazz disambiguation (Luthier, small):** `['C7','A7','Dm7','G7']` matches `jazz-rhythm-a` (identical I–VI–ii–V degree shape, quality tie → jazz), so `blues-turnaround`'s bass plays are live-unreachable — pre-existing tie-break in match.js; consider quality-profile weighting (all-dom7 → blues). Evidence-verified by the L-42 gate 2026-07-10.
|
||||||
|
- **Bass play `tips` have no render surface (Muse/Luthier, small):** the authored teaching prose in bass packs renders nowhere (card shows label/feel/position/note only; the dock has no bass section) — real content-surface gap, L-42 gate 2026-07-10.
|
||||||
|
- **TransitionChip "2 step down" wording (Muse, one line):** whole-step rails render as "2 step down/up" (52 of 268 real KB transitions) — verbatim port of RoadmapTrack.jsx:59; "whole step down" is the musician's phrase (D-41 gate note 2026-07-10).
|
||||||
|
- **Fingering view lost at gallery thumb size (Muse, small):** D-30's gallery renders ChordDiagram at `size="thumb"`, which never draws finger numbers — nothing in the browser shows fingering anymore (D-30 gate note 2026-07-10). If pedagogically wanted: tap-to-enlarge to `size="full"` inside a gallery cell.
|
||||||
|
- **Negative-fret shape handling inconsistency (Luthier, small):** `voicings.js` skips shapes that compute negative frets while `chordAudio.guitarShapeToNotes` slides them up an octave — pre-existing, flagged at the L-23 gate; unify someday.
|
||||||
|
|
||||||
|
- **Jam Guide phase 3:** bass pattern renderer (guitar → piano → **bass** roadmap; MiniPiano + piano recipe resolver shipped in sprint-knowledge-center).
|
||||||
- **Content:** piano packs (jazz → gospel → neo-soul first), then bass packs (blues → jazz → funk first) — see `docs/kb-backlog.md`.
|
- **Content:** piano packs (jazz → gospel → neo-soul first), then bass packs (blues → jazz → funk first) — see `docs/kb-backlog.md`.
|
||||||
- **`guideTones` third bug (L-12, Luthier — small):** `guideTones` takes `ints[1]` as the "third", so `add9` `[0,2,4,7]` reports its **9th (pc 2)** as the 3rd instead of the major 3rd (pc 4) — wrong "3rd" lane/badge for add9 (live in gospel + pop-axis Cadd9). Pre-existing since L-01b; flagged by Critic during the D-03 re-gate. Fix: pick the actual 3rd/4th interval (3 or 4, or sus 2/5) rather than positional `ints[1]`. Smoke + a guideTones truth-table check.
|
- **`guideTones` third bug (L-12, Luthier — small):** `guideTones` takes `ints[1]` as the "third", so `add9` `[0,2,4,7]` reports its **9th (pc 2)** as the 3rd instead of the major 3rd (pc 4) — wrong "3rd" lane/badge for add9 (live in gospel + pop-axis Cadd9). Pre-existing since L-01b; flagged by Critic during the D-03 re-gate. Fix: pick the actual 3rd/4th interval (3 or 4, or sus 2/5) rather than positional `ints[1]`. Smoke + a guideTones truth-table check.
|
||||||
- **Learning features (Professor + Luthier):** drills tab seeded from `docs/learn-curriculum.md`; target-note highlighting; ear-training quiz on own chord history; pocket report from the onset pipeline.
|
- **Learning features (Professor + Luthier):** drills tab seeded from `docs/learn-curriculum.md`; target-note highlighting; ear-training quiz on own chord history; pocket report from the onset pipeline.
|
||||||
@@ -74,3 +269,22 @@ _(Maestro appends one line per completed iteration: `<date> · <task ids done>
|
|||||||
- 2026-06-15 · done: P-01 (gospel guitar pack — 5 progs × 2 plays, validator 9 styles/45/90), H-01 (README reframed as learning platform, stale frontend/ paths fixed) — Critic PASS both · next ready: P-02 (pop pack) ‖ H-02 (CONTRIBUTING) ‖ C-01 (smoke harness) ‖ D-03 (fretboard cross-link)
|
- 2026-06-15 · done: P-01 (gospel guitar pack — 5 progs × 2 plays, validator 9 styles/45/90), H-01 (README reframed as learning platform, stale frontend/ paths fixed) — Critic PASS both · next ready: P-02 (pop pack) ‖ H-02 (CONTRIBUTING) ‖ C-01 (smoke harness) ‖ D-03 (fretboard cross-link)
|
||||||
- 2026-06-15 · done: P-02 (pop guitar pack — KB now 10 styles/50/100), H-02 (CONTRIBUTING.md + issue templates), C-01 (scripts/smoke.mjs — 71/71, adversarially proven to catch a broken matcher) — Critic PASS all 3 · **SPRINT `sprint-jam-guide` COMPLETE** → opening PR to main · remaining (next sprint): D-03 fretboard cross-link, piano/bass packs, drills
|
- 2026-06-15 · done: P-02 (pop guitar pack — KB now 10 styles/50/100), H-02 (CONTRIBUTING.md + issue templates), C-01 (scripts/smoke.mjs — 71/71, adversarially proven to catch a broken matcher) — Critic PASS all 3 · **SPRINT `sprint-jam-guide` COMPLETE** → opening PR to main · remaining (next sprint): D-03 fretboard cross-link, piano/bass packs, drills
|
||||||
- 2026-06-15 · done: D-03 (tap station → guide tones on the main Fretboard; root-cause fix to `guideTones` hasSeventh + badge hardening) — Critic **returned once** (add9/maj6/min6 mislabeled 5th/6th as "7"), fixed, **PASS on re-gate** · audio contract intact · folded into PR #2 (completes the flagship) · filed L-12 (guideTones third bug) to backlog · next: seed piano phase-2 sprint (resolver + MiniPiano + wire)
|
- 2026-06-15 · done: D-03 (tap station → guide tones on the main Fretboard; root-cause fix to `guideTones` hasSeventh + badge hardening) — Critic **returned once** (add9/maj6/min6 mislabeled 5th/6th as "7"), fixed, **PASS on re-gate** · audio contract intact · folded into PR #2 (completes the flagship) · filed L-12 (guideTones third bug) to backlog · next: seed piano phase-2 sprint (resolver + MiniPiano + wire)
|
||||||
|
- 2026-06-15 · **new sprint `sprint-jamguide-piano`** cut off sprint-jam-guide (keeps PR #2 stable) · done: M-02 (seed), L-10 (`src/lib/piano.js` voicing resolver — shells/rootless A·B/root, voice-leading threading; Critic PASS, 56 voicings, 0 wrong notes) · next ready: D-10 (MiniPiano) ‖ C-10 (smoke piano) → then L-11 (wire piano tab) · L-10 chosen as a new unimported lib so the user's live frontend review stayed undisturbed
|
||||||
|
- 2026-06-16 · done: D-10 (extended existing `MiniPiano.jsx` with additive `voicing` prop — legacy lh/rh path for ChordDetailModal/ExplorePanel byte-unchanged), C-10 (smoke +705 piano checks → 776 total), L-13 (resolver dedupe — `[...new Set]`, fixes sus2 dup-note C-10 caught) — Critic PASS all 3 (adversarially proved C-10 checks bite + dedupe never drops a needed note) · **mid-iteration corrections:** D-10's "new file" premise was wrong (MiniPiano already existed + imported) → re-scoped to additive extend; C-10 correctly turned the branch red surfacing a real wart → filed+fixed L-13; 3 subagents hit API errors (2 produced nothing, 1 landed its diff before dying) · **L-11 (wire piano tab) intentionally HELD** — it's the first UI-visible change; waiting until the user finishes reviewing localhost:5173 · next: L-11 on the user's go
|
||||||
|
- 2026-07-08 · **new sprint `sprint-knowledge-center`** seeded on the SAME branch (user directive: continue on `sprint-jamguide-piano`) · user asks: playable voicings per chord, lick/technique cards, intermediate progressions (easiest in-app surface = level tags + filter), Knowledge Center visual restructure, keep expanding KB · L-11 hold LIFTED, carried forward · loop scheduled: /jam-loop every 30 min × 24 iterations (12 h) · ready now (file-disjoint): L-11 ‖ D-20 ‖ L-20 ‖ C-20
|
||||||
|
- 2026-07-08 · **iteration 1/24** · done: M-03, L-20 (`4b0f0c8` audio engine), L-11 (`7b669f8` piano tab LIVE), D-20 (`96dda6a` Knowledge Center concept), C-20 (`793e60a` lick/level schema, smoke 787) — Critic PASS all four, zero returns · findings folded into the board: D-21 lock += `voicings.js` export-only (GUITAR_SHAPES private); L-22 deps += P-21; P-21 serialized behind P-20 (`jazz/**` overlap); filed L-23 (pre-existing `getGuitarVoicings` rootStr fret-label bug, found by L-20); D-20 discovered ExplorePanel + EducationPanel are ORPHANED (never mounted) → retirement backlogged; famous-progressions level-filter exemption recorded · next ready (file-disjoint): D-21 ‖ P-20 ‖ D-22 (D-22 may build against the SCHEMA fixture until P-21 lands)
|
||||||
|
- 2026-07-08 · **iteration 2/24** · done: D-22 (`44d9c4f` LickCard), D-21 (`3c903ad` VoicingBrowser — returned once: rootless voicings badged lowest voice as "R", one-line rootPc fix, PASS on re-gate), P-20 (`c08b334` — returned once: 3 caption theory misstatements, string fixes, PASS on re-gate; KB 56 progs/112 plays, all jazz/gospel/rnb progressions level-tagged) · incident: both first-round gates stalled on API watchdog (600s) twice for P-20 — fresh critic instances completed them; one cron fire absorbed into gate completion · Critic gate quality note: both returns were real musical defects caught before commit
|
||||||
|
- 2026-07-08 · **iteration 4/24** · done: P-21 (`6ea1089` 12 licks blues/jazz/funk — every note pitch-verified), P-22 (`9e2567c` jazz piano cell, KB's first authored piano pack, 126 plays — returned once: 6 prose voice-leading overclaims on fifths-apart dominants, fixed + arithmetic-verified, PASS on re-gate), L-22 (`78706ce` **Knowledge Center shell LIVE** — 4-section dock, level filter, licks grid; App.jsx +1 line, audio contract grep-clean) · filed: C-22 (validator span check), L-24 scoped out of P-22 (authored-pack rendering) · promoted: L-24, C-22, P-23 · iteration 5 batch already in flight: D-23 ‖ D-24 ‖ P-24
|
||||||
|
- 2026-07-09 · **iteration 8/24 — SPRINT `sprint-knowledge-center` COMPLETE** · done: C-21 (sprint-end sweep — build/validator/smoke all green on 72c6d45; full-App SSR renders; authored vs computed piano paths both proven; zero dead imports; audio contract +1 line since seed) · **PR #3 opened: https://github.com/whattheflat/JamBuddy/pull/3** (supersedes PR #2 — main hadn't absorbed it) · all 21 sprint tasks done, 4 returned-then-fixed by the gate, 0 unresolved · loop cron deleted after 8 of 24 budgeted iterations (board empty) · remaining backlog: EducationPanel retirement, FAMOUS_PROGRESSIONS level tags, smoke drift guards, pianoVoicing rootPc, negative-fret unify, L-12, bass renderer
|
||||||
|
- 2026-07-09 · **iterations 6–7/24** · done: L-25 (`e24aa4b` instrument-scoped modal tabs), C-22 (`b4e8f12` validator hand-span rule, smoke 799), P-23 (`564a9e0` gospel piano cell, 140 plays — returned once: one improv-row scale claim false for vi7/iii7, split into exact rows, PASS re-gate; 39/40 first-pass claims held), L-24 (`2165bb5` authored piano packs render at stations — implementer agent hung at verification after ~1 h, killed, completion-pass agent audited + finished; Critic PASS with 0 resolver drift) · incidents: P-23 stalled once mid-authoring (resumed from transcript, no loss); L-24 hung silently (diff intact, completed by fresh agent) · backlog: resolveDegree drift guard filed · **board empty except C-21 → sprint-end sweep + PR**
|
||||||
|
- 2026-07-08/09 · **iteration 5/24** · done: D-23 (`db397f6` VoicingBrowser show prop + LickCard stack-guard), D-24 (`e2110ae` MiniPiano thumbs crop to voicing span, 266→142 px), P-24 (11 licks rock/country/reggae — KB now **23 licks across 6 styles**, every note pitch-verified) — Critic PASS all three, zero returns · D-24 gate raised a false alarm on the D-21 rootPc fix (its harness bypassed VoicingBrowser; Maestro verified line 297 intact — no regression); hardening idea backlogged (`pianoVoicing` return rootPc) · promoted L-25 · next ready (all file-disjoint): L-24 ‖ L-25 ‖ C-22 ‖ P-23, then C-21 closes the sprint
|
||||||
|
- 2026-07-10 · **sprint-integrated-glance iteration 4/24 — SPRINT COMPLETE** · done: L-42 (`af7c3cc` **BASS real end-to-end** — BassPatternCard tab cards with playback; gate re-realized all 912 placements exact, byte-identity on untouched paths, import cycle proven safe), C-42 (`218c0ba` smoke §7 sweeps BOTH resolveDegree copies, 866/866 — the sweep agent authored the wiring then died on the ACCOUNT MONTHLY SPEND LIMIT; Maestro completed the sweep inline: build/validator/smoke green at HEAD, sabotage-proved the new guard [b13 perturbation → red naming the cell → restored green], whole-sprint App.jsx contract grep = 0 hits; per-instrument SSR relied on the L-42 gate's run minutes earlier — only smoke.mjs changed since) · backlogged: matcher blues/jazz tie-break (turnaround bass plays live-unreachable), bass tips surface · all 11 sprint tasks done, 2 returned-then-fixed (D-40, and D-41's predecessor D-31 pattern held: zero returns this sprint besides D-40), 0 unresolved · PR #3 updated; cron deleted (4 of 24 iterations) · ⚠️ NOTE: the Anthropic monthly spend limit is HIT — no further subagent work possible until raised
|
||||||
|
- 2026-07-10 · **sprint-integrated-glance iteration 3/24** · done: D-41 (`677d7b9` **all-expanded rail LIVE** — every station a permanently expanded row with education header [solo-scale, aim dots, voice-leading chips incl. wrap-around] + full gallery; playhead highlight-only proven byte-equal modulo highlight artifacts; focus toggle keeps the onFocusChord contract; show='bass' fall-through fixed; dense byte-identity proven across 336 SSR combos; black-on-accent 5.31:1 beats the old sub-AA white) — gate PASS, 19/19 SSR incl. independent theory recompute of a row's education · backlogged: TransitionChip "2 step down"→"whole step" wording (52 of 268 transitions) · L-42 (bass pattern renderer) dispatched — then C-42 closes
|
||||||
|
- 2026-07-10 · **sprint-integrated-glance iteration 2/24** · done: P-41 (`01a7c32` **the KB's first bass cell** — blues, 8 plays/172 total; gate machine-realized all 76 patterns in C AND A, 12 identities hold key-agnostically; PASS first try), L-40 (`c899132` **the restructure is live** — band below the main module, banner = the single loop display, RoadmapTrack/CurrentJamPanel unmounted, App's one GUITAR/PIANO/BASS selector drives band + dock, honest bass rows, GlanceRail yank-effect deleted; gate SSR 22/22, audio contract grep-clean, deletion sweep clean) · folded: smoke §7 resolveDegree wiring → C-42; VoicingBrowser show='bass' fall-through fix → D-41 (lock extended) · D-41 (all-rows-expanded rail) dispatched — then L-42 → C-42 closes
|
||||||
|
- 2026-07-10 · **sprint-integrated-glance iteration 1/24** · done: M-05, P-40 (`6f59add` kb-backlog refreshed — gate audited all 14 cells + 10 dates), C-40 (`090d3a9` drift guards, smoke 836 — gate recomputed all 224 truth-table cells), D-40 (`7d1f64c` integrated-glance concept — returned once: Dm7-specific piano math + 3 factual fixes incl. the interim page-yank, fixed, PASS re-gate with pixel-exact recompute), C-41 (`996218f` bass play schema, smoke 849 — degree-based, typed approaches, PASS with 19-semitone bound proven exactly maximal) · in flight: L-40 (App restructure — band up top, single loop display, one selector) ‖ P-41 (blues bass, first bass cell) · then D-41 → L-42 → C-42 closes
|
||||||
|
- 2026-07-10 · **iteration 4/24 — SPRINT `sprint-glance-and-loop` COMPLETE** · done: P-31 (`81cd230` blues piano cell, 164 plays — returned once: jump-kicks bars 3-4 dyad orientations flipped + 2 prose rewordings, fixed, PASS scoped re-gate), C-31 (sprint-end sweep at `81cd230` — build/validator/smoke 817 all green; full-App SSR renders with rail+gallery+strip coexisting; whole-sprint App.jsx diff = ONE hunk in the progression effect, contract grep 0 hits; no dead imports; every gate-promised follow-up verified filed) · all 11 sprint tasks done, 2 returned-then-fixed (D-31, P-31), 0 unresolved · PR #3 updated with the sprint summary; loop cron deleted after 4 of 24 budgeted iterations (board empty) · new backlog: loop-fixtures header line-ref drift; kb-backlog needs rnb+blues done entries
|
||||||
|
- 2026-07-10 · **iteration 3/24** · done: L-33 (`c78baf4` **glance mode LIVE** — playhead accordion, licks strip, heard-live fallback; gate SSR 37/37, dense-less VoicingBrowser byte-identical to 0945a08, token matcher proven hostile-proof, App.jsx untouched by construction), L-31 (`ce24d54` commit layer 2/3/6 — gate re-traced all five scenarios independently + 3 hostile traces; REPLACE_VOTES=3 proven load-bearing; audio contract grep-clean) · **all three user asks now end-to-end on the branch** · P-31 (blues piano, 164 plays) authored — gate in flight; its verifier self-caught 3 prose overclaims pre-review · C-31 promoted (holds until P-31 lands so the sweep sees a settled tree) · next: gate P-31 → C-31 closes the sprint
|
||||||
|
- 2026-07-10 · **iteration 2/24** · done: P-30 (`b51daa1` rnb piano cell, KB 154 plays — PASS first try, a piano-pack first; found+fixed its own 36-key-window stacking defect pre-review), L-30 (`4cc0009` detector rewrite: dup-collapse, weak-period ghost rejection, len 2–8, ≤1 edit/cycle with ≥2-exact evidence gate, recency-weighted coverage — smoke 817/817, gate ran 15 novel probes, 0.2–0.7ms/call) · L-33 built (playhead accordion + LicksStrip + heard-live fallback, SSR 24/24 self-checked) — gate in flight · L-31 dispatched with both gates' findings folded (flap-survival constraint, docstring ride-along) · both watchdog-stalled agents recovered cleanly via resume · promoted: P-31 · next: gate L-33, land L-31, then C-31 closes
|
||||||
|
- 2026-07-10 · **iteration 1/24** · done: M-04, D-30 (`0945a08` VoicingBrowser gallery — all shapes/styles side by side, no chips; PASS first try), C-30 (`fdd93c7` 17 loop fixtures + smoke wiring; PASS — found the len² self-overlap artifact as the root cause of the user's missed 3-chord loops, folded into L-30/L-31 DoDs), D-31 (`6c7a1a7` glance-mode "playhead accordion" doc — returned once on piano-gallery width math, fixed, PASS re-gate) · in flight: L-30 (detector redesign, dispatched early — C-30 contract ready), P-30 (rnb piano) — both stalled once on the 600s API watchdog near completion, both resumed via SendMessage · promoted: L-33 (ready, locks per D-31 doc) · finding worth noting: "5 chords then 2 others" passes at pure-function level — the live failure is the ghost-pattern flapping starving the 2-vote commit layer (L-31's trace case)
|
||||||
|
- 2026-07-10 · **new sprint `sprint-glance-and-loop`** seeded on the SAME branch (commits extend PR #3) · user asks: all voicing variations side-by-side with no button pushing; fix loop detection (misses a returning 3-chord loop and a 5-chords-then-2-others shape); glanceable zero-click learn session that follows the live jam · loop scheduled: /jam-loop every 30 min × 24 iterations (12 h, cron 13,43) · ready now (file-disjoint): C-30 ‖ D-30 ‖ D-31 ‖ P-30, then C-30→L-30→L-31 and D-30+D-31→L-33
|
||||||
|
- 2026-07-08 · **iteration 3/24** · done: L-21 (`951d544` VoicingBrowser live in ChordDetailModal Guitar/Piano tabs + JamGuide enlarged stations — the "playable voicings per chord" user ask is now end-to-end), L-23 (`f4e0ac6` getGuitarVoicings base-fret fix — 252 movable-shape placements corrected, A-shape C was labeled fret 1 not 3) — Critic PASS both, zero returns this round · follow-ups filed: VoicingBrowser `show` prop (Muse), negative-fret handling inconsistency (Luthier), stale JamGuide header comment · P-21 lock narrowed to the 3 guitar.js files → P-22 now disjoint · next ready (file-disjoint): P-21 ‖ P-22 ‖ L-22 (licks section may land empty-state-first per D-20 doc)
|
||||||
|
|||||||
@@ -0,0 +1,314 @@
|
|||||||
|
# Glance Mode — the Knowledge Center while the jam plays (task D-31)
|
||||||
|
|
||||||
|
> **Thesis:** while a loop is live, the Jam Guide section stops being "Roadmap + one
|
||||||
|
> thumbnail per chord, tap to see more" and becomes a **playhead accordion**: a
|
||||||
|
> station-aligned rail under the Roadmap where the *current* station's column is
|
||||||
|
> expanded to the full D-30 voicing gallery (every placeable guitar shape, or every
|
||||||
|
> piano style, side by side) and every other station shows its recommended thumb.
|
||||||
|
> The expansion **follows the playhead** — over one loop cycle you see every
|
||||||
|
> variation of every chord with **zero clicks**. A licks strip for the matched style
|
||||||
|
> sits directly below, auto-sorted to the chord you're on.
|
||||||
|
>
|
||||||
|
> User directive (2026-07-10, verbatim): *"expand the learn session so we see as
|
||||||
|
> much as possible in voicing variations and styles without having to click buttons,
|
||||||
|
> the idea is to have it open as the jam is playing."*
|
||||||
|
|
||||||
|
**Decision authority:** per the sprint header (user away, no user gate), Muse picks
|
||||||
|
the strongest layout and records rationale + rejected alternatives (§6).
|
||||||
|
Implementation is task **L-33**; this doc is its blueprint. Depends on **D-30**
|
||||||
|
(VoicingBrowser becomes an all-variations gallery — chips removed, every
|
||||||
|
shape/style rendered simultaneously, each with its own ▶).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. What exists today (read from the code, not assumed)
|
||||||
|
|
||||||
|
- `JamGuide.jsx` §jam renders `RoadmapAssembly`: `RoadmapTrack` on top, then a
|
||||||
|
**voicing strip** — ONE thumb per station (ChordDiagram thumb 75×72 px, or
|
||||||
|
MiniPiano D-24 cropped thumb ≈142 px for a 1-octave voicing / ≈266 px for a
|
||||||
|
2-octave one), tap-to-enlarge → full diagram + a `VoicingBrowser` mount.
|
||||||
|
Variations are therefore **one click away per chord** — the exact thing the
|
||||||
|
directive kills.
|
||||||
|
- `canonicalPos` (playhead station index, canonical KB order) already exists and
|
||||||
|
already drives `scrollIntoView` on the strip. **All glance data is already in
|
||||||
|
the component.**
|
||||||
|
- `VoicingBrowser` (post-D-30) renders ALL matching guitar shapes side by side
|
||||||
|
(cells ≈90–120 px wide) and all four piano styles side by side (cropped
|
||||||
|
MiniPiano thumbs ≈140 px+), each independently playable. Placeable guitar
|
||||||
|
shapes per chord: **3–5** (maj: 4 movable + 1 native open; min7/dom7/maj7: 3–4;
|
||||||
|
dim/half_dim: 2). Piano styles: always **4** (root/shell/rootlessA/rootlessB),
|
||||||
|
or the authored recipe (L-24) plus the computed four.
|
||||||
|
- `LickCard` has `size="thumb"` and `LicksSection` already knows how to read
|
||||||
|
`kb[style].instruments.guitar.licks` defensively.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Chosen layout — the playhead accordion
|
||||||
|
|
||||||
|
```
|
||||||
|
┌ KNOWLEDGE CENTER — ii–V–I in C major ────────────────────────────────── ▲ ┐
|
||||||
|
│ [▶ Jam Guide ●] [Explore] [Voicings] [Licks & Techniques] │
|
||||||
|
│ [🎸 Guitar][🎹 Piano][🎵 Bass] · [Jazz●][Blues][Rock]… │
|
||||||
|
│ ┌─ ROADMAP ──────────────────────────────────────────────────────────────┐ │
|
||||||
|
│ │ Dm7 (ii) ──C→B── G7 (V) «NOW» ──F→E── Cmaj7 (I) ▁▁▁▂█▂▁▁▁ beat │ │
|
||||||
|
│ └────────────────────────────────────────────────────────────────────────┘ │
|
||||||
|
│ ┌─ VARIATIONS · follows the playhead ────────────────────────────────────┐ │
|
||||||
|
│ │ Dm7 ┃ G7 — every shape ┃ Cmaj7 │ │
|
||||||
|
│ │ [thumb] ┃ [E Barre][A7 Barre][D Shape][Open G7] ┃ [thumb] │ │
|
||||||
|
│ │ (recmd.) ┃ ▶ ▶ ▶ ▶ ┃ (recmd.) │ │
|
||||||
|
│ └─────────────┸───────────────────────────────────────┸───────────────────┘ │
|
||||||
|
│ ┌─ JAZZ LICKS · over the V7 first ─────────────────────────── (scroll) ──┐ │
|
||||||
|
│ │ [lick thumb «fits G7»] [lick thumb] [lick thumb] … │ │
|
||||||
|
│ └────────────────────────────────────────────────────────────────────────┘ │
|
||||||
|
└─────────────────────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Columns = stations** (canonical KB order — the kb-plan §4 grid intent,
|
||||||
|
finally literal): the rail's columns sit under the Roadmap's stations, same
|
||||||
|
order, same labels/rn.
|
||||||
|
- **Active column = expanded**: the station at `canonicalPos` renders the full
|
||||||
|
D-30 gallery (`<VoicingBrowser rootPc quality show={instrument}/>`). Collapsed
|
||||||
|
columns render today's recommended thumb (the KB play's shape / the threaded
|
||||||
|
piano voicing) — so the loop context and lookahead never disappear.
|
||||||
|
- **The accordion advances with the playhead.** Chord changes are the animation;
|
||||||
|
nothing else moves. Constant footprint: expanding one column collapses the
|
||||||
|
previous one, so the rail never grows taller mid-jam.
|
||||||
|
- **Licks strip** below: thumb LickCards for the active style, level-filtered,
|
||||||
|
sorted current-chord-context first (see §2.4).
|
||||||
|
|
||||||
|
Why this wins: it satisfies "as much as possible without clicking" *without*
|
||||||
|
pretending everything fits at once (§3 shows it can't) — across one loop cycle
|
||||||
|
the player is shown 100% of the variations, always for the chord their hands are
|
||||||
|
on, which is when a variation is actually learnable.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Auto-follow rules (zero clicks, precisely)
|
||||||
|
|
||||||
|
1. **Driver = `canonicalPos`** (already computed in JamGuide from
|
||||||
|
`findLoopPosition` + `match.rotation`). Expanded column = `canonicalPos`;
|
||||||
|
`position === -1` (loop known but playhead unknown) → station 0 expands, so
|
||||||
|
the rail is never all-collapsed. The active column auto-scrolls into view
|
||||||
|
(`scrollIntoView({inline:'center'})` — the existing strip pattern, prop-driven
|
||||||
|
off `position`, **no rAF, nothing tied to the audio thread**). Respect
|
||||||
|
`prefers-reduced-motion`: `behavior: 'auto'` instead of `'smooth'` (new —
|
||||||
|
today's strip smooth-scrolls unconditionally; fix while in there).
|
||||||
|
2. **Instrument tab** (existing) selects the gallery family — guitar shapes vs
|
||||||
|
piano styles. It's a mode preference, not a per-chord click; it keeps its
|
||||||
|
current default/behaviour.
|
||||||
|
3. **Loop change** (`match.id` / style / instrument change): rail re-derives from
|
||||||
|
the new `stationVoicings`, any pin (§4) resets — this is the *existing*
|
||||||
|
`selectedStation` reset effect, renamed. **No loop matched but chords are
|
||||||
|
committing** (`currentChord` set, `match.matched` false): the rail degrades to
|
||||||
|
a single "heard live" gallery — `parseChord(currentChord)` (the same
|
||||||
|
`src/lib/voicings.js` parser `VoicingsSection` uses) → one expanded
|
||||||
|
VoicingBrowser, re-aimed on every chord commit. **Nothing heard at all**: the
|
||||||
|
existing dashed empty state; no rail, no licks strip.
|
||||||
|
4. **Licks strip**: `kb[activeStyle].instruments.guitar.licks` (the defensive
|
||||||
|
read `LicksSection`'s local `licksFor` helper already implements), shared
|
||||||
|
level filter applied. Sort: licks whose `chordContext` matches the current
|
||||||
|
station's rn or quality first, with an accent ring + "fits G7 — now"
|
||||||
|
microcopy on those; re-sorts as the playhead advances (a reorder of ≤4 thumb
|
||||||
|
cards, cheap). `chordContext` is **free text** — the match MUST be
|
||||||
|
token-boundary on rn/quality (a naive substring makes rn "I" match "♭VII",
|
||||||
|
"Imaj7", "I7"); never ship "fits G7" on a ♭VII lick. The ring + "fits — now"
|
||||||
|
microcopy are **strip-owned chrome** rendered around the card — LickCard
|
||||||
|
itself shows `chordContext` only at `size="full"` and stays untouched, as §5
|
||||||
|
promises. Licks are **guitar-only in the KB**: when the instrument tab is
|
||||||
|
piano, the strip still shows the guitar licks (consistent with the existing
|
||||||
|
Licks & Techniques section, which does the same) and says so in its heading
|
||||||
|
("guitar licks"). Style has no licks → the strip **hides entirely**; an
|
||||||
|
empty state would steal glance space to say nothing.
|
||||||
|
5. **No auto-sound, ever.** Auto-follow never triggers `chordAudio` — speaker
|
||||||
|
output feeds the live mic and would poison the detection that drives the
|
||||||
|
playhead (the L-20 caveat becomes a feedback loop). Every ▶ stays a gesture.
|
||||||
|
The rail shows the mic-feedback microcopy once, not per gallery.
|
||||||
|
6. **`onFocusChord` (D-03 Fretboard link) stays gesture-driven.** Auto-follow
|
||||||
|
does NOT emit focus-chord — repainting the main fretboard every 2 s
|
||||||
|
uninvited would fight the player's own key view. Only a pin (§4) emits it,
|
||||||
|
preserving today's semantics exactly.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Density & space budget — honest math
|
||||||
|
|
||||||
|
Geometry sources: dock body = 70vh; RoadmapTrack station min-width 168 px + 34 px
|
||||||
|
rail; ChordDiagram thumb 75×72 px (+label); MiniPiano cropped thumb 142 px
|
||||||
|
(1-octave voicing) to 266 px (2-octave, e.g. most rootless voicings) × ~51 px
|
||||||
|
tall; D-30 gallery cells ≈ 90–120 px (guitar) / ≈ 140–280 px (piano) wide,
|
||||||
|
≈ 140 px (guitar) / ≈ 125 px (piano) tall including label + ▶.
|
||||||
|
|
||||||
|
### 1280 × 900 (the target the task names)
|
||||||
|
|
||||||
|
Vertical: dock body 630 px − section nav ≈ 49 − instrument/style row ≈ 47 −
|
||||||
|
content padding 32 − RoadmapTrack ≈ 230 − gap 16 = **≈ 256 px glance budget**.
|
||||||
|
|
||||||
|
- Guitar rail (heading + one row of cells ≈ 190 px): **fits**. ~66 px spare.
|
||||||
|
- Piano rail (≈ 175 px): **fits**.
|
||||||
|
- Licks strip (thumb LickCard ≈ 165 px; heading + thumb row ≈ 190 px): does
|
||||||
|
**NOT** also fit — 190 + 190 = 380 > 256. It sits just below the fold,
|
||||||
|
reachable by the dock's existing vertical scroll (a flick, not a click).
|
||||||
|
Fully above the fold only from ≈ 1070 px window height. Said plainly:
|
||||||
|
**at 1280×900 you get Roadmap + the full variations rail without scrolling;
|
||||||
|
licks are one scroll-flick down.**
|
||||||
|
|
||||||
|
Horizontal (~1200 px usable): collapsed guitar column ≈ 95 px; collapsed piano
|
||||||
|
column ≈ 160–280 px (D-24 crop width varies with voicing span); expanded guitar
|
||||||
|
gallery 3–5 cells ≈ 340–540 px. **Expanded piano gallery — the honest figure:**
|
||||||
|
root/shell cells are 1-octave crops ≈ 160 px, but **rootless A/B of any true-7th
|
||||||
|
chord span past one octave** (e.g. Dm7 rootlessA → notes [17, 21, 24, 28]), so
|
||||||
|
D-24's crop gives them a 2-octave keyboard = 266 px thumb ≈ 284 px cell. The
|
||||||
|
gallery is therefore 160 + 160 + 284 + 284 + gaps + section p-3 ≈ **940 px** —
|
||||||
|
not the ~640 px four 1-octave cells would suggest.
|
||||||
|
|
||||||
|
| Loop | Guitar rail width | Piano rail width | One row? |
|
||||||
|
|---|---|---|---|
|
||||||
|
| 3–4 stations | 2–3×95 + ~450 ≈ **640–740 px** | 2–3×~200 + ~940 ≈ **1350–1550 px** | guitar ✓ · piano ✗ (scrolls at ~1200 usable) |
|
||||||
|
| 8 stations (post-L-30) | 7×95 + ~450 ≈ **1115 px** | 7×~200 + ~940 ≈ **2300 px** | guitar ✓ (just) · piano ✗ |
|
||||||
|
|
||||||
|
**Cut order (what goes first):**
|
||||||
|
1. **Licks strip drops below the fold** (never cut, just deferred to scroll).
|
||||||
|
2. **Rail scrolls horizontally** with the active column auto-centred (the
|
||||||
|
existing strip pattern) — cells are **never shrunk** below the D-30 sizes;
|
||||||
|
a diagram you can't read is worth less than one you scroll to. This is the
|
||||||
|
piano rail's **normal state on any loop containing 7th chords — i.e. most
|
||||||
|
of them** (a rootless gallery is ~940 px on its own), not just long loops;
|
||||||
|
L-33's commit-5 viewport check must expect the piano rail to scroll, never
|
||||||
|
assert "one row fits".
|
||||||
|
3. **Narrow only (§ below): collapsed columns reduce to "next" only.**
|
||||||
|
|
||||||
|
### ~640 px wide (half-snapped window)
|
||||||
|
|
||||||
|
~576 px usable. The rail flips to the kb-plan §4 narrow rule — one thing per row:
|
||||||
|
- Row 1: the expanded gallery for the current station (guitar: 5 cells wrap to
|
||||||
|
2 rows ≈ 300 px; piano: 4 cells wrap to 2 rows ≈ 260 px).
|
||||||
|
- Row 2: a single **"next: Cmaj7"** collapsed thumb (lookahead is the one piece
|
||||||
|
of context worth its pixels at this width); other stations are dropped — the
|
||||||
|
Roadmap above still shows the whole loop.
|
||||||
|
- Licks strip: single-column, below, via vertical scroll.
|
||||||
|
Glance guarantee at narrow = **current chord's full gallery + the next chord's
|
||||||
|
thumb**, no interaction.
|
||||||
|
|
||||||
|
### 1280 × 800 (the older Electron-default figure in D-20)
|
||||||
|
|
||||||
|
Budget shrinks to ≈ 186 px — the guitar rail (~190 px) is 1 row of cells with the
|
||||||
|
heading merged into the rail's top edge (drop the standalone heading line,
|
||||||
|
−18 px) and fits; everything else as at 900.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Interaction stays optional (but stays)
|
||||||
|
|
||||||
|
Nothing essential is behind a click; everything useful still responds to one:
|
||||||
|
|
||||||
|
- **▶ per gallery cell** (D-30): audition that voicing. Keyboard-reachable,
|
||||||
|
descriptive `aria-label`s, one-at-a-time playback (D-30's stop-previous
|
||||||
|
contract).
|
||||||
|
- **Pin a station**: tapping a *collapsed* column pins its gallery open,
|
||||||
|
overriding auto-follow (the accordion stops moving) — this **replaces**
|
||||||
|
today's tap-to-enlarge and inherits its semantics: the pinned station emits
|
||||||
|
`{rootPc, quality}` via `onFocusChord` (D-03 Fretboard guide tones), and the
|
||||||
|
existing reset effect (loop/style/instrument change → null) clears it.
|
||||||
|
Unpin = tap again or tap the visible "follow the jam" chip that appears while
|
||||||
|
pinned. `aria-pressed` on columns, `aria-current` on the live one.
|
||||||
|
- **Tap a lick thumb** → the card enlarges inline (`size="full"`); tap again to
|
||||||
|
collapse. The thumb already shows the full tab shape — enlarging is comfort,
|
||||||
|
not information.
|
||||||
|
- **Chord label tap** → `onChordClick` → ChordDetailModal, as everywhere else.
|
||||||
|
|
||||||
|
Focus order follows DOM order (columns left→right, then licks); all targets keep
|
||||||
|
`focus-visible:ring-2 ring-accent`, min 32 px height. Tokens only — everything
|
||||||
|
here uses existing `surface/panel/border/accent` + amber; **no new colour**.
|
||||||
|
Contrast inherits the measured D-20 §8 commitments (accent small text on
|
||||||
|
`bg-surface` cards; gray-400 floor for load-bearing labels; gray-500 microcopy
|
||||||
|
only).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Migration order for L-33 (green at every commit)
|
||||||
|
|
||||||
|
**App.jsx contract: UNTOUCHED — zero changes, not even additive.** Every input
|
||||||
|
glance mode needs (`detectedProgression`, `keyInfo`, `chordHistory`, `bpm`,
|
||||||
|
`currentChord`, `onFocusChord`, `onChordClick`) already flows into JamGuide.
|
||||||
|
Audio callbacks are therefore untouched by construction. If L-33 finds a gap,
|
||||||
|
the rule is prop-addition-only on the existing mount, never a callback/ref edit.
|
||||||
|
|
||||||
|
Files (for Maestro to re-lock at promotion):
|
||||||
|
|
||||||
|
| File | Kind of change |
|
||||||
|
|---|---|
|
||||||
|
| `src/components/GlanceRail.jsx` | **NEW** — pure presentational: props `{ stations, activeIndex, pinnedIndex, onPin, instrument, keyRoot }`; composes collapsed thumbs (existing ChordDiagram/MiniPiano) + one `<VoicingBrowser show={instrument}/>` for the expanded column |
|
||||||
|
| `src/components/JamGuide.jsx` | **Restructured (jam section only)** — RoadmapAssembly's voicing strip + enlarge block replaced by GlanceRail + LicksStrip; `selectedStation` becomes `pinnedStation` (same reset effect, same `onFocusChord` wiring); `licksFor` — today a closure-local function inside `LicksSection` (JamGuide.jsx:489), not an export — is **lifted out during the restructure** and shared with the strip. Sections 2–4, the shell, nav, and collapsed bar untouched |
|
||||||
|
| `src/components/VoicingBrowser.jsx` | **Additive-optional** — a `dense` prop (trim section padding, suppress the per-mount mic microcopy since the rail shows it once). Skip entirely if the D-30 cells already sit within the §3 budget |
|
||||||
|
| `src/components/LickCard.jsx` | **Untouched** (`thumb`/`full` already exist) |
|
||||||
|
| `src/App.jsx`, `RoadmapTrack.jsx`, `MiniPiano.jsx`, `ChordDiagram.jsx`, all `src/lib/**` | **Untouched** |
|
||||||
|
|
||||||
|
Commit order:
|
||||||
|
|
||||||
|
1. **Extract `GlanceRail.jsx`** rendering *today's* strip behaviour verbatim
|
||||||
|
(thumbs + tap-to-enlarge), JamGuide mounts it — a pure move, zero visual diff.
|
||||||
|
2. **Accordion**: expanded column = `activeIndex` (auto-follow off
|
||||||
|
`canonicalPos`), pin/unpin replaces tap-to-enlarge, the VoicingBrowser mount
|
||||||
|
moves from the enlarge block into the expanded column; reduced-motion guard
|
||||||
|
on the auto-scroll.
|
||||||
|
3. **No-loop fallback**: `parseChord(currentChord)` single gallery.
|
||||||
|
4. **LicksStrip**: thumb cards, level filter, context-first sort + live ring,
|
||||||
|
hide-when-empty, tap-to-enlarge.
|
||||||
|
5. **Narrow reflow + cut rules** (§3): horizontal-scroll behaviour, ≤640 px
|
||||||
|
next-only collapse; check 1280×900, 1280×800, ~640 px.
|
||||||
|
|
||||||
|
Each commit: `npm run build` + `node scripts/smoke.mjs` green; Critic gates.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Rationale + rejected alternatives (no user gate this sprint)
|
||||||
|
|
||||||
|
**Chosen — playhead accordion**, because: (a) it is the kb-plan §4 grid
|
||||||
|
(columns = chords, active-column highlight, narrow → one-per-row) applied to
|
||||||
|
variations; (b) constant footprint that survives 8-station loops (L-30) instead
|
||||||
|
of degrading; (c) 100% of variations shown per loop cycle with zero clicks, and
|
||||||
|
always for the chord under the player's hands — the moment a grip is learnable;
|
||||||
|
(d) it *reuses* D-30's gallery as-is and App.jsx needs nothing.
|
||||||
|
|
||||||
|
**Rejected A — "everything expanded" grid** (every station × every variation at
|
||||||
|
once — the literal maximal reading of the directive). Killed by §3's math: piano
|
||||||
|
is 4 stations × 4 styles = 16 cells at the honest §3 sizes (rootless cells
|
||||||
|
≈ 284 px) ≈ **3,500+ px** wide, or 3+ wrapped rows ≈ 480 px
|
||||||
|
tall — both force scrolling *while playing*, which is worse than zero clicks:
|
||||||
|
it's continuous manual tracking. At 8-station loops it's hopeless on any
|
||||||
|
viewport. Guitar-only at exactly 3 stations barely fits — a layout that only
|
||||||
|
works for its demo case is not a design.
|
||||||
|
|
||||||
|
**Rejected B — "Now panel"** (full-width mega-view of only the current chord:
|
||||||
|
giant gallery + licks + scale, no station columns). Maximum per-chord detail,
|
||||||
|
but it discards lookahead — mid-jam the *next* chord matters more than the one
|
||||||
|
already sounding — and at 120 BPM a 4-chord loop swaps the entire panel every
|
||||||
|
~2 s: visually violent, nothing is on screen long enough to read. The accordion
|
||||||
|
keeps 80% of the detail and all of the context.
|
||||||
|
|
||||||
|
**Rejected C — side-by-side split** (Roadmap left, variations dock right).
|
||||||
|
A 4-station track already needs 4×168 + 3×34 ≈ 774 px; splitting 1280 gives it
|
||||||
|
~640 — the flagship Roadmap gains a permanent horizontal scrollbar to make room
|
||||||
|
for a panel that duplicates its station order 90° rotated. Collapses entirely at
|
||||||
|
narrow. Rejected on viewport economics.
|
||||||
|
|
||||||
|
**Rejected D — timed carousel** (auto-cycle variations for the current chord
|
||||||
|
every N seconds). Zero clicks, technically — but motion untied to the music is
|
||||||
|
the most distracting thing a stage display can do, and it invents a second clock
|
||||||
|
next to the playhead. The music already provides the rhythm of change; follow it.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Out of scope / flags for Maestro
|
||||||
|
|
||||||
|
- **Explore/Voicings/Licks sections**: unchanged; glance mode lives entirely in
|
||||||
|
the jam section. (The Voicings section already follows `currentChord` — that
|
||||||
|
behaviour is untouched.)
|
||||||
|
- **Piano collapsed-thumb width variance** (142–266 px per D-24's span-crop) is
|
||||||
|
the piano rail's main width pressure; if Critic finds real loops where it
|
||||||
|
reads badly, a future D-task could cap collapsed piano thumbs to a 1-octave
|
||||||
|
window around the bass — **not** in L-33's scope.
|
||||||
|
- **`dense` prop on VoicingBrowser** is optional and Muse-owned; L-33 should
|
||||||
|
attempt the rail with plain D-30 cells first.
|
||||||
|
- No new tokens, no new dependencies, no KB/theory/audio changes anywhere in
|
||||||
|
this design.
|
||||||
@@ -0,0 +1,422 @@
|
|||||||
|
# Integrated Glance — the Jam Guide joins the main module (task D-40)
|
||||||
|
|
||||||
|
> **Thesis:** the Jam Guide stops being the last collapsible at the bottom of the
|
||||||
|
> page and becomes a **full-width, always-open band directly below the instrument
|
||||||
|
> view** — the third element of the main module. The loop is shown **once**, in
|
||||||
|
> ProgressionBanner (where the user says it already lives); the Roadmap track
|
||||||
|
> retires and its education (solo scales, guide tones, voice-leading) folds into
|
||||||
|
> the rail's station headers. The rail itself flips from the D-31 playhead
|
||||||
|
> accordion to **all stations expanded at once, as vertical rows** — every loop
|
||||||
|
> chord's full voicing gallery permanently visible, the playhead highlighting
|
||||||
|
> (never revealing) the active row. One global GUITAR/PIANO/BASS selector — App's
|
||||||
|
> existing `instrument` state — drives everything.
|
||||||
|
>
|
||||||
|
> User directive (2026-07-10, verbatim): *"i would like to move it up and
|
||||||
|
> integrate it somewhat in the space of the main module up top. or maybe right
|
||||||
|
> below it as it is super important. … i would like to be able to see the loop
|
||||||
|
> clearly, no need to have this repeated again. as its already in the main module
|
||||||
|
> … only one selection for GUITAR/PIANO/BASS and everything should show in that
|
||||||
|
> instrument. … i'd like to see all the chords and their voicings in a specific
|
||||||
|
> way in case a loop is detected (or at least just like 4 chords or something at
|
||||||
|
> least, so you can follow and potentially learn new ways to play it while you
|
||||||
|
> are playing the loop.) scrolling is easier then clicking"*
|
||||||
|
|
||||||
|
**Decision authority:** per the sprint header (no user gate), Muse picks the
|
||||||
|
strongest option and records rejected alternatives (§7). Implementation is
|
||||||
|
**L-40** (App restructure, §6.1) then **D-41** (rail rework, §6.2). This doc
|
||||||
|
supersedes `glance-mode.md` §1's accordion where they conflict — the user's
|
||||||
|
scroll license overturns D-31's "everything expanded" rejection (Rejected A
|
||||||
|
there), with the axis flipped to vertical (§4).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. What exists today (read from the code)
|
||||||
|
|
||||||
|
App.jsx mount order: `ProgressionBanner` (~609) → instrument row (~618–630:
|
||||||
|
`Fretboard`/`BassFretboard`/`Piano` at 70% + `ProgressionSuggestions` 30%) →
|
||||||
|
`CurrentJamPanel` (~634) → `LoopStation` (~642) → Debug/Drum/Tuner collapsibles →
|
||||||
|
**`JamGuide` last (~712)**. The global `instrument` state (App.jsx:58,
|
||||||
|
`'piano'|'guitar'|'bass'`) has its selector in the controls bar (~484) and drives
|
||||||
|
the main instrument views + DebugView — but **JamGuide ignores it** and runs its
|
||||||
|
own internal Guitar/Piano/Bass tabs (JamGuide.jsx ~405–434, local state ~208).
|
||||||
|
|
||||||
|
The detected loop renders **twice**: ProgressionBanner's loop row (compact chips,
|
||||||
|
active chip highlighted via `findLoopPosition`) and `RoadmapTrack` inside the
|
||||||
|
JamGuide jam section (stations with solo-scale labels, guide-tone dots,
|
||||||
|
voice-leading rails, playhead + beat grid). Below the Roadmap, `GlanceRail`
|
||||||
|
(L-33) is a playhead **accordion**: one station's gallery expanded at a time —
|
||||||
|
the exact "it changes when the chord is not playing" complaint.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Placement — a full-width band directly below the instrument view
|
||||||
|
|
||||||
|
**Chosen: the Jam Guide content mounts as a full-width, always-open band
|
||||||
|
immediately below the instrument row, replacing `CurrentJamPanel`'s slot (before
|
||||||
|
`LoopStation`).** The four-section Knowledge Center dock stays at the bottom as
|
||||||
|
the browse/study area, minus its jam section (§5).
|
||||||
|
|
||||||
|
Why *below* the main module and not *inside* it:
|
||||||
|
|
||||||
|
- **Width math kills "inside".** The only free space inside the main module is
|
||||||
|
the 30% `ProgressionSuggestions` column (~360px at 1280) and the banner's
|
||||||
|
interior. A single piano station's gallery is **~1,178px** worst case: the
|
||||||
|
gallery calls `pianoVoicing` with no `prev` (VoicingBrowser.jsx:161), and
|
||||||
|
MiniPiano's D-24 crop is C-aligned (`octStart = floor(minNote/12)`), so any
|
||||||
|
station rooted **above D** crosses the C boundary even in root position and
|
||||||
|
shell — recomputed G7: root [7,11,14,17], shell [19,23,29], rootlessA
|
||||||
|
[23,26,29,33], rootlessB [17,21,23,26] → **all four cells are 2-octave 284px
|
||||||
|
crops** ≈ 4×284 + 24 gaps + 18 chrome ≈ 1,178px. (glance-mode.md's ~940px was
|
||||||
|
the Dm7-specific figure; 1-octave root/shell crops exist only for roots C–D.)
|
||||||
|
Nothing gallery-shaped fits inside the module without crushing the neck/keys —
|
||||||
|
the surface the player's eyes track continuously.
|
||||||
|
- **"The main module" to the user = banner + big instrument view** — the
|
||||||
|
real-time detection surface. The guide answers a different question ("what
|
||||||
|
can I play on each chord of this loop") at a different rhythm (study-while-
|
||||||
|
looping). Directly below = one saccade down, same screenful top edge, no
|
||||||
|
competition for the detection pixels. The user himself offered "or maybe
|
||||||
|
right below it" — and the space math makes that the only honest reading.
|
||||||
|
- **Always open, zero chrome.** No collapse header (scroll past it if unwanted
|
||||||
|
— scroll > click), no section nav, no internal instrument tabs, no style
|
||||||
|
tabs, no level chips. The band is a pure auto surface: detection picks the
|
||||||
|
loop and style, the ONE controls-bar selector picks the instrument. The
|
||||||
|
`styleOverride`/style-tab machinery (JamGuide.jsx ~210–212, ~438–458) **dies
|
||||||
|
with the tabs**: the band always follows `match.style`; the heard-live
|
||||||
|
LicksStrip's `styleId` falls back to `styles[0]` when nothing is matched;
|
||||||
|
browsing OTHER styles stays reachable via the dock's own style chips
|
||||||
|
(LicksSection and ExploreSection each keep theirs). When no loop is matched
|
||||||
|
the band degrades to the existing "heard live" single gallery for
|
||||||
|
`currentChord`; when nothing is heard, a slim one-line hint (~40px) so it
|
||||||
|
never wastes main-module space.
|
||||||
|
- The band gets a micro-header line (`JAM GUIDE — {matched name} · in C major`,
|
||||||
|
uppercase tracking-widest gray-500 style), not a button.
|
||||||
|
|
||||||
|
Vertical position at 1280×900 (~860px usable): header ≈56 + controls bar ≈52 +
|
||||||
|
banner ≈140 + instrument row ≈300 + margins ≈24 → **the band starts ≈570px
|
||||||
|
down**; its first ≈290px are visible at rest, and one scroll-flick puts the
|
||||||
|
whole rail at the top of the viewport (§4 math). Estimates for the module
|
||||||
|
heights; verified figures for the rail.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. The single loop display — ProgressionBanner survives, RoadmapTrack retires
|
||||||
|
|
||||||
|
**Call: ProgressionBanner's loop row is THE loop display. RoadmapTrack is
|
||||||
|
unmounted** (L-40 removes the import/mount; the file stays in place like the
|
||||||
|
EducationPanel precedent — deletion filed to backlog).
|
||||||
|
|
||||||
|
The user told us where the loop lives: *"no need to have this repeated again.
|
||||||
|
as its already in the main module"* — i.e. the banner. The banner is compact,
|
||||||
|
up top, always visible, and **already carries the playhead**: `findLoopPosition`
|
||||||
|
highlights the active loop chip (accent glow + amber rn). There is nothing to
|
||||||
|
absorb on that front — the beat grid's "current beat" was chord-accurate anyway
|
||||||
|
(RoadmapTrack's own comment: "coarse, chord-accurate — matches
|
||||||
|
ProgressionBanner"). **ProgressionBanner.jsx needs zero edits.**
|
||||||
|
|
||||||
|
Honest disposition of RoadmapTrack's unique value:
|
||||||
|
|
||||||
|
| RoadmapTrack feature | Disposition |
|
||||||
|
|---|---|
|
||||||
|
| Playhead (active station) | Already in the banner's loop chips — nothing lost |
|
||||||
|
| Beat grid + progress bar | **Dropped.** It never showed sub-chord progress (chord-accurate by construction); the BPM readout already lives in the controls-bar badge. Loss: the downbeat tick visual. If missed, a slim progress underline beneath the banner's loop chips is a future 1-point polish — explicitly NOT in L-40/D-41 |
|
||||||
|
| Solo-scale label per station ("G mixolydian") | **Folds into each rail row's header** (§4) via `soloScale` from theory.js |
|
||||||
|
| Guide-tone lane (3rd filled / 7th hollow dots) | **Folds into each rail row's header** ("aim" dots, same accent-filled/hollow language) via `guideTones` |
|
||||||
|
| Voice-leading rails (7→3 half-step arrows) | **Folds into a compact transition chip** at the end of each row header: "next: F→E · ½ step down" (via `voiceLeadingPairs`; wrap-around chip on the last row says "loop"). The between-columns arrow SVG dies; the information survives |
|
||||||
|
| Station "next" lookahead glow | Superseded: next row gets a small "next" tag; the whole loop is visible anyway |
|
||||||
|
|
||||||
|
Interim honesty: L-40 unmounts RoadmapTrack **before** D-41 builds the row
|
||||||
|
headers, so for one gate cycle the solo-scale/guide-tone/voice-leading education
|
||||||
|
is absent from the page (the banner still shows the loop; the accordion rail
|
||||||
|
still shows voicings). Accepted — D-41 follows immediately in the same serialized
|
||||||
|
chain; Critic should not flag the gap as a regression.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Instrument threading — one selector, honest bass
|
||||||
|
|
||||||
|
JamGuide's internal `INSTRUMENTS` tabs, `COMPUTED_INSTRUMENTS`,
|
||||||
|
`availableInstruments`, and local `instrument` state (JamGuide.jsx ~42–47, ~178–
|
||||||
|
184, ~208, ~405–434) are **deleted**. App's existing `instrument` flows down as
|
||||||
|
a prop. Full prop paths to every consumer:
|
||||||
|
|
||||||
|
| Consumer | Path |
|
||||||
|
|---|---|
|
||||||
|
| GlanceRail (band) | `App.jsx instrument` (line 58) → `<JamGuide instrument={instrument}>` → `<GlanceRail instrument={instrument}>` (prop already exists; only its source changes) |
|
||||||
|
| VoicingBrowser, heard-live fallback (band) | App → JamGuide → `<VoicingBrowser show={instrument}>` (JamGuide.jsx ~494) |
|
||||||
|
| LicksStrip (band) | App → JamGuide → `<LicksStrip instrument={instrument}>` (both mounts, ~498 and ~757) |
|
||||||
|
| `stationVoicings` memo (band) | App → JamGuide — the memo's `instrument` dependency reads the prop |
|
||||||
|
| VoicingsSection (dock) | App → `<KnowledgeDock instrument={instrument}>` (§5) → `<VoicingsSection instrument={instrument}>` → its `<VoicingBrowser show={instrument}>` (ExplorePanel.jsx:425, today defaulting to `'both'`) |
|
||||||
|
| LicksSection (dock) | **No prop** — LicksSection is a module-local function in **JamGuide.jsx:562** (NOT an ExplorePanel export), and its heading is already statically honest ("Guitar licks · tab reads high e on top…"); licks are guitar-only in the KB (C-20 schema), so an `instrument` prop would be dead on arrival. Recorded so nobody threads it |
|
||||||
|
| ExploreSection (dock) | **No prop needed** — it renders progression chips + famous progressions, no instrument-specific renderer; chord taps open ChordDetailModal, which has its own user-driven Guitar/Piano tabs. Recorded so nobody threads a dead prop |
|
||||||
|
| DebugView | Already receives `instrument` (App.jsx ~676) — untouched |
|
||||||
|
|
||||||
|
The only `ExplorePanel.jsx` signature change is
|
||||||
|
`VoicingsSection({ keyInfo, chordHistory, currentChord, instrument })`
|
||||||
|
(its named exports are LevelChips / ChordPickerToolbar / GuitarGrid / PianoGrid /
|
||||||
|
ExploreSection / VoicingsSection — no LicksSection there).
|
||||||
|
|
||||||
|
### The honest bass state (until C-41/P-41/L-42 land)
|
||||||
|
|
||||||
|
BassFretboard covers the main view; the KB has **zero bass content** and both
|
||||||
|
gallery generators are wrong for bass (guitar shapes are not bass patterns;
|
||||||
|
`pianoVoicing` is piano). Showing guitar diagrams under BASS would break the
|
||||||
|
one-selector promise the user just made. Instead, when `instrument === 'bass'`
|
||||||
|
and a loop is matched:
|
||||||
|
|
||||||
|
- Station rows still render their full headers — chord, rn, solo scale, aim
|
||||||
|
dots. **Guide tones ARE the bassist's target notes**; none of this is
|
||||||
|
instrument-specific.
|
||||||
|
- The gallery slot renders a computed **root · fifth · approach** line per
|
||||||
|
station: root name, fifth name, and the chromatic approach into the NEXT
|
||||||
|
station's root ("approach: G♯ → A", computed from `stations[i+1].rootPc − 1`
|
||||||
|
semitone — pure arithmetic on data the component already has; **no theory.js
|
||||||
|
change**). This is the honest useful minimum, not a placeholder.
|
||||||
|
- ONE notice for the whole rail (not per row): *"Authored bass patterns are on
|
||||||
|
the way (blues first) — meanwhile: roots, fifths, and the approach into the
|
||||||
|
next chord."*
|
||||||
|
- The licks strip hides under bass (guitar tab licks are noise to a bassist
|
||||||
|
mid-jam; under piano the strip keeps today's honest "guitar licks" heading).
|
||||||
|
|
||||||
|
**What L-42 slots in:** a per-station `<BassPatternCard>` (new component,
|
||||||
|
Luthier/Muse per the C-41 schema — 4-string, frets 0–15) mounted in the same
|
||||||
|
gallery slot of each row, replacing the computed line **when the matched style
|
||||||
|
ships a bass cell**; the computed root/fifth/approach line remains the
|
||||||
|
per-station fallback for styles without bass content. The rail's row structure,
|
||||||
|
highlight, and header need zero changes for L-42 — that's the contract.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. The all-stations-expanded rail — vertical rows, playhead highlights
|
||||||
|
|
||||||
|
**Axis call: stations are VERTICAL ROWS** — one row per loop chord, each row =
|
||||||
|
station header + that chord's full horizontal voicing gallery; the page scrolls
|
||||||
|
down. All rows render all cells, always. **The playhead HIGHLIGHTS the active
|
||||||
|
row and never hides, collapses, or reveals content.**
|
||||||
|
|
||||||
|
Why vertical beats all-horizontal: a 4-station piano loop laid out as expanded
|
||||||
|
columns is ≈4 × 1,470px ≈ **5,900px wide** — continuous sideways tracking while
|
||||||
|
playing, on the axis mouse wheels don't scroll. Vertically, the worst piano row
|
||||||
|
is ≈ 284 (threaded cell — an authored LH 3-5-7-9 also crops 2 octaves) + 8 +
|
||||||
|
1,178 (§1 gallery) ≈ **1,470px of cells**, which does NOT fit 1,240px usable —
|
||||||
|
the gallery **flex-wraps to a second cell line** (~300px row height). **No
|
||||||
|
horizontal scroll survives because rows wrap, not because they fit.** Rows stack
|
||||||
|
~170–300px tall and ≥4 chords sit within one to one-and-a-half screenfuls —
|
||||||
|
the "at least 4 chords so you can follow" ask, under the user's scroll license.
|
||||||
|
|
||||||
|
### Row anatomy (canonical KB order, same as the banner's loop after rotation)
|
||||||
|
|
||||||
|
- **Header (~30px):** chord label (gray-100 bold) + rn + "now" badge (accent,
|
||||||
|
when active) / "next" tag · solo-scale label ("solo · G mixolydian") · aim
|
||||||
|
dots (3rd filled accent, 7th hollow — RoadmapTrack's GuideDot language,
|
||||||
|
honest "5th" fallback kept) · transition chip ("next: F→E · ½ step down";
|
||||||
|
last row: "loop"). Header data via theory.js `guideTones` /
|
||||||
|
`voiceLeadingPairs` / `soloScale` — read-only imports.
|
||||||
|
- **Gallery:** first cell = the *station's own* voicing — guitar: the KB play's
|
||||||
|
recommended shape badged "play" (when present); piano: the threaded/authored
|
||||||
|
`stationVoicings[i].voicing` labeled honestly (e.g. "LH 3-5-7-9") — this is
|
||||||
|
where the accordion's collapsed-thumb value survives. Then the full
|
||||||
|
VoicingBrowser gallery (`show={instrument}`, `dense`): every placeable guitar
|
||||||
|
shape / all four piano styles, each with its own ▶ (D-30 one-at-a-time
|
||||||
|
playback contract). Bass: the §3 computed line (later the L-42 pattern card).
|
||||||
|
- **Active row:** `border-accent ring-2 ring-accent bg-accent/10` + "now" badge
|
||||||
|
+ `aria-current="true"`. Inactive rows `border-border bg-surface`, opacity
|
||||||
|
floor 0.85 (never dim below AA). Tokens only; no new colour.
|
||||||
|
- **Mic-feedback microcopy** once below the last row (rail-owned; galleries run
|
||||||
|
`dense`), as today.
|
||||||
|
|
||||||
|
### Focus semantics — pin simplified
|
||||||
|
|
||||||
|
With everything always expanded, the pin has nothing to hold open. It collapses
|
||||||
|
to a **focus toggle**: tapping a row header toggles that station as
|
||||||
|
`focusedStation` (renamed from `pinnedStation`, same JamGuide-owned state, same
|
||||||
|
reset-on-loop/style/instrument-change effect, same `onFocusChord({rootPc,
|
||||||
|
quality})` emission — the D-03 fretboard guide-tone contract is byte-compatible).
|
||||||
|
A focused row shows an "aim on fretboard" chip; tap again (or the loop changes)
|
||||||
|
to clear. `aria-pressed` on the header button, min 32px target,
|
||||||
|
`focus-visible:ring-2 ring-accent` everywhere.
|
||||||
|
|
||||||
|
**No auto-scroll.** The band lives in page flow, so `scrollIntoView` would yank
|
||||||
|
the whole page while the user reads the looper below — the accordion's
|
||||||
|
auto-centre effect is **removed**, not ported (deleted in the same L-40 commit
|
||||||
|
that promotes the band, §6.1 step 2 — today it is contained only by the dock's
|
||||||
|
70vh scroller, which the band no longer has). The playhead highlight travels;
|
||||||
|
the user owns the scrollbar (their explicit preference). On 4-row loops the
|
||||||
|
whole rail is one screenful anyway; on 8-row loops the banner up top always
|
||||||
|
shows the position. (Internal-scroll variant rejected: a nested scrollbar caps
|
||||||
|
the rail at ~62vh ≈ 3 rows — breaks the ≥4-visible goal at 900px.)
|
||||||
|
|
||||||
|
### Licks strip
|
||||||
|
|
||||||
|
Directly below the last station row, unchanged in behaviour: thumb LickCards
|
||||||
|
(~165px wide, strip ≈190px tall with heading), context-sorted to the playhead
|
||||||
|
station via the token-boundary matcher, strip-owned "fits X — now" ring, hides
|
||||||
|
entirely when the style has no licks, hidden under bass (§3). One flick below
|
||||||
|
the rows — consistent with its D-31 position in the scroll order.
|
||||||
|
|
||||||
|
### Space math (verified numbers: guitar cell ~93px, piano cells 160–284px, piano gallery ~1,178px worst — §1, licks thumb ~165px)
|
||||||
|
|
||||||
|
Row heights: guitar row ≈ header 30 + cells ~140 + padding ≈ **185px**; piano
|
||||||
|
row ≈ 30 + one cell line ~125 + padding ≈ **170px** single-line, ≈ **300px**
|
||||||
|
when the gallery wraps to two cell lines. Row widths (cells): guitar ≈ play
|
||||||
|
cell + 3–5 gallery cells ≈ **460–650px**; piano ≈ threaded cell up to ~284 +
|
||||||
|
gallery up to ~1,178 ≈ **~1,470px worst case**. Piano rows rooted above D with
|
||||||
|
a true 7th — i.e. most stations of most jazz/gospel loops — exceed 1,240px and
|
||||||
|
**wrap** (single-line piano rows exist only for roots C–D or triad qualities);
|
||||||
|
rows never scroll horizontally.
|
||||||
|
|
||||||
|
| Scenario | 1280×900 (~1,240×860 usable) | ~640px wide (~576 usable) |
|
||||||
|
|---|---|---|
|
||||||
|
| 4-chord loop, guitar | 4×185 = **740px** — all 4 rows in one screenful (band scrolled to top); +190 licks strip = one flick more | cells fit one line (5×93+gaps ≈ 500); 4 rows ≈ 740px ≈ 1.3 screenfuls |
|
||||||
|
| 4-chord loop, piano | best case (roots C–D / triads) 4×170 = **680px** ≈ one screenful; honest 7th-chord case (the jazz flagship): rows wrap → up to 4×300 ≈ **1,200px ≈ 1.4 screenfuls** — still zero clicks; the scroll license covers it | gallery wraps to 2–3 cell-lines → row ≈ 300–430px; 4 rows ≈ 1,200–1,700px ≈ 2–3 screenfuls, zero clicks |
|
||||||
|
| 8-chord loop (post-L-30) | guitar ≈ 1,480px ≈ **1.7 screenfuls** / piano ≈ up to 2,400px ≈ **2.8 screenfuls** — scroll, highlight travels, banner keeps the position | ≈ 2.5–6 screenfuls; still zero clicks |
|
||||||
|
|
||||||
|
At rest (no scroll) the band's visible ≈290px shows the header line + ~1–1.5
|
||||||
|
rows — enough to see the "now" row when it's early in the loop; one flick brings
|
||||||
|
the rail to the top. The user licensed exactly this trade.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. What remains below — the dock slims to three sections, CurrentJamPanel retires
|
||||||
|
|
||||||
|
- **`KnowledgeDock`** (named export from JamGuide.jsx, §6.1): the bottom
|
||||||
|
collapsible keeps **Explore / Voicings / Licks & Techniques** — the browse
|
||||||
|
and study area (chord picker, KB progression browser, full lick grids, the
|
||||||
|
shared level filter). The **jam section is removed** (it IS the band now);
|
||||||
|
the dock's header drops the live match label and becomes static ("Knowledge
|
||||||
|
Center — browse & study"). Level-filter chips stay dock-only; the band shows
|
||||||
|
all levels (a glance surface filters nothing — directive 4).
|
||||||
|
- **`CurrentJamPanel` is unmounted by L-40.** The backlog already flags folding
|
||||||
|
it; the band moving into its exact slot makes its duplication terminal
|
||||||
|
(voicing strips → the rail; similar progressions → Explore; per-chord scale
|
||||||
|
labels → row headers). Honest loss: its mode-level `SCALE_IDEAS` prose and
|
||||||
|
`STYLE_VARIATIONS` cards exist nowhere else — the existing backlog item
|
||||||
|
("fold CurrentJamPanel's unique bits into the Knowledge Center") stays open
|
||||||
|
for Professor/Muse; the file is retired-in-place, deletion filed with
|
||||||
|
EducationPanel's. Note for Maestro: only `RiffDiagram.jsx` goes orphaned with
|
||||||
|
it — `ChordBox.jsx` is still imported by ChordDetailModal.jsx (lines 2, 58)
|
||||||
|
and ExplorePanel.jsx (lines 18, 170) and must **NOT** be deleted.
|
||||||
|
- **LoopStation** does not move — the band replaces `CurrentJamPanel` directly
|
||||||
|
above it, so it ends up right below the jam surface it feeds for free.
|
||||||
|
Debug/Drum/Tuner collapsibles unchanged.
|
||||||
|
- **ChordDetailModal, ProgressionSuggestions, Fretboard/Piano/BassFretboard,
|
||||||
|
ProgressionBanner:** zero edits.
|
||||||
|
|
||||||
|
Resulting App.jsx order: banner → instrument row → **Jam Guide band** →
|
||||||
|
LoopStation → Debug → Drum → Tuner → **KnowledgeDock**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Migration order — bounded scopes, green at every commit
|
||||||
|
|
||||||
|
Serialized: L-40 → D-41 (same surfaces). Each commit: `npm run build` +
|
||||||
|
`node scripts/smoke.mjs` green; Critic gates.
|
||||||
|
|
||||||
|
### 6.1 L-40 (Luthier) — App restructure + instrument threading + single loop display
|
||||||
|
|
||||||
|
**Files:** `src/App.jsx` (mounts + prop pass ONLY — 🚨 audio callbacks, refs,
|
||||||
|
AudioCapture props untouched, grep-gated), `src/components/JamGuide.jsx`,
|
||||||
|
`src/components/ExplorePanel.jsx` (VoicingsSection signature only — LicksSection
|
||||||
|
lives in JamGuide.jsx), `src/components/GlanceRail.jsx` (**one-line effect
|
||||||
|
deletion only**, see step 2 — re-lock at promotion per the ledger row).
|
||||||
|
**Not touched:** RoadmapTrack.jsx / CurrentJamPanel.jsx (unmounted, not edited),
|
||||||
|
ProgressionBanner.jsx, VoicingBrowser.jsx, all `src/lib/**`.
|
||||||
|
|
||||||
|
1. **Thread the instrument.** App passes `instrument` to the JamGuide mount;
|
||||||
|
JamGuide deletes its internal tabs/state/availability gating and consumes
|
||||||
|
the prop everywhere (§3 table); VoicingsSection gains the prop. Guide still
|
||||||
|
at the bottom, four sections intact. Green.
|
||||||
|
2. **Split and promote.** JamGuide.jsx → default export `JamGuide` (the band:
|
||||||
|
micro-header + jam content, always open, no section nav) + named export
|
||||||
|
`KnowledgeDock` (collapsible, 3 sections, level filter). App mounts the band
|
||||||
|
in CurrentJamPanel's slot, retires the CurrentJamPanel mount, keeps the dock
|
||||||
|
last. **RoadmapTrack unmounted** (loop now shown exactly once — the banner).
|
||||||
|
The band body for now = existing GlanceRail accordion + LicksStrip +
|
||||||
|
heard-live/empty fallbacks. **Same commit, mandatory:** delete GlanceRail's
|
||||||
|
auto-centre effect (GlanceRail.jsx:56–67 `scrollIntoView`) — it is contained
|
||||||
|
today only by the dock's 70vh `overflow-auto` body; in page flow the nearest
|
||||||
|
scroller is the DOCUMENT, so every playhead advance would yank the whole
|
||||||
|
page — the exact failure §4 forbids. Promoting the band and deleting the
|
||||||
|
effect must land together. Green.
|
||||||
|
3. **Honest bass state.** `instrument === 'bass'` + loop matched → the §3
|
||||||
|
computed root/fifth/approach rows + single notice (band-level; no further
|
||||||
|
GlanceRail edits). Green.
|
||||||
|
|
||||||
|
### 6.2 D-41 (Muse) — the all-expanded rail
|
||||||
|
|
||||||
|
**Files:** `src/components/GlanceRail.jsx` (rework), `src/components/JamGuide.jsx`
|
||||||
|
(band wiring: pass `keyMode`, `pinnedStation` → `focusedStation` rename,
|
||||||
|
LicksStrip/bass-slot composition into rows), `src/components/VoicingBrowser.jsx`
|
||||||
|
(**optional**, `dense`-path styling only). **Not touched:** App.jsx,
|
||||||
|
RoadmapTrack.jsx, ProgressionBanner.jsx, MiniPiano/ChordDiagram/LickCard, libs.
|
||||||
|
|
||||||
|
1. **Rows.** Accordion → all-expanded vertical rows: every station renders
|
||||||
|
header + full gallery permanently; active row highlight (`aria-current`);
|
||||||
|
pin → focus toggle (same onFocusChord contract). The `scrollIntoView`
|
||||||
|
effect is already gone (L-40 step 2) — verify none is reintroduced. Green.
|
||||||
|
2. **Absorb the roadmap.** Row headers gain solo-scale, aim dots, transition
|
||||||
|
chip (theory.js read-only imports); gallery gains the "play"/threaded first
|
||||||
|
cell. Green.
|
||||||
|
3. **Reflow + verify.** Narrow (~640px) cell-wrap per row; eyeball 1280×900,
|
||||||
|
1280×800, ~640; AA/focus audit; verify **rows wrap and never scroll
|
||||||
|
horizontally** (the piano worst case ≈1,470px of cells does NOT fit 1,240 —
|
||||||
|
§4), and recompute the honest screenful counts against the §4 table. Green.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Rejected alternatives
|
||||||
|
|
||||||
|
**Rejected A — the guide inside the main module** (banner absorbs the rail, or
|
||||||
|
the rail replaces the 30% ProgressionSuggestions column). Killed by width math —
|
||||||
|
and the corrected worst case only strengthens it: ~360px column vs a ~1,178px
|
||||||
|
piano gallery (§1); inside the banner it competes with the
|
||||||
|
key/history/now-chord — the one surface that must stay instantly readable. The
|
||||||
|
user's "or maybe right below it" is the version of his own ask that survives
|
||||||
|
arithmetic. Also rejected structurally: ProgressionBanner doing loops + history
|
||||||
|
+ now-chord + galleries is a god-component.
|
||||||
|
|
||||||
|
**Rejected B — all-horizontal expanded rail** (stations as columns, every column
|
||||||
|
expanded). The literal reading of "all voicings at once", and the axis the old
|
||||||
|
accordion already had. With the corrected cell widths it gets worse, not better:
|
||||||
|
4-station piano ≈ 5,900px wide; 8-station ≈ 11,800px; continuous sideways
|
||||||
|
tracking on the axis wheels don't scroll, whole stations hidden off-edge at any
|
||||||
|
moment — the directive's "follow while playing" fails exactly when it matters.
|
||||||
|
Vertical rows carry the same content with zero horizontal scroll (rows wrap,
|
||||||
|
§4).
|
||||||
|
|
||||||
|
**Rejected C — RoadmapTrack survives as the single loop display** (banner's loop
|
||||||
|
row dies instead). Keeps the education-dense artefact, but contradicts the
|
||||||
|
user's own account of where the loop lives ("it's already in the main module"),
|
||||||
|
costs ~230px of premium height above the rail, and the banner would still show
|
||||||
|
near-loop-shaped history chips — the "repeated again" feeling survives its own
|
||||||
|
fix. Folding the education into row headers (§2) keeps ~90% of the value at
|
||||||
|
~30px per row.
|
||||||
|
|
||||||
|
**Rejected D — keep the pin/accordion semantics inside the expanded rail**
|
||||||
|
(pinned row grows a bigger gallery). With everything expanded there is nothing
|
||||||
|
left to reveal; a "bigger on pin" state reintroduces layout shift mid-jam — the
|
||||||
|
exact complaint. The pin's two real jobs (fretboard guide tones, "hold still")
|
||||||
|
survive as the focus toggle.
|
||||||
|
|
||||||
|
**Rejected E — internal max-height scroller for the band** (~50–62vh, contained
|
||||||
|
auto-scroll). Caps visible rows at ~3 (< the user's "at least 4"), adds a nested
|
||||||
|
scrollbar inside the page scroll, and only exists to enable auto-scroll the
|
||||||
|
design doesn't want. Page flow + user-owned scrolling is simpler and matches
|
||||||
|
"scrolling is easier than clicking".
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Out of scope / flags for Maestro
|
||||||
|
|
||||||
|
- **ProgressionBanner polish** (progress underline beneath loop chips) — future
|
||||||
|
1-pointer, only if the beat grid is missed. Not in L-40/D-41.
|
||||||
|
- **Cleanup ticket:** RoadmapTrack.jsx, CurrentJamPanel.jsx and its now-orphaned
|
||||||
|
RiffDiagram.jsx join EducationPanel.jsx in the retire-then-delete backlog
|
||||||
|
item. ChordBox.jsx stays — it is live in ChordDetailModal + ExplorePanel (§5).
|
||||||
|
- **`SCALE_IDEAS`/`STYLE_VARIATIONS` prose** (CurrentJamPanel's unique content)
|
||||||
|
— the existing fold-into-Knowledge-Center backlog item stays open.
|
||||||
|
- **L-42 contract** (§3): bass pattern card mounts in the row gallery slot;
|
||||||
|
rail structure frozen for it.
|
||||||
|
- No new tokens, no new dependencies, no KB/theory/audio changes anywhere in
|
||||||
|
this design. All figures either verified (guitar/licks cells from the D-31
|
||||||
|
gate; piano worst case recomputed at the D-40 gate — G7 all-284px, §1) or
|
||||||
|
marked as estimates (module heights).
|
||||||
@@ -0,0 +1,658 @@
|
|||||||
|
# Jam Roulette — design spec (task D-62)
|
||||||
|
|
||||||
|
> **Thesis:** one button, two clicks, a jam. "Jam roulette" in the controls bar
|
||||||
|
> opens a genre menu (the 10 KB styles + Surprise me); picking one instantly
|
||||||
|
> rolls a random key + an interesting KB progression and **seeds the exact
|
||||||
|
> state live detection already writes** — `lockedKey`, `detectedProgression`,
|
||||||
|
> and a committed-shape `progressionVoteRef` — so the loop strip, the voicing
|
||||||
|
> rail, the licks strip, and the related-progressions card all populate
|
||||||
|
> **exactly as if the loop had been detected**. Musicians read the screen and
|
||||||
|
> start playing; the L-31 commit layer then treats the seed like any committed
|
||||||
|
> loop: agreeing detections confirm it, a genuinely different loop replaces it
|
||||||
|
> after `REPLACE_VOTES`, and New Song clears it. **No new parallel state** —
|
||||||
|
> the seed is a writer into the existing machine, not a second machine.
|
||||||
|
>
|
||||||
|
> User ask (verbatim, sprint goal 2026-07-11): *"one button that would be a
|
||||||
|
> random chord progression selection. a button up top 'jam roulette' and then
|
||||||
|
> select a genre (like we have jazz, blues rock etc) and then have a random key
|
||||||
|
> chosen and an interesting progression show up as a loop in the screen. it
|
||||||
|
> would fill in the loop section and a 4 bar progression or something so that
|
||||||
|
> everyone can see the key and the chords to be played with different voicing
|
||||||
|
> so they can start playing… then musicians can start playing and it continues
|
||||||
|
> from it"*
|
||||||
|
|
||||||
|
**Dependency note:** L-60 is dep-blocked on **C-50** (one-screen close-out).
|
||||||
|
This spec is written against `docs/design/one-screen.md`'s **target** layout
|
||||||
|
(controls bar per §1.1, slim loop strip per §1.2, the two-column dashboard),
|
||||||
|
which L-50 is building concurrently. Everything here that names the controls
|
||||||
|
bar or the strip means the *post-L-50* versions; the seed mechanism (§3) is
|
||||||
|
layout-independent and verified against App.jsx as it stands today (~b753b58).
|
||||||
|
|
||||||
|
Standing principles honoured: reuse, don't duplicate; nothing shown twice;
|
||||||
|
scroll > click; tokens only, no raw hex; the 🚨 App.jsx audio contract
|
||||||
|
(callbacks / ref-sync / AudioCapture untouched).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. UX flow
|
||||||
|
|
||||||
|
### 1.1 The button
|
||||||
|
|
||||||
|
- **Where:** right end of the controls bar, in the global-chrome cluster next
|
||||||
|
to one-screen §1.1's `⛶ Jam view` toggle ("a button up top" — the controls
|
||||||
|
bar is the app's persistent top chrome; the header row stays reserved for
|
||||||
|
Settings / New Song / Start).
|
||||||
|
- **What:** `🎲 Jam roulette` — same button language as the existing controls:
|
||||||
|
`px-3 py-1 rounded-lg border border-border text-sm text-gray-200
|
||||||
|
hover:border-gray-500 focus-visible:ring-2 focus-visible:ring-accent
|
||||||
|
transition-colors`. While a seed is active (unconfirmed, §1.3) the button
|
||||||
|
carries the seeded accent: `border-accent/40 text-accent bg-accent/10` +
|
||||||
|
`aria-pressed="true"` — same active treatment as the locked-key pill.
|
||||||
|
- **Keyboard:** real `<button>`, Tab-reachable, Enter/Space opens the menu.
|
||||||
|
|
||||||
|
### 1.2 The genre menu
|
||||||
|
|
||||||
|
Click → an anchored popover (not a page takeover; the jam never leaves the
|
||||||
|
screen): `absolute` panel under the button, `bg-panel border border-border
|
||||||
|
rounded-xl shadow-lg p-1 z-20`, one column of `<button>` rows
|
||||||
|
(`w-full text-left px-3 py-1.5 rounded-lg text-sm text-gray-200
|
||||||
|
hover:bg-accent/10 focus-visible:ring-2 focus-visible:ring-accent`):
|
||||||
|
|
||||||
|
1. **`✨ Surprise me`** — first row, divider under it (`border-b border-border`)
|
||||||
|
— uniform pick over the 10 styles, then §2 as normal.
|
||||||
|
2. **The 10 KB styles**, straight from the registry:
|
||||||
|
`Object.entries(kb).map(([id, s]) => s.meta.label)` — never a hard-coded
|
||||||
|
list; an 11th style appears here for free.
|
||||||
|
3. When a seed is active, row 0 becomes **`⟳ Re-roll — {styleLabel}`** (same
|
||||||
|
style, fresh key + progression, honouring §2's no-repeat memory) and
|
||||||
|
`✨ Surprise me` moves to row 1.
|
||||||
|
|
||||||
|
Escape / click-outside / picking a row closes it. Focus returns to the button.
|
||||||
|
Picking a genre seeds **instantly** — two clicks from cold to a full jam
|
||||||
|
dashboard. No confirmation step: re-rolling is cheaper than confirming.
|
||||||
|
|
||||||
|
### 1.3 The seeded indicator — honest provenance
|
||||||
|
|
||||||
|
The dashboard must not pretend the roulette loop was *heard*. Until live
|
||||||
|
detection confirms it, the slim loop strip's loop row swaps its chrome:
|
||||||
|
|
||||||
|
- The `♻` glyph becomes `🎲`; the `→ loop` tail becomes an amber provenance
|
||||||
|
chip: **`rolled · {styleLabel} · {progression.name} · {Σbars} bars — play
|
||||||
|
it!`** (`text-amber-400 text-xs` — amber is the app's established secondary
|
||||||
|
accent, the rn colour; no new token). Σbars comes from the KB `bars` array —
|
||||||
|
this is where "a 4 bar progression" is made visible.
|
||||||
|
- The loop chips themselves render **identically** to a detected loop (same
|
||||||
|
chip anatomy, chord + rn) — the chords are real instructions, only the
|
||||||
|
*provenance* differs.
|
||||||
|
- The moment the commit layer confirms the seed (§3.4 — first agreeing live
|
||||||
|
detection), the indicator flips to the normal `♻ … → loop` with no other
|
||||||
|
visual change: the honest signal that "the band is now playing what was
|
||||||
|
rolled". If a *different* loop replaces the seed, the indicator vanishes
|
||||||
|
with the seed (the new loop is detection-owned).
|
||||||
|
|
||||||
|
Empty-state note: pre-first-note the history slot still shows "Start
|
||||||
|
listening…" — correct and honest (nothing has been heard); the key chip shows
|
||||||
|
the rolled key immediately (it's a real `lockedKey`, rendered with the 🔒 pill
|
||||||
|
in the controls bar too, mode dropdown and unlock included — the rolled key is
|
||||||
|
a first-class key lock, not a special display).
|
||||||
|
|
||||||
|
### 1.4 Flow summary
|
||||||
|
|
||||||
|
Cold start: **🎲 → genre → the dashboard fills** (key chip + locked-key pill,
|
||||||
|
loop chips with rn, voicing rail with every station's shapes/voicings, licks
|
||||||
|
strip aimed at station 0, related progressions) → band reads, plays → playhead
|
||||||
|
lights on the first committed loop chord → detection confirms after ~2 cycles
|
||||||
|
→ 🎲 indicator becomes ♻ → the jam continues under pure live detection.
|
||||||
|
Mid-session: 🎲 acts as **New Song + seed** (§3.6) — one gesture, clean slate,
|
||||||
|
new card.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Randomization rules
|
||||||
|
|
||||||
|
All randomness lives in the seed function (plain `Math.random()`; no audio
|
||||||
|
contact). Inputs: the KB registry only.
|
||||||
|
|
||||||
|
### 2.1 Key
|
||||||
|
|
||||||
|
- **Root:** uniform over the 12 pitch classes, spelled from **`NOTES` (sharp
|
||||||
|
spellings)** — mandatory, not stylistic: `matchChordFromChroma` names every
|
||||||
|
committed chord via `noteName(r)` with `preferFlat=false` (theory.js:112,
|
||||||
|
445 — the live naming path), so only sharp spellings string-match detection
|
||||||
|
later (§3.3).
|
||||||
|
- **Mode:** taken directly from the rolled progression's `mode` field —
|
||||||
|
verified: **every KB progression encodes `mode`**, vocabulary
|
||||||
|
`major | minor | dorian | mixolydian` (grep across all 10
|
||||||
|
`progressions.js`), all four already present in the key-lock mode dropdown
|
||||||
|
and `SCALES`. No inference, no default needed.
|
||||||
|
- **Confidence:** `1` (the `applyLock` convention).
|
||||||
|
- Session memory: don't repeat the previous roll's root (re-draw once).
|
||||||
|
|
||||||
|
### 2.2 Progression pool ("interesting" AND seedable)
|
||||||
|
|
||||||
|
Per style, from `kb[style].progressions`, each entry realized + collapsed per
|
||||||
|
§3.2 first. **Pool membership = the hard bounds ∩ the round-trip invariant**
|
||||||
|
— a progression only rolls if the machine can genuinely confirm it:
|
||||||
|
|
||||||
|
- **Hard length bounds: collapsed length must be 2–8.**
|
||||||
|
- `< 2` — unrepresentable as a detected loop (`detectRepeatingProgression`
|
||||||
|
min pattern length 2). Today this excludes **nothing**: even
|
||||||
|
`funk-one-chord` collapses to **two** names (`X7, Xsus4` — its
|
||||||
|
`['dom7','dom7','sus4','dom7']` qualities survive collapse because a
|
||||||
|
quality change on the same root is a different name; wrap-dedupe then
|
||||||
|
drops the trailing `X7`). The rule stays as future-proofing for a true
|
||||||
|
single-name vamp, and the code comment must say so honestly.
|
||||||
|
- `> 8` — the detector's candidate loop only sweeps lengths **2–8**
|
||||||
|
(theory.js:627). A longer seed is not merely unconfirmable: as the band
|
||||||
|
plays it, in-window *fragments* of it become the only detectable
|
||||||
|
structure and **replace the seed after `REPLACE_VOTES` = 3** — the card
|
||||||
|
self-destructs into a sub-loop. Excludes today: `jazz-blues` (collapsed
|
||||||
|
10), `blues-quickchange` (9), `bossa-blue` (10).
|
||||||
|
- **Round-trip invariant (the real gate) — the protocol is load-bearing:**
|
||||||
|
*a progression passes iff, with the 32-commit window filled with
|
||||||
|
repetitions of its seeded canonical form (steady state) and truncated at
|
||||||
|
**every** partial-cycle offset (0…len−1 commits past a cycle boundary),
|
||||||
|
the real `detectRepeatingProgression` returns exactly that form at **all**
|
||||||
|
offsets.* Steady-state-plus-all-offsets is the honest protocol because a
|
||||||
|
jam is sampled mid-cycle, not at cycle boundaries — and a naive "feed 2
|
||||||
|
clean cycles" protocol gets *both* failure modes wrong: it spuriously
|
||||||
|
fails all 8 two-name vamps (2 cycles × 2 names = 4 commits, under
|
||||||
|
theory.js:609's history ≥ 6 gate — a ramp artifact, not a steady-state
|
||||||
|
failure), and it *passes* `blues-8bar`, whose 7-name form actually fails
|
||||||
|
at exactly **1 of its 7 phase offsets** (4 cycles + 4 extra commits → the
|
||||||
|
detector prefers the `[C7, G7]` alternation). Round-trip is *empirical,
|
||||||
|
not constructional* — the detector's recency×occurrence scoring can prefer
|
||||||
|
an internal alternation over the full form at some phase. The invariant is
|
||||||
|
**precomputed over the whole registry** (lazy module-level memo on first
|
||||||
|
roulette open — key-independent per §3.3.3, so one sweep in C covers all
|
||||||
|
keys; an 11th style or new progression joins the pool automatically) and
|
||||||
|
**pinned by the L-60 commit-1 smoke sweep** (same protocol verbatim —
|
||||||
|
§3.4 flag 2).
|
||||||
|
- **Honest numbers today (Critic gate ran the real matcher + detector under
|
||||||
|
the protocol above):** **4/56 fail** — the 3 over-length forms plus
|
||||||
|
`blues-8bar`'s phase-offset failure — so the **expected pool is 52/56**,
|
||||||
|
pinned exactly by the smoke sweep. (Pre-fix-(a), 10/56 additionally
|
||||||
|
returned NO MATCH for their own collapsed form and `country-145` matched a
|
||||||
|
different progression — §3.3.1; all return to the pool with the fix, since
|
||||||
|
matching post-fix is constructional, §3.3.4.)
|
||||||
|
- **Weight = levelW × lenW** (over pool members only):
|
||||||
|
- `levelW`: `level === 'intermediate'` → **2**; foundation/untagged → **1**
|
||||||
|
(the D-20 rule: untagged counts foundation). "Interesting" = intermediate
|
||||||
|
leans in, foundations still roll.
|
||||||
|
- `lenW`: collapsed length **3–7 → 2** (the "4-bar-ish" sweet spot — note
|
||||||
|
a collapsed 12-bar blues is 7 names, so the genre's staple stays strong);
|
||||||
|
**2 and 8 → 1**.
|
||||||
|
- **No-repeat memory:** `rouletteMemoryRef` (plain `useRef([])` in App —
|
||||||
|
UI-state ref, never read by audio code) keeps the last **6** rolled
|
||||||
|
progression ids; they're excluded from the pool. If exclusion leaves the
|
||||||
|
pool empty (small styles — several have 5 entries), fall back to excluding
|
||||||
|
only the immediately previous id. The ref survives New Song deliberately
|
||||||
|
(variety across songs is the point) and dies with the session.
|
||||||
|
- Weighted draw; push id to memory.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. The seed mechanism — spec'd against the real App state
|
||||||
|
|
||||||
|
### 3.1 What the seed writes (exhaustive)
|
||||||
|
|
||||||
|
`rollJam(styleId)` — a plain function in App.jsx, sibling of
|
||||||
|
`quickLock`/`newSong`:
|
||||||
|
|
||||||
|
```
|
||||||
|
1. newSong() // §3.6 — the clean-slate rule
|
||||||
|
2. const info = { root: NOTES[rolledPc], mode: prog.mode, confidence: 1 }
|
||||||
|
setLockedKey(info)
|
||||||
|
effectiveKeyRef.current = info // the quickLock precedent —
|
||||||
|
chordVotesRef.current = [] // detection uses the key NOW
|
||||||
|
3. const loop = seedableLoop(prog, rolledPc) // §3.2 — realize→collapse→canonicalize
|
||||||
|
4. setDetectedProgression(loop)
|
||||||
|
5. progressionVoteRef.current = {
|
||||||
|
committedKey: loop.join(','), // the committed shape, L-31's own
|
||||||
|
candidateKey: null,
|
||||||
|
candidateCount: 0,
|
||||||
|
seeded: true, // §3.4 — the one flag L-60 adds
|
||||||
|
}
|
||||||
|
progressionMissRef.current = 0 // (newSong already did; explicit)
|
||||||
|
6. setSeedInfo({ styleLabel, name, bars }) // §3.5 — display provenance
|
||||||
|
7. rouletteMemoryRef bookkeeping (§2.2)
|
||||||
|
```
|
||||||
|
|
||||||
|
Nothing else. **Never touched:** `handleNote` / `handleChroma` / `handleOnset`
|
||||||
|
/ `handleWaveform`, AudioCapture and its props, `noteHistoryRef`,
|
||||||
|
`keyVotesRef`, `chromaRingRef`, the loop engine. The seed is display state +
|
||||||
|
the two progression refs the L-31 effect already owns — exactly the audio
|
||||||
|
contract boundary the L-60 ledger row grep-gates.
|
||||||
|
|
||||||
|
Synergy worth stating: `handleChroma` bails while `effectiveKeyRef.current` is
|
||||||
|
null — a cold session normally can't commit chords until key detection locks.
|
||||||
|
The seed provides the key up front, so **the very first chroma frames can
|
||||||
|
commit chords**, and the diatonic bonus in `matchChordFromChroma` is already
|
||||||
|
biased toward the rolled key. The roulette makes detection *faster*, not
|
||||||
|
just decorated.
|
||||||
|
|
||||||
|
### 3.2 Realizing the loop — `seedableLoop(progression, keyRootPc)`
|
||||||
|
|
||||||
|
The chord names must be **byte-identical** to what detection would commit when
|
||||||
|
the band plays the progression, or the commit layer treats the seed as a rival
|
||||||
|
forever. Three steps, each forced by a verified code path:
|
||||||
|
|
||||||
|
1. **Realize** (the JamGuide `stationVoicings` formula, JamGuide.jsx:262-273):
|
||||||
|
per station `rootPc = (keyRootPc + degrees[i]) % 12`,
|
||||||
|
`name = NOTES[rootPc] + (CHORD_TYPES[qualities[i]]?.suffix ?? '')`.
|
||||||
|
Sharp spellings only (§2.1).
|
||||||
|
2. **Collapse consecutive duplicate names**, then if `first === last` drop the
|
||||||
|
last — mirrors `detectRepeatingProgression`'s collapse of back-to-back
|
||||||
|
commits (theory.js:611-615) *plus* the cyclic wrap (in the live stream the
|
||||||
|
loop's tail flows into its head; `setChordHistory` also dedupes
|
||||||
|
consecutive identical commits, App.jsx:363). E.g. `blues-12bar` degrees
|
||||||
|
`[0,0,0,0,5,5,0,0,7,5,0,7]` → 7 names `[I,IV,I,V,IV,I,V]` realized;
|
||||||
|
`funk-one-chord` keeps its quality changes (same root, different suffix ≠
|
||||||
|
duplicate → `[X7, Xsus4]`). Name-collapse is provably **key-independent**
|
||||||
|
(§3.3.3) — the collapsed *shape* is a property of the progression, which
|
||||||
|
is what makes fix (a) (§3.3.2) computable once, key-free.
|
||||||
|
3. **Canonicalize rotation** with **theory.js's own rule** — lexicographically
|
||||||
|
smallest rotation compared via `join('\0')` (`canonicalize`,
|
||||||
|
theory.js:579-586, currently private). `detectRepeatingProgression`
|
||||||
|
returns *its* canonical rotation; the agreement branch compares exact
|
||||||
|
`join(',')` strings, so the seed must store the same rotation or
|
||||||
|
confirmation is unreachable (§3.4 flag 2).
|
||||||
|
|
||||||
|
**Where it lives:** `seedableLoop` exported from **`src/lib/match.js`**
|
||||||
|
(loop-identity is that file's mandate; it already imports theory.js
|
||||||
|
read-only; L-51 is adding adjacent exports there and L-60 runs after C-50, so
|
||||||
|
no lock overlap). For step 3 it needs `canonicalize`: **preferred — additive
|
||||||
|
`export` keyword on theory.js's `canonicalize`** (one-word diff; shared-file
|
||||||
|
lock, flag to Maestro at L-60 promotion; smoke's `loop-fixtures.mjs` already
|
||||||
|
byte-checks a replica of this function, so a second in-app replica would
|
||||||
|
triple the drift surface). Fallback if Maestro won't open theory.js: replica
|
||||||
|
in match.js with a drift comment + smoke guard, the loop-fixtures precedent.
|
||||||
|
|
||||||
|
Display note: the banner shows the seeded loop in this canonical rotation —
|
||||||
|
**identical to how any live-detected loop displays today**; the JamGuide rail
|
||||||
|
re-rotates to canonical KB order via `match.rotation` regardless, so the
|
||||||
|
learning surface always reads in textbook order (ii first in a ii–V–I).
|
||||||
|
|
||||||
|
### 3.3 Matching + round-trip — constructional after fix (a)
|
||||||
|
|
||||||
|
#### 3.3.1 The bug fix (a) exists for (Critic gate, real matcher run)
|
||||||
|
|
||||||
|
`buildLoopIndex` (match.js:126-141) indexes each progression's **raw,
|
||||||
|
uncollapsed** `degrees` — but the seeded loop (and the *live* commit stream,
|
||||||
|
which dedupes back-to-back chords) is the **collapsed** form, a different
|
||||||
|
sequence length whenever a progression repeats a chord across adjacent slots
|
||||||
|
or across the wrap. The gate ran the real matcher: **10/56 progressions
|
||||||
|
return NO MATCH for their own collapsed form** — `jazz-blues`, `blues-12bar`,
|
||||||
|
`blues-quickchange`, `blues-8bar`, `blues-minor`, `bossa-blue`,
|
||||||
|
`funk-one-chord`, `country-folk-axis`, `gospel-iv-passing-dim`,
|
||||||
|
`gospel-tonicized-amen` — and `country-145` is worse: its raw 8-shape matches
|
||||||
|
a *different* progression. Rolling blues would produce a populated banner and
|
||||||
|
an **empty JamGuide**. This is also a **pre-existing live-detection bug** the
|
||||||
|
roulette work surfaces: a band playing a real 12-bar blues today commits the
|
||||||
|
collapsed stream and gets an empty JamGuide — fix (a) repairs both at once.
|
||||||
|
|
||||||
|
#### 3.3.2 Fix (a) — collapsed-form indexing (Maestro-directed, mandatory)
|
||||||
|
|
||||||
|
`buildLoopIndex` **additionally** indexes each progression's collapsed form:
|
||||||
|
|
||||||
|
- **Collapse rule (key-free):** dedupe adjacent stations whose
|
||||||
|
`(degree, suffix)` pairs are equal, where
|
||||||
|
`suffix = CHORD_TYPES[quality]?.suffix ?? ''` (compare *suffixes*, not raw
|
||||||
|
quality tokens — two out-of-vocab qualities both fall back to `''` and
|
||||||
|
produce equal names, so a token comparison would under-collapse); then
|
||||||
|
**wrap-dedupe**: if the last pair equals the first, drop the last (one
|
||||||
|
check suffices post-collapse — only the boundary pair can merge).
|
||||||
|
- **What's indexed:** `canonicalDegrees(collapsedDegrees)` → an entry whose
|
||||||
|
`progression` is the **collapsed projection** of the authored one:
|
||||||
|
`{ ...progression, degrees, qualities, rn (first-of-run), bars (summed per
|
||||||
|
run), sourceIndex }` where `sourceIndex[i]` = the first raw station index
|
||||||
|
of collapsed station `i`. Same `id`/`name`/`level`/`mode`/`songs`/`tip`.
|
||||||
|
- **Only when it differs:** entries are added only where the collapsed shape
|
||||||
|
≠ the raw shape — **45/56 index once, 11 twice**. The full census (gate,
|
||||||
|
raw → collapsed): `jazz-blues` 12→10, `blues-12bar` 12→7,
|
||||||
|
`blues-quickchange` 12→9, `blues-8bar` 8→7, `blues-minor` 12→5,
|
||||||
|
`bossa-blue` 16→10, `funk-one-chord` 4→2, `country-145` 8→4,
|
||||||
|
`country-folk-axis` 8→7, `gospel-iv-passing-dim` 4→3,
|
||||||
|
`gospel-tonicized-amen` 5→4.
|
||||||
|
- **The true compatibility invariant (stated exactly):** collapsed entries
|
||||||
|
are **appended after all raw entries**, so `matchLoopToProgression`'s
|
||||||
|
strict-`>` disambiguation keeps every previously-matching input's winner
|
||||||
|
**on ties** — but append order never engages on a strict score win, and
|
||||||
|
one real case exists: for input shape `[0,5,0,7]` with
|
||||||
|
`maj/maj/maj/dom7` qualities (e.g. `[C, F, C, G7]`), `country-145`'s
|
||||||
|
collapsed form scores 4×100−4 and **strictly beats** the incumbent
|
||||||
|
`country-bluegrass-cycle` (3×100−4 — its quality set lacks `dom7`).
|
||||||
|
Gate-verified registry-wide (raw + collapsed × 3 keys): this is the
|
||||||
|
**only** winner change, and it is an **improvement** — the progression
|
||||||
|
actually being played now self-attributes (pure-triad `[C,F,C,G]` input
|
||||||
|
still ties and keeps `bluegrass-cycle`). So: **behaviour-preserving except
|
||||||
|
where a collapsed entry strictly dominates the disambiguation score,
|
||||||
|
enumerated: `country-145`, desired direction.** Previously-`NO_MATCH`
|
||||||
|
collapsed streams now match; that is the point.
|
||||||
|
- **Rotation:** for a collapsed-form hit, `rotationToCanonicalOrder` runs
|
||||||
|
against the *collapsed* degrees — equal lengths by construction. (Today's
|
||||||
|
length-mismatch guard, match.js:208, silently returns 0, which is exactly
|
||||||
|
what would break the playhead if the raw progression were returned
|
||||||
|
instead.)
|
||||||
|
|
||||||
|
Downstream, JamGuide renders the projection's stations naturally — a 12-bar
|
||||||
|
renders **7 stations, one per distinct change** (the right glance-rail
|
||||||
|
answer: duplicate consecutive bars add no voicing information; the strip's
|
||||||
|
loop chips carry position). The one alignment consumers need: **every
|
||||||
|
authored-play lookup must remap through `sourceIndex`** — otherwise a
|
||||||
|
collapsed match reads the first N raw play entries against the wrong
|
||||||
|
stations. There are **four** raw-indexed lookups, not two:
|
||||||
|
|
||||||
|
- **guitar** shape path, JamGuide.jsx:280, and **piano** recipe path, :288 —
|
||||||
|
both inside the `stationVoicings` memo: `play.chords[prog.sourceIndex?.[i]
|
||||||
|
?? i]`;
|
||||||
|
- **bass**, inside `BassGuideRows`: `play?.chords?.[i]?.pattern` (:530) and
|
||||||
|
`…?.note` (:533). Mechanism chosen: the `stationVoicings` memo attaches a
|
||||||
|
per-station **`sourceIndex` field** (`stations[i].sourceIndex =
|
||||||
|
prog.sourceIndex?.[i] ?? i`), and the two bass lines read
|
||||||
|
`play?.chords?.[st.sourceIndex ?? i]` — BassGuideRows already receives the
|
||||||
|
stations, so **no new prop**; the heard-live path's synthetic station has
|
||||||
|
no `sourceIndex` and the `?? i` fallback keeps it exact.
|
||||||
|
|
||||||
|
Blues ships guitar, piano *and* bass cells, and its bass pack covers **four
|
||||||
|
collapse-affected progressions** (`blues-12bar`/`quickchange`/`8bar`/
|
||||||
|
`minor`), two of them pool members (`blues-12bar` 7, `blues-minor` 5) — so
|
||||||
|
the bass remap is load-bearing for the roulette itself, not just for live
|
||||||
|
detection. Four bounded lines + the one field attachment; JamGuide.jsx joins
|
||||||
|
L-60's lock (§5).
|
||||||
|
|
||||||
|
#### 3.3.3 Key-independence proof (why the index can be built key-free)
|
||||||
|
|
||||||
|
Realized names are `Nᵢ = NOTES[(k + dᵢ) mod 12] + suffix(qᵢ)` for key root
|
||||||
|
`k`. Adjacent names are equal ⇔ their roots are equal AND their suffixes are
|
||||||
|
equal. Roots: `(k + dᵢ) ≡ (k + dⱼ) (mod 12) ⇔ dᵢ ≡ dⱼ (mod 12)` — `k`
|
||||||
|
cancels, and KB degrees live in 0–11, so this is plain `dᵢ = dⱼ`. Suffixes:
|
||||||
|
the 14 `CHORD_TYPES` suffixes are pairwise distinct (verified by inspection,
|
||||||
|
theory.js:41-55), so equal suffixes ⇔ the same suffix class — identical
|
||||||
|
quality for in-vocab tokens, the shared `''` fallback for out-of-vocab ones
|
||||||
|
(hence §3.3.2 compares suffixes). Therefore **name-collapse ≡
|
||||||
|
(degree, suffix)-pair collapse in every key**: `buildLoopIndex` computes the
|
||||||
|
collapsed shape once with no key in hand, and `seedableLoop`'s per-key name
|
||||||
|
collapse always produces that same shape. The same argument makes the §2.2
|
||||||
|
**round-trip invariant key-independent**: the detector consumes only the name
|
||||||
|
stream's *equality structure*, which is key-invariant; the lexicographic
|
||||||
|
rotation choice may differ per key, but seed and detector canonicalize
|
||||||
|
identically over identical names, so agreement of the two outputs is
|
||||||
|
preserved — one sweep in C covers all 12 keys.
|
||||||
|
|
||||||
|
#### 3.3.4 What is constructional vs what stays empirical
|
||||||
|
|
||||||
|
- **Matching is constructional post-fix-(a):** every rolled loop *is* some
|
||||||
|
progression's collapsed canonical shape, and fix (a) indexes exactly those
|
||||||
|
— `matchLoopToProgression` cannot miss. (It may attribute to a same-shape
|
||||||
|
sibling — the §4 quirk, now including within-style cases like
|
||||||
|
`country-145`-collapsed ≡ `country-bluegrass-cycle`.)
|
||||||
|
- **Detector round-trip stays empirical** — hence §2.2's precomputed
|
||||||
|
registry-wide invariant (steady-state window, all partial-cycle offsets)
|
||||||
|
as the pool gate: today 4/56 fail — 3 over-length + `blues-8bar`'s
|
||||||
|
1-of-7-offsets self-competition; expected pool **52/56**, pinned by smoke.
|
||||||
|
Worked example of a passer: rolled `jazz-251-major` in A → seeded
|
||||||
|
`[Bm7, E7, Amaj7]` (canonical rotation) → band plays it → detection
|
||||||
|
commits the same sharp names from the same `CHORD_TYPES` suffixes → after
|
||||||
|
2 cycles (6 commits, clearing the history ≥ 6 gate) the detector returns
|
||||||
|
the identical canonical form at every subsequent commit, whatever the
|
||||||
|
phase → agreement branch fires. ✓
|
||||||
|
|
||||||
|
#### 3.3.5 Honest limit — qualities detection can't name
|
||||||
|
|
||||||
|
`MATCH_CHORD_TYPES` (theory.js:59-61) is a *subset* — KB qualities `dim7` and
|
||||||
|
`min6` (7 progression slots across the KB, counted) can never be committed by
|
||||||
|
detection under those exact names (it will hear `dim` / `m7`-ish). For such
|
||||||
|
rolls the seed displays the authored chord, and once the band plays,
|
||||||
|
detection consistently returns the *as-heard* loop → the `REPLACE_VOTES`
|
||||||
|
branch swaps in reality after 3 commits. That is the machine working as
|
||||||
|
designed — the card yields to what's actually played, and the re-match still
|
||||||
|
lands on the same KB progression (degree shape unchanged, quality is only a
|
||||||
|
tie-breaker). Same story if the band plays triads where the KB says sevenths.
|
||||||
|
Not a bug; documented behaviour.
|
||||||
|
|
||||||
|
### 3.4 The L-31 commit-layer interplay — branch by branch
|
||||||
|
|
||||||
|
The effect (App.jsx:181-213) runs once per chord commit (`[chordHistory]`
|
||||||
|
deps — seeding itself triggers exactly one run via `newSong`'s
|
||||||
|
`setChordHistory([])`, landing in the null branch at miss 1). With a seeded
|
||||||
|
vote `{committedKey: S, candidateKey: null, candidateCount: 0, seeded: true}`:
|
||||||
|
|
||||||
|
| Branch | Seeded behaviour | Verdict |
|
||||||
|
|---|---|---|
|
||||||
|
| **Agreement** (`vote.committedKey === key`) | Refreshes the loop, drops rivals — **L-60 adds:** `vote.seeded = false` + `setSeedInfo(null)`. The seed is now a normal committed loop; every subsequent rule applies verbatim | works, 2-line addition |
|
||||||
|
| **Rival counting** (`candidateKey` bookkeeping) | A transient sub-cycle detection during ramp-up (real: a 7-name collapsed 12-bar contains `[I,IV]` twice before the full form recurs) starts a candidate; `committedKey` survives the rebuild — **but the rebuild literal at line 207 drops `seeded`** | 🚩 **flag 3 below** |
|
||||||
|
| **Replacement** (`candidateCount ≥ REPLACE_VOTES=3`) | A genuinely different, consistently-detected loop replaces the seed; new vote is detection-owned (no `seeded`) — **L-60 adds** `setSeedInfo(null)` here | correct as-is: rolled cards must yield to a real band playing something else |
|
||||||
|
| **Null branch / miss counter** (`NULL_CLEAR=6`) | **Kills EVERY seed during ramp-up — no length survives.** L-31's "fills never null" reasoning assumed the loop is *in the history window* — a seeded loop isn't yet. Exact timeline: the seed's own effect run (via `newSong`'s history reset) is **miss 1**; commits 1–5 take the counter to 6 → **the card is wiped at commit 5**. But the earliest *any* detection can land is **commit 6** — `detectRepeatingProgression` hard-gates raw history `< 6` (theory.js:609), so even a 2-name loop cannot confirm before then, and a loop of length *len* needs ~2·len commits besides. **Unguarded, every seed dies exactly one commit before the earliest possible confirmation** — the guard is mandatory for every pool member, not a long-loop nicety | 🚩 **flag 1 — the critical fix** |
|
||||||
|
|
||||||
|
**Flags for L-60 (each a 1-line change inside the effect — the one licensed
|
||||||
|
edit in that block):**
|
||||||
|
|
||||||
|
1. **Null-clear guard:** `if (progressionMissRef.current >= NULL_CLEAR &&
|
||||||
|
!progressionVoteRef.current?.seeded) { …clear… }`. Semantics: *a seeded
|
||||||
|
card is an instruction, not an observation — it stays until confirmed
|
||||||
|
(then normal rules resume), replaced by a consistently-detected different
|
||||||
|
loop, re-rolled, or New Song.* A band that noodles structurelessly under a
|
||||||
|
seeded card keeps the card — intended: it's what they were asked to play.
|
||||||
|
2. **Rotation equality is constructional** (§3.2/§3.3) — no branch change,
|
||||||
|
but if `seedableLoop` skipped canonicalization the agreement branch would
|
||||||
|
be unreachable and the seed would churn-replace with itself (rotated) at
|
||||||
|
commit 3. L-60's smoke-visible invariant is §2.2's registry-wide sweep,
|
||||||
|
**protocol verbatim:** *for each of the 56 progressions, fill the
|
||||||
|
32-commit window with repetitions of the seeded canonical form (steady
|
||||||
|
state) and truncate at every partial-cycle offset (0…len−1 commits past a
|
||||||
|
cycle boundary); the progression passes only if
|
||||||
|
`detectRepeatingProgression` returns exactly the seeded canonical form at
|
||||||
|
ALL offsets.* Expected: 52 passers pinned; the 4 named failures
|
||||||
|
(`jazz-blues`, `blues-quickchange`, `bossa-blue`, `blues-8bar`) asserted
|
||||||
|
as excluded from the pool. (A naive 2-clean-cycles feed is wrong in both
|
||||||
|
directions — §2.2.)
|
||||||
|
3. **Preserve `seeded` across candidate rebuilds:** line 207 becomes
|
||||||
|
`{ committedKey, candidateKey: key, candidateCount: 1,
|
||||||
|
seeded: vote?.seeded ?? false }` — otherwise one transient ghost
|
||||||
|
sub-cycle strips the flag and flag 1's guard dies with it, resurrecting
|
||||||
|
the ramp-up kill through the side door.
|
||||||
|
|
||||||
|
Nothing else in the effect treats a seed differently — `COMMIT_VOTES` never
|
||||||
|
applies (a committed key exists), and `progressionMissRef.current = 0` on any
|
||||||
|
detection keeps the counter honest once structure appears.
|
||||||
|
|
||||||
|
### 3.5 The provenance flag — machine truth vs display echo
|
||||||
|
|
||||||
|
Two readers need "seeded, unconfirmed": the effect (guard, flag 1) and the
|
||||||
|
banner/button (indicator, §1.3). The effect reads `vote.seeded` — its own ref,
|
||||||
|
already in hand, mutation-safe. The **display** cannot read a ref reactively,
|
||||||
|
so App gains one small UI-state:
|
||||||
|
`const [seedInfo, setSeedInfo] = useState(null)` —
|
||||||
|
`{ styleLabel, name, bars } | null`, passed to ProgressionBanner as a
|
||||||
|
presentational prop (and read by the roulette button for its active state +
|
||||||
|
re-roll row). This is **provenance metadata that exists nowhere else** (style
|
||||||
|
label, progression name, bar count) — not a duplicate of
|
||||||
|
`detectedProgression`. Invariant, enforced at every transition: `seedInfo !==
|
||||||
|
null ⇔ progressionVoteRef.current?.seeded === true`. Sync points: set
|
||||||
|
together in `rollJam`; cleared together in the agreement branch, the
|
||||||
|
replacement branch, and `newSong` (one added line — `setSeedInfo(null)`).
|
||||||
|
|
||||||
|
### 3.6 New Song & mid-session rolls
|
||||||
|
|
||||||
|
`newSong()` (App.jsx:216-241) already clears the whole seed surface:
|
||||||
|
`progressionVoteRef.current = null`, `progressionMissRef.current = 0`,
|
||||||
|
`setDetectedProgression(null)`, `setLockedKey(null)`,
|
||||||
|
`setChordHistory([])` — verified line by line; L-60 adds only
|
||||||
|
`setSeedInfo(null)`. **The seed clears naturally.** ✓
|
||||||
|
|
||||||
|
**Mid-session rule: roulette = New Song + seed** (`rollJam` step 1). Without
|
||||||
|
it, a 32-commit history still containing the *old* loop keeps re-detecting it
|
||||||
|
and would replace the fresh seed within 3 commits even after the band
|
||||||
|
switches — the stale window poisons the handoff. `newSong()` is the
|
||||||
|
already-tested full reset (history, votes, key, BPM); seeding onto that clean
|
||||||
|
slate makes ramp-up §3.4's only story. The banner history emptying is honest
|
||||||
|
("new song" is literally what the button did), and the loop-station audio is
|
||||||
|
untouched (`newSong` never touched it).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. What fills in — every consumer, verified
|
||||||
|
|
||||||
|
The seed sets `lockedKey` (→ `effectiveKey`) + `detectedProgression` (+ the
|
||||||
|
vote ref). Consumers and their honest pre-first-note state (`chordHistory`
|
||||||
|
empty, `currentChord` undefined):
|
||||||
|
|
||||||
|
| Surface | Consumes | Seeded behaviour |
|
||||||
|
|---|---|---|
|
||||||
|
| Slim loop strip — key chip | `keyInfo` (= effectiveKey) | Rolled key + mode render immediately |
|
||||||
|
| Slim loop strip — loop chips | `detectedProgression`, `findLoopPosition(chordHistory, loop)` | All chips render (chord + rn via the rolled key). `findLoopPosition` **returns −1 on empty history** (match.js:75 guard) → **no chip highlighted** — correct: nobody is anywhere yet. 🎲 indicator per §1.3 |
|
||||||
|
| Strip — history row | `chordHistory` | "Start listening…" — honest |
|
||||||
|
| JamGuide match | `matchLoopToProgression(loop, kbIndex)` | **Matched by construction — after §3.3.2's fix (a)** (mandatory L-60 scope): the seeded loop is the progression's collapsed canonical shape, which fix (a) indexes. *Without* the fix, 10/56 rolls (all of blues among them) would show a populated banner and an **empty JamGuide** — and the same fix repairs today's live-detection miss for real 12-bar streams. Header shows the progression name + "in {key}" |
|
||||||
|
| Voicing rail (GlanceRail / BassGuideRows) | `stationVoicings` (match + keyRoot), `activeIndex = canonicalPos` | Every station's shapes/voicings render in canonical KB order — for collapse-affected matches, the **collapsed projection's** stations (a 12-bar renders 7, one per distinct change) with plays remapped via `sourceIndex` (§3.3.2). `canonicalPos` guard (JamGuide.jsx:220-225) → **−1** → **no "now" row** — the rail shows the whole map unhighlighted |
|
||||||
|
| Licks strip | `activeStyle` (= match.style), `contextStation` | Populates; `contextStation` **falls back to station 0** when canonicalPos is −1 (JamGuide.jsx:341-344, existing comment says exactly this) — licks aim at the progression's first chord until the playhead exists |
|
||||||
|
| Related progressions (L-51) | `{ loop, keyInfo, onChordClick }` | Populates for free — it computes its own match from the loop |
|
||||||
|
| Instrument view | `keyInfo`, `currentChord` | Scale + pentatonic tiers light in the rolled key; **no chord-tone tier until the first commit** (currentChord undefined) — honest |
|
||||||
|
| ChordDetailModal | tap any chip | Works — chips pass real chord names |
|
||||||
|
| Chord detection itself | `effectiveKeyRef` | **Enabled immediately** by the seeded key (§3.1 synergy) |
|
||||||
|
|
||||||
|
**The pre-first-note playhead, stated plainly:** there is none — no strip chip
|
||||||
|
glows, no rail row is "now", and that is the design: a playhead claims
|
||||||
|
knowledge of where the band is, and the app doesn't have it yet. It lights on
|
||||||
|
the **first committed chord whose name appears in the loop** (`findLoopPosition`
|
||||||
|
walks back from the last commit; a first chord outside the loop keeps it
|
||||||
|
unlit). The 🎲 chip carries the "we're starting" affordance until then.
|
||||||
|
|
||||||
|
**Style-attribution quirk (documented, accepted):** same-shape progressions
|
||||||
|
exist across styles (`rock-axis` / `reggae-nwnc` / `pop-axis` all
|
||||||
|
`[0,7,9,5]`), and fix (a) adds within-style aliases
|
||||||
|
(`country-145`-collapsed ≡ `country-bluegrass-cycle`).
|
||||||
|
`matchLoopToProgression` disambiguates by quality overlap then length; ties
|
||||||
|
fall to entry order (raw before collapsed, §3.3.2 — incumbents keep winning
|
||||||
|
on ties), and the one strict-win exception is `country-145`'s collapsed form
|
||||||
|
over `bluegrass-cycle` for dom7-V input — the desired direction (§3.3.2's
|
||||||
|
true invariant). So rolling *pop* → Axis may render the rail/licks
|
||||||
|
attributed to **rock**. The chords, key, rn, and voicings are identical;
|
||||||
|
only the style label and lick flavour differ. **Re-judged against Maestro's belt-and-braces
|
||||||
|
offer: with fix (a) mandatory, matching is constructional and a seeded
|
||||||
|
`styleHint` would correct only the label/lick flavour — cosmetic, not
|
||||||
|
load-bearing. Declined for v1** (it would plumb a new prop through JamGuide
|
||||||
|
for no structural gain); noted for Maestro as a user-pulled follow-up if
|
||||||
|
anyone notices.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. L-60 scope — exact files, bounded commits
|
||||||
|
|
||||||
|
**The audio-contract boundary (grep-gated, restated):** the seed touches
|
||||||
|
display state (`lockedKey`, `detectedProgression`, `seedInfo`,
|
||||||
|
`chordHistory` via `newSong`) + the progression refs
|
||||||
|
(`progressionVoteRef`, `progressionMissRef`) + UI refs
|
||||||
|
(`rouletteMemoryRef`, `effectiveKeyRef` per the quickLock precedent) —
|
||||||
|
**never** `handleNote`/`handleChroma`/`handleOnset`/`handleWaveform`, their
|
||||||
|
ref-sync effects, or any AudioCapture prop.
|
||||||
|
|
||||||
|
**Files:**
|
||||||
|
|
||||||
|
1. `src/lib/theory.js` — **additive only:** `export` keyword on
|
||||||
|
`canonicalize` (shared file — flag lock to Maestro at promotion;
|
||||||
|
Professor+Critic co-review per PROTOCOL §3; fallback per §3.2).
|
||||||
|
2. `src/lib/match.js` — the sprint's real engineering weight, all additive:
|
||||||
|
- **`seedableLoop(progression, keyRootPc) → string[] | null`** (realize →
|
||||||
|
collapse+wrap-dedupe → canonicalize; null for collapsed length < 2);
|
||||||
|
- **fix (a)** per §3.3.2: `buildLoopIndex` collapsed-form entries
|
||||||
|
(collapsed projection with `sourceIndex`, appended after raw entries)
|
||||||
|
+ `matchLoopToProgression` collapsed-hit rotation against collapsed
|
||||||
|
degrees. Behaviour-preserving except the one enumerated strict win
|
||||||
|
(§3.3.2 true invariant: `country-145`, desired direction);
|
||||||
|
previously-`NO_MATCH` collapsed streams now match — this also fixes
|
||||||
|
the pre-existing live 12-bar miss;
|
||||||
|
- the **round-trip pool sweep** helper (lazy module-level memo, §2.2).
|
||||||
|
After C-50, no lock overlap with L-51's exports.
|
||||||
|
3. `src/App.jsx` — `rollJam(styleId)` + `seedInfo` state +
|
||||||
|
`rouletteMemoryRef`; the roulette button + popover menu in the controls
|
||||||
|
bar; the three 1-line commit-layer edits (§3.4 flags 1 & 3 + the two
|
||||||
|
`setSeedInfo(null)` clears); one line in `newSong`.
|
||||||
|
4. `src/components/ProgressionBanner.jsx` — presentational `seedInfo` prop:
|
||||||
|
🎲 glyph + amber provenance chip on the loop row (§1.3).
|
||||||
|
5. `src/components/JamGuide.jsx` — **four bounded lines + one field**
|
||||||
|
(§3.3.2): guitar-shape and piano-recipe lookups remap through
|
||||||
|
`prog.sourceIndex?.[i] ?? i` (JamGuide.jsx:280, :288); `stationVoicings`
|
||||||
|
attaches `stations[i].sourceIndex`; BassGuideRows' two raw-indexed
|
||||||
|
lookups (`pattern` :530, `note` :533) read
|
||||||
|
`play?.chords?.[st.sourceIndex ?? i]` — no new prop, heard-live falls
|
||||||
|
back via `?? i`. Re-lock at promotion — JamGuide is one-screen-locked
|
||||||
|
until C-50, which L-60 already depends on.
|
||||||
|
|
||||||
|
**Suggested commits (green at each):**
|
||||||
|
1. theory.js export + match.js (`seedableLoop` + fix (a)) + the JamGuide
|
||||||
|
`sourceIndex` remaps (all four paths incl. bass) + the smoke sweep: the
|
||||||
|
§2.2 round-trip invariant over **all 56** progressions under the
|
||||||
|
steady-state/all-offsets protocol (§3.4 flag 2 verbatim; expected 52
|
||||||
|
passers pinned; the 4 named failures asserted excluded) **plus** a
|
||||||
|
live-stream fixture proving a clean 12-bar history now matches (the
|
||||||
|
pre-existing bug, pinned fixed).
|
||||||
|
2. App.jsx commit-layer guard lines + `rollJam` + state/refs (mechanism live,
|
||||||
|
invokable from a temporary plain button if needed).
|
||||||
|
3. The controls-bar button + menu + banner indicator (the visible feature).
|
||||||
|
|
||||||
|
**Out of L-60 scope:** GlanceRail/VoicingBrowser (untouched — they render
|
||||||
|
whatever stations JamGuide hands them), JamGuide beyond the four remap lines
|
||||||
|
+ field, KB content, theory beyond the one export, audio, and the
|
||||||
|
`styleHint` disambiguation (declined, §4).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Rejected alternatives
|
||||||
|
|
||||||
|
**Rejected A — fake `chordHistory` injection** (seed by pushing 2 synthetic
|
||||||
|
cycles into history so the detector "discovers" the roll naturally). Seductive
|
||||||
|
— zero commit-layer changes — and dishonest at every surface: the banner
|
||||||
|
history strip shows eight chords **nobody played**; `findLoopPosition`
|
||||||
|
immediately lights a playhead asserting the band is mid-loop before a note
|
||||||
|
sounds; the L-31 cadence reasoning (thresholds are *per real chord commit*)
|
||||||
|
silently breaks; and the first real commits interleave with the fake tail,
|
||||||
|
producing corrupted-rep flapping (the exact pathology C-30/L-31 spent a sprint
|
||||||
|
taming). The seed must write conclusions, not forge evidence.
|
||||||
|
|
||||||
|
**Rejected B — a separate `seededProgression` state rendered when
|
||||||
|
`detectedProgression` is null.** Duplicates the loop's identity across two
|
||||||
|
states with a priority rule; every consumer (strip, JamGuide, RelatedProgressions,
|
||||||
|
future ones) must learn the fallback or silently miss the seed; and the
|
||||||
|
detection handoff becomes a hard visual swap between two objects instead of
|
||||||
|
the vote ref's smooth confirm/replace. The standing principle exists for
|
||||||
|
exactly this: one loop, one state, one machine.
|
||||||
|
|
||||||
|
**Rejected C — display-only overlay ("ghost card") that never enters the
|
||||||
|
state machine**, cleared on first detection. Honest-looking, but the screen's
|
||||||
|
surfaces don't populate from a ghost: the rail, licks, and related
|
||||||
|
progressions all key off `detectedProgression` — an overlay would either
|
||||||
|
leave them empty (failing "so that everyone can see the chords with different
|
||||||
|
voicings") or need Rejected B's plumbing anyway. Also loses the §3.1 synergy
|
||||||
|
(no `lockedKey` → chord detection stays gated on key detection).
|
||||||
|
|
||||||
|
**Rejected D — neutralize the ramp-up with a miss-counter credit**
|
||||||
|
(`progressionMissRef.current = -(2·len + 4)` at seed time) instead of the
|
||||||
|
`seeded` flag. One line, no flag — but the credit is a magic number that burns
|
||||||
|
in real time: a band that chats for eight commits' worth of noodling before
|
||||||
|
starting spends it on nothing and the card still dies mid-ramp-up; and it
|
||||||
|
leaves no way for the agreement branch to know confirmation happened (the
|
||||||
|
indicator can't flip). The flag has clean semantics; the credit has arithmetic
|
||||||
|
luck.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Flags for Maestro
|
||||||
|
|
||||||
|
- **theory.js shared-file lock** (additive `export` on `canonicalize`) — L-60
|
||||||
|
promotion must note it; Professor co-review per PROTOCOL §3.
|
||||||
|
- **L-60 lock list** per §5 (App.jsx + ProgressionBanner.jsx + match.js +
|
||||||
|
theory.js + JamGuide.jsx, four remap lines + one station field) —
|
||||||
|
supersedes the ledger row's "App.jsx (+ per D-62)".
|
||||||
|
- **Fix (a) repairs a pre-existing LIVE bug** (§3.3.1: real 12-bar/8-bar
|
||||||
|
streams — 10 progressions match nothing in JamGuide today, and
|
||||||
|
`country-145` misattributes; 11 collapse-affected total, §3.3.2 census).
|
||||||
|
Worth a line in the PR body / Herald's changelog: users get it even if
|
||||||
|
they never touch the roulette.
|
||||||
|
- **`styleHint` disambiguation** — re-judged and **declined for v1** (§4:
|
||||||
|
cosmetic post-fix-(a)); user-pulled follow-up only.
|
||||||
|
- **Smoke round-trip sweep** (§5 commit 1, all 56 progressions + the live
|
||||||
|
12-bar fixture) — if Critic prefers it C-owned, it slots into C-61's sweep
|
||||||
|
instead.
|
||||||
|
- No new tokens, no new colours (amber + accent are established), no
|
||||||
|
dependencies, no KB/audio changes anywhere in this design.
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
# Knowledge Center — design concept (task D-20)
|
||||||
|
|
||||||
|
> **Thesis:** JamBuddy's knowledge should live in **one bottom dock with four sections**, grown out of the existing Jam Guide dock — not three (actually five) competing collapsible panels. The live Roadmap stays the flagship landing section; Explore, Voicings, and Licks & Techniques become sibling sections inside the same shell. One shared level filter (foundation/intermediate), one visual language (the Roadmap's, per `jam-guide-concept-c.md`), zero new top-level chrome.
|
||||||
|
|
||||||
|
**Decision authority:** per the sprint header (user away 12 h, no user gate), Muse picks the strongest layout and records rationale + rejected alternatives below (§6). Implementation is task **L-22**; this doc is its blueprint.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. Honest audit — what actually exists today
|
||||||
|
|
||||||
|
Read directly from `src/App.jsx` and the components before designing. The "three disconnected surfaces" from the user directive are real, but the on-disk truth is messier:
|
||||||
|
|
||||||
|
| Surface | File | Mounted in App.jsx? | Content |
|
||||||
|
|---|---|---|---|
|
||||||
|
| Jam Guide (Roadmap) | `src/components/JamGuide.jsx` | **Yes** — last, bottom dock | Live loop → KB match → RoadmapTrack + voicing strip; instrument + style tabs |
|
||||||
|
| Explore panel | `src/components/ExplorePanel.jsx` | **No — orphaned** (verified: no import anywhere in `src/`) | Chord picker (root × quality), guitar voicing grid, piano techniques, famous progressions |
|
||||||
|
| Education panel | `src/components/EducationPanel.jsx` | **No — orphaned** (same verification) | Session snapshot, similar progressions, "play differently" substitutions, progression variations |
|
||||||
|
| Current Jam panel | `src/components/CurrentJamPanel.jsx` | **Yes** — mid-page collapsible | Voicings / scales / style options / **similar progressions** — heavy overlap with EducationPanel |
|
||||||
|
| Chord detail modal | `src/components/ChordDetailModal.jsx` | **Yes** — overlay | 6 tabs: Guitar, Piano, Theory, Learn (playbook + ASCII licks), Progressions, Explore |
|
||||||
|
|
||||||
|
So the fragmentation the user feels is: JamGuide (bottom) + CurrentJamPanel (middle) + ChordDetailModal (overlay), with two *dead* panels duplicating slices of both. The Knowledge Center consolidates the browse/learn material into the bottom dock, reuses the orphans as parts, and leaves CurrentJamPanel and the modal shell untouched this sprint (flagged for follow-up, §10).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Chosen structure — one dock, four sections
|
||||||
|
|
||||||
|
The existing JamGuide dock (collapsed header → ~70vh body) becomes the **Knowledge Center**. Its body gains a section nav; everything else about the dock chrome (collapsed summary bar, live match label, 70vh expand) is preserved.
|
||||||
|
|
||||||
|
```
|
||||||
|
┌─ KNOWLEDGE CENTER ── ii–V–I in C major · in C major ──────────────────── ▼ ─┐ (collapsed bar,
|
||||||
|
└──────────────────────────────────────────────────────────────────────────────┘ unchanged behaviour)
|
||||||
|
|
||||||
|
┌─ KNOWLEDGE CENTER ── ii–V–I in C major ──────────────────────────────── ▲ ─┐
|
||||||
|
│ ┌───────────────┬─────────┬──────────┬────────────────────┐ │
|
||||||
|
│ │ ▶ Jam Guide ● │ Explore │ Voicings │ Licks & Techniques │ ← section nav │
|
||||||
|
│ └───────────────┴─────────┴──────────┴────────────────────┘ (● = live) │
|
||||||
|
│ │
|
||||||
|
│ [ Jam Guide (live) — the existing Roadmap body, byte-for-byte: │
|
||||||
|
│ instrument tabs · style tabs · RoadmapTrack · voicing strip ] │
|
||||||
|
│ │
|
||||||
|
│ [ Explore — KB progression browser + famous progressions: │
|
||||||
|
│ style chips · (Foundation)(Intermediate) level chips · │
|
||||||
|
│ progression cards with level badge, chords-in-key, tip, songs ] │
|
||||||
|
│ │
|
||||||
|
│ [ Voicings — chord picker (root × quality, follows the live chord) → │
|
||||||
|
│ VoicingBrowser: guitar shapes + piano voicings, each with ▶ play ] │
|
||||||
|
│ │
|
||||||
|
│ [ Licks & Techniques — style chips · level chips · │
|
||||||
|
│ LickCard grid (tab SVG + technique glyphs) · glyph legend ] │
|
||||||
|
└──────────────────────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
**Section semantics:**
|
||||||
|
|
||||||
|
1. **Jam Guide (live)** — default landing section; answers *"what do I play over this loop right now?"* The current Roadmap body moves in unchanged (RoadmapTrack, playhead, station voicings strip, piano tab from L-11). The `●` live dot on the nav pill pulses only when a loop is matched, so even from another section you see the guide is hot.
|
||||||
|
2. **Explore** — answers *"what could we play?"* A **KB progression browser** (new, simple: style chips from the `kb/index.js` registry → progression cards showing name, rn pattern, chords rendered in the current key, `tip`, level badge) plus the famous-progressions cards reused from ExplorePanel. Any chord chip → `ChordDetailModal` via `onChordClick`.
|
||||||
|
3. **Voicings** — answers *"how do I grip/voice this chord — and what does it sound like?"* ExplorePanel's root × quality picker (defaulting to `currentChord` when live) feeding **VoicingBrowser** (D-21): guitar alternatives via `ChordDiagram`, piano alternatives via `MiniPiano voicing`, each variant with a ▶ button through `src/lib/chordAudio.js`.
|
||||||
|
4. **Licks & Techniques** — answers *"give me a phrase."* Style chips → **LickCard** (D-22) grid of P-21 licks, level chips shared with Explore, technique-glyph legend once per grid (not per card). Styles without authored licks show an honest empty state ("No licks authored for Pop yet — Blues, Jazz and Funk have them").
|
||||||
|
|
||||||
|
**Why the dock and not a new page:** the Knowledge Center must be reachable *mid-jam* without losing the detection UI (key chip, fretboard, banner). The bottom dock already established that contract with the Roadmap; sections extend it. Concept-C's visual language (station cards, accent-on-active, dimmed-by-age tiers, amber for secondary/held tones) carries through all four sections.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. IA map — reused / new / retired
|
||||||
|
|
||||||
|
| Piece | Fate | Where it lands |
|
||||||
|
|---|---|---|
|
||||||
|
| `JamGuide.jsx` Roadmap body (RoadmapTrack, voicing strip, instrument/style tabs, L-11 piano tab) | **Reused unchanged** | Section 1 content; JamGuide.jsx becomes the Knowledge Center shell + section 1 |
|
||||||
|
| `ExplorePanel.jsx` chord picker + quick-pick chips | **Reused** (refactored to named exports) | Section 3 toolbar |
|
||||||
|
| `ExplorePanel.jsx` `GuitarGrid` / `PianoGrid` | **Reused as interim**, then superseded by VoicingBrowser | Section 3 body until D-21 merges; kept as the no-audio fallback |
|
||||||
|
| `ExplorePanel.jsx` `ProgressionCards` (famous progressions) | **Reused** | Section 2, below the KB progression browser |
|
||||||
|
| KB progression browser (style → progressions with level badges) | **New** (small, data straight from `kb/index.js` which JamGuide already imports) | Section 2 hero |
|
||||||
|
| `VoicingBrowser.jsx` (D-21) | **New** | Section 3 + `ChordDetailModal` + station-enlarge (see §3) |
|
||||||
|
| `LickCard.jsx` (D-22) | **New** | Section 4 grid |
|
||||||
|
| Level filter chips | **New** (one shared component + one shared state in the shell) | Sections 2 and 4 toolbars (§4) |
|
||||||
|
| `EducationPanel.jsx` | **Retired** — stays unmounted; not edited (not in the L-22 lock). Its unique content (substitutions, variations) already lives in CurrentJamPanel + ChordDetailModal Theory tab. File deletion is a future cleanup task for Maestro to file | — |
|
||||||
|
| `CurrentJamPanel.jsx` | **Untouched this sprint** — overlap with section 2 acknowledged; folding it in is a follow-up (§10) | mid-page, as today |
|
||||||
|
| `ChordDetailModal.jsx` | **Shell untouched**; L-21 swaps only its Guitar/Piano tab grids for VoicingBrowser | overlay, as today |
|
||||||
|
|
||||||
|
Naming: the collapsed bar reads **"Knowledge Center — 〈live match label〉"**; the flagship keeps its name as section 1, "Jam Guide". No behaviour of the collapsed bar changes.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Where VoicingBrowser and LickCard mount
|
||||||
|
|
||||||
|
**VoicingBrowser** (`src/components/VoicingBrowser.jsx`, D-21) — three mount points, one component, prop-driven `{rootPc, quality}`:
|
||||||
|
|
||||||
|
1. **Knowledge Center → Voicings section** (L-22, via the ExplorePanel.jsx refactor) — the browse-first entry: pick any chord, audition every voicing.
|
||||||
|
2. **ChordDetailModal → Guitar/Piano tabs** (L-21) — replaces/extends the static `GuitarGrid`/`PianoGrid` so the modal's voicings become playable.
|
||||||
|
3. **Jam Guide station-enlarge** (L-21) — tapping a Roadmap station's thumbnail currently enlarges one `ChordDiagram`; it becomes the VoicingBrowser for that station's `{rootPc, quality}`, so mid-jam you can audition alternatives for the chord that's coming.
|
||||||
|
|
||||||
|
Data sources: guitar shapes from `src/lib/voicings.js` `GUITAR_SHAPES` (already the `ChordDiagram`-compatible `rootStr`/`offsets` format); piano voicings computed by `src/lib/piano.js` `pianoVoicing` (root / shell / rootlessA / rootlessB) rendered by `MiniPiano voicing`. Audio via `src/lib/chordAudio.js` (L-20). **Mic-feedback caveat surfaced in UI:** a one-line `text-gray-500` hint near the ▶ buttons — "played through your speakers — the mic may hear it" — mirroring the L-20 documentation.
|
||||||
|
|
||||||
|
**LickCard** (`src/components/LickCard.jsx`, D-22) — one mount point this sprint:
|
||||||
|
|
||||||
|
1. **Knowledge Center → Licks & Techniques section** (L-22): responsive grid, one card per P-21 lick, filtered by style chip + level chips. Card shows name, level badge, `chordContext` chip ("over the V7"), the tab SVG with technique glyphs (h, p, slide ⌒, bend ↑ … per the C-20 vocab), and the technique names it uses. The glyph legend renders once below the grid.
|
||||||
|
|
||||||
|
*Not* mounted in ChordDetailModal's Learn tab this sprint — that tab's `CHORD_PLAYBOOK` ASCII licks are a different corpus (`education.js`); converging them is future work, noted for Maestro (§10).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Level filter — placement and default
|
||||||
|
|
||||||
|
**Form:** two toggle chips, `Foundation` and `Intermediate`, rendered side by side in a section's toolbar. Both **on by default** (= show everything; badges do the signalling). Tapping one off narrows the list; both can't be off (tapping the last active chip is a no-op with a brief tooltip). This is the "easiest possible surface" per the directive: no new panel, no dropdown, one tap to see only intermediate material.
|
||||||
|
|
||||||
|
**State:** one `levels` state in the Knowledge Center shell, shared by both consuming sections — filter once, it holds as you move between Explore and Licks.
|
||||||
|
|
||||||
|
**Placement (exactly two spots):**
|
||||||
|
- **Explore section toolbar**, next to the style chips — filters the KB progression browser (every KB progression carries `level` after P-20).
|
||||||
|
- **Licks & Techniques toolbar** — filters LickCards (`lick.level` from the C-20 schema).
|
||||||
|
|
||||||
|
**Chip styling:** inactive = `bg-surface border-border text-gray-400`; active = `bg-accent/20 border-accent text-accent font-semibold` (the established active-tab treatment). Level *badges* on cards: foundation = `border-border text-gray-400`; intermediate = `border-amber/40 text-amber` (amber is already a token — no new colour needed).
|
||||||
|
|
||||||
|
**Honesty:** `FAMOUS_PROGRESSIONS` in `src/lib/education.js` carries **no** `level` field and `education.js` is in no task's lock — the famous-progressions cards in Explore show no badge and are **not affected by the filter** (they sit under their own "Famous progressions" subheading so the filter's scope reads clearly). Tagging that corpus is an open question for Maestro (§10).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Narrow-viewport plan
|
||||||
|
|
||||||
|
Target checks at implementation: **1280×800** (default Electron window), **~1024×768**, and **≤420px** width (half-snapped window).
|
||||||
|
|
||||||
|
- **Section nav:** horizontal chip row, `overflow-x-auto` + `shrink-0` pills (the pattern ChordDetailModal's tab bar and EducationPanel's nav already use) — never wraps into a tall block, never traps vertical scroll.
|
||||||
|
- **Dock body:** stays ~70vh with internal vertical scrolling; each section is a vertical stack on narrow.
|
||||||
|
- **Jam Guide section:** keeps its existing verified reflow (voicing strip wraps via `flex-wrap sm:flex-nowrap`, RoadmapTrack scrolls horizontally under the fixed playhead).
|
||||||
|
- **Explore:** progression cards are full-width stacked (they already are `flex-col`); chord chips inside cards wrap.
|
||||||
|
- **Voicings:** voicing-variant chips wrap; diagrams grid uses `repeat(auto-fill, minmax(140px, 1fr))` so thumbnails go 2-up at ~360px and never overflow; the enlarged diagram caps at container width (`max-w-full`, SVG scales via viewBox).
|
||||||
|
- **Licks:** grid `repeat(auto-fill, minmax(240px, 1fr))` → single column below ~520px; the LickCard SVG scales to card width (viewBox + `width:100%`), glyphs sized in SVG units so they scale with the tab.
|
||||||
|
- **Toolbars** (style chips + level chips): `flex-wrap` — level chips drop to a second row on narrow rather than shrinking below tap-target size (min 32px height).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Rationale + rejected alternatives (no user gate this sprint)
|
||||||
|
|
||||||
|
**Chosen: the four-section bottom dock grown from JamGuide.** Reasons:
|
||||||
|
1. **Minimum migration risk** — JamGuide already owns the dock chrome, the KB registry import, the live-match plumbing, and passed Critic's audio-contract gates repeatedly. Wrapping its body in a section nav is additive; the flagship Roadmap is never rebuilt.
|
||||||
|
2. **Mid-jam continuity** — knowledge is reachable while the detection UI stays on screen; the collapsed bar keeps broadcasting the live match even when closed.
|
||||||
|
3. **One home for the level filter** — shared state across Explore and Licks with zero duplication.
|
||||||
|
4. **App.jsx stays mount-only** — one additive prop (`onChordClick`, §7); no structural change near the audio callbacks.
|
||||||
|
|
||||||
|
**Rejected A — full-screen "Knowledge" mode/route** (top-level toggle Jam ⇄ Knowledge). More room per section, but it hides the detection UI while browsing (breaks the "look at it mid-jam" core promise), needs App.jsx restructuring far beyond mount-only, and adds a navigation concept the app doesn't have. Rejected on risk *and* UX grounds.
|
||||||
|
|
||||||
|
**Rejected B — keep three separate collapsible panels, restyled and cross-linked.** Cheapest to build, but it *is* the problem the user named: three headers competing in the scroll, three places for the level filter, no shared state, and the orphaned panels would be resurrected as-is (including EducationPanel's overlap with CurrentJamPanel). Rejected as fragmentation with a fresh coat of paint.
|
||||||
|
|
||||||
|
**Rejected C — right-side drawer.** Nice on ultrawide, but the Electron window is frequently narrow; a drawer either crushes the fretboard or overlays it (losing the glance-both-at-once value), and it duplicates the dock pattern the Roadmap already established. Rejected for viewport economics.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Migration order for L-22 (app green between every commit)
|
||||||
|
|
||||||
|
Precondition: **L-11** (piano in JamGuide) and ideally **L-21** hold locks on `JamGuide.jsx` — Maestro sequences L-22 after those merge. Order within L-22:
|
||||||
|
|
||||||
|
1. **Commit 1 — refactor `ExplorePanel.jsx` into parts.** Split into named exports: `ChordPickerToolbar`, `ExploreSection` (progression browser + famous progressions), `VoicingsSection` (picker + grids), `LevelChips`. Keep the default export as a thin composition of the parts. **Zero user-visible risk — the file is unmounted today.** Build + smoke green trivially.
|
||||||
|
2. **Commit 2 — Knowledge Center shell in `JamGuide.jsx` + App prop.** Add the section nav; move the existing Roadmap body (verbatim) into section 1; mount `ExploreSection` and `VoicingsSection` (with the interim static grids) from ExplorePanel.jsx; `App.jsx` gains exactly one additive prop on the existing JamGuide mount: `onChordClick={setSelectedChord}` (mount-only, nowhere near the audio callbacks/refs). App renders identically until the dock is opened; the Roadmap section is a code *move*, not a change.
|
||||||
|
3. **Commit 3 — level filter live.** `LevelChips` wired to the shared `levels` state; KB progression browser reads `progression.level` (P-20 must be merged); level badges on cards; licksless filter scope documented in the empty states.
|
||||||
|
4. **Commit 4 — Licks & Techniques section.** Mount the LickCard grid (needs D-22 component + P-21 data merged); style chips reuse the registry list section 1 already derives; shared level chips apply; empty state for lick-less styles.
|
||||||
|
5. **Commit 5 (in-sprint upgrade, may fold into L-21's landing) — Voicings section swaps static grids for `VoicingBrowser`** once D-21 merges: a one-line component swap inside `VoicingsSection`, with the static grids kept as the fallback when `chordAudio` is unavailable.
|
||||||
|
|
||||||
|
Every commit: `npm run build` + `node scripts/smoke.mjs` green; at no point does the app lose the Roadmap, the modal, or any mounted panel.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Tokens, contrast, keyboard
|
||||||
|
|
||||||
|
**Tokens only** — `bg-surface` #0f0f0f, `bg-panel` #1a1a1a, `border-border` #2a2a2a, `accent` #a855f7, `amber` #f59e0b (all already in `tailwind.config.js`). **No new colour is required** for the Knowledge Center; level badges reuse amber, active states reuse the accent tints already shipped in JamGuide.
|
||||||
|
|
||||||
|
**Measured contrast commitments** (computed, not assumed):
|
||||||
|
- `accent` #a855f7 on `panel` #1a1a1a ≈ **4.4:1** — passes AA for large/bold text and UI components, *borderline for small normal text*. Rule: small accent text sits on `bg-surface` cards (**≈4.8:1**, passes) or is ≥ semibold at ≥14px; body copy is never accent.
|
||||||
|
- `gray-400` #9ca3af on panel ≈ **6.9:1** — the floor for any *essential* label.
|
||||||
|
- `gray-500` #6b7280 on panel ≈ **3.6:1** — decoration/microcopy only, never load-bearing text (existing app convention, now explicit).
|
||||||
|
- `amber` #f59e0b on panel ≈ **8.1:1** — level badges and secondary-tone markers are comfortably AA.
|
||||||
|
|
||||||
|
**Keyboard:** every section pill, style chip, level chip, voicing variant, ▶ play button, and LickCard is a real `<button>` in DOM order with `focus-visible:ring-2 ring-accent` (the shipped pattern). Section nav uses `aria-pressed`/`aria-current`; level chips `aria-pressed`; the live dot on the Jam Guide pill is decorative (`aria-hidden`) with the liveness conveyed in the pill's `aria-label`. ▶ buttons get descriptive labels ("Play C maj7 — shell voicing"). The dock's expand/collapse button keeps `aria-expanded`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. What stays untouched (explicitly out of scope)
|
||||||
|
|
||||||
|
- **The audio/detection pipeline** — `AudioCapture.jsx`, `handleNote`/`handleChroma`/`handleOnset`, all refs and `useCallback` contracts in `App.jsx`. The only App.jsx change in this whole plan is one additive prop on an existing mount (§7 commit 2). `chordAudio.js` is a separate, lazily-created context (L-20's contract) and never touches the detection contexts.
|
||||||
|
- **Detection UI** — key chip, `ProgressionBanner`, `ProgressionSuggestions`, main `Fretboard`/`Piano`/`BassFretboard`, the D-03 guide-tone cross-link.
|
||||||
|
- **Tuner, Loop Station, DebugView, DrumView** — not part of the Knowledge Center; their mounts and order in App.jsx are unchanged.
|
||||||
|
- **`CurrentJamPanel`** — remains mounted as-is despite overlapping Explore (§10).
|
||||||
|
- **`ChordDetailModal` shell** and its Theory/Learn/Progressions/Explore tabs — L-21 touches only the Guitar/Piano voicing grids.
|
||||||
|
- **Libraries** — `theory.js`, `education.js`, `voicings.js`, `match.js`, `piano.js`: read-only from this design.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10. Open questions for Maestro
|
||||||
|
|
||||||
|
1. **`FAMOUS_PROGRESSIONS` level tags** — `education.js` is unlocked and untagged; famous-progression cards are exempt from the level filter (§4). File a small Professor task to tag it, or accept the split scope?
|
||||||
|
2. **CurrentJamPanel convergence** — its "Similar Progressions"/"Style Options" views largely duplicate Explore. Recommend a follow-up task (post-sprint) to fold its unique bits (per-chord open-voicing strips, scale diagrams) into the Knowledge Center and retire the panel — reduces the main scroll by one header.
|
||||||
|
3. **EducationPanel.jsx deletion** — confirmed orphaned; retire-in-place this sprint, file a cleanup deletion (Luthier, trivial) later so dead code doesn't confuse future agents.
|
||||||
|
4. **L-21/L-22 sequencing on `JamGuide.jsx`** — both edit it; this doc assumes L-11 → L-21 → L-22 (or L-22 commits 1–4 then the §7 commit-5 swap folded into L-21). Maestro to serialize the lock.
|
||||||
|
5. **Naming check with the user (async, non-blocking):** collapsed bar renamed "Knowledge Center — 〈match〉"; "Jam Guide" lives on as section 1. Cheap to revert if the user prefers the old bar title.
|
||||||
@@ -0,0 +1,587 @@
|
|||||||
|
# One Screen — the jam dashboard (task D-50)
|
||||||
|
|
||||||
|
> **Thesis:** the page stops being a tall stack of full-width bands and becomes a
|
||||||
|
> **viewport-fitting jam dashboard**: a full-width *slim loop strip* (the banner
|
||||||
|
> minus its big now-playing chord), then LEFT (~744px) the compact instrument
|
||||||
|
> view, the licks strip, and a new loop-relative *Related progressions* card;
|
||||||
|
> RIGHT (~500px) the suggested-voicings rail — the design's ONE justified
|
||||||
|
> internal scroller (§4). The dashboard is a **self-contained unit designed to
|
||||||
|
> fit 100vh at 1280×900**; a **JAM VIEW toggle** in the controls bar (§1.1)
|
||||||
|
> locks the page to exactly that unit (and goes browser-fullscreen,
|
||||||
|
> best-effort) while playing. In normal mode everything that is learning or
|
||||||
|
> behind-the-scenes (LoopStation, Debug, Drum, Tuner, KnowledgeDock) stays
|
||||||
|
> below the dashboard on the ordinary page scroll; in jam view it is hidden.
|
||||||
|
>
|
||||||
|
> User directive (2026-07-11, verbatim): *"the chord view and the chord loop
|
||||||
|
> incl the instrument below is too big, it takes up too much space, i want you
|
||||||
|
> to reconsider the positioning as this main view doesnt really add value:
|
||||||
|
> seeing the big chord 'now playing' in big is also unnecessary as you already
|
||||||
|
> see that one in the chords (loop) part. the suggested progressions on the
|
||||||
|
> right are also almost useless. they are nice but we need to rethink them in
|
||||||
|
> the form of SUGGESTED VOICINGS and the progressions we add relating to the
|
||||||
|
> loop. i'd like to have the suggested voicings on the right side of the screen
|
||||||
|
> (the jam guide). … i wanna see the chords, the loop, the voicings, the
|
||||||
|
> progressions, the licks all on one screen, everything you need to follow the
|
||||||
|
> jam correctly"*
|
||||||
|
>
|
||||||
|
> Refinement (2026-07-11, verbatim): *"it can still have a scroll down, but the
|
||||||
|
> main concept needs to be in one screen: potentially we add a fullscreen
|
||||||
|
> button so we can just show that when we are playing a jam. so that it fits
|
||||||
|
> the entire screen, everything that is learning and behind the scenes etc you
|
||||||
|
> can keep below/scrollable but we need one main view for live jams where we
|
||||||
|
> see everything at once (relating to the jam and the voicings and the licks
|
||||||
|
> and the chords and the loop)"* — the 100vh fit is a **hard design
|
||||||
|
> constraint** for the dashboard, not an aspiration; the fullscreen button is
|
||||||
|
> in scope (L-50 commit 3, §6.1); internal wrap/scroll inside a panel is a
|
||||||
|
> last resort and every instance below is justified.
|
||||||
|
|
||||||
|
**Supersedes** `integrated-glance.md` §1's full-width-band placement (the user
|
||||||
|
tested it and asked for the right column). That doc's **verified geometry stays
|
||||||
|
the arithmetic source here**: guitar cell ~93px, piano cells 160/284px, worst
|
||||||
|
piano gallery ~1,178px of cells, licks thumb card ~165px (in a 220px strip
|
||||||
|
slot), cell line heights ~140px guitar / ~125–130px piano. Standing principles
|
||||||
|
(user memory): scroll > click; nothing shown twice; ONE global instrument
|
||||||
|
selector; the playhead highlights, never hides.
|
||||||
|
|
||||||
|
**Decision authority:** per the sprint header (no user gate), Muse picks the
|
||||||
|
strongest option and records rejected alternatives (§9).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. What exists today (read from the code)
|
||||||
|
|
||||||
|
App.jsx mount order: `ProgressionBanner` (~608) → instrument row (~617–629:
|
||||||
|
`Fretboard`/`BassFretboard`/`Piano` at 70% + `ProgressionSuggestions` at 30%) →
|
||||||
|
`JamGuide` full-width band (~635: GlanceRail all-expanded rows + LicksStrip) →
|
||||||
|
`LoopStation` → Debug/Drum/Tuner collapsibles → `KnowledgeDock` last. The band
|
||||||
|
starts ≈570px down at 1280×900 — voicings never share the screen with the
|
||||||
|
instrument view, and the licks strip sits another rail-height below that. The
|
||||||
|
banner burns its right 30% on a text-6xl "Now Playing" chord that duplicates
|
||||||
|
both the enlarged last history chip and the highlighted loop chip. The
|
||||||
|
directive kills all of that.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. The grid
|
||||||
|
|
||||||
|
Assumed usable content box at a 1280×900 window: **~1,256 × ~836px** (Electron
|
||||||
|
title bar ~32px eats into the 900; App's `p-3` eats 24px each axis — heights
|
||||||
|
below are estimates, cell geometry is verified).
|
||||||
|
|
||||||
|
```
|
||||||
|
┌──────────────────────────────────────────────────────────────┐ ─┐
|
||||||
|
│ header (~52) │ │
|
||||||
|
│ controls bar — instrument · key lock · ⛶ JAM VIEW (~52) │ │
|
||||||
|
│ SLIM LOOP STRIP — key · history · ♻ loop chips (~76) │ │ the
|
||||||
|
├───────────────────────────────────────┬──────────────────────┤ │ dashboard
|
||||||
|
│ LEFT ~744px (flex-1) │ RIGHT 500px, │ │ = 100vh
|
||||||
|
│ │ own scroll (§4) │ │ in jam
|
||||||
|
│ compact instrument view (~240) │ │ │ view
|
||||||
|
│ licks strip (~190) │ SUGGESTED VOICINGS │ │
|
||||||
|
│ related progressions (~200) │ rail — GlanceRail / │ │
|
||||||
|
│ │ BassGuideRows rows │ │
|
||||||
|
├───────────────────────────────────────┴──────────────────────┤ ─┘
|
||||||
|
│ LoopStation · Behind the Scenes · Rhythm · Tuner · Knowledge │ normal mode
|
||||||
|
│ (the learning / behind-the-scenes area — page scroll) │ only; hidden
|
||||||
|
└──────────────────────────────────────────────────────────────┘ in JAM VIEW
|
||||||
|
```
|
||||||
|
|
||||||
|
- The **slim strip stays full width** (not inside the left column): it is the
|
||||||
|
status line for the whole dashboard — the rail's playhead and the strip's
|
||||||
|
active loop chip are the same "now", and a full-width one-liner costs only
|
||||||
|
~76px. (Putting it inside the left column would buy the rail ~88px of
|
||||||
|
first-paint height; the rail is internally scrollable anyway, and a
|
||||||
|
~450px-content strip floating in a 744px column looks broken. Not worth it.)
|
||||||
|
- **Grid:** `flex gap-3 items-start` → left `flex-1 min-w-0`, right
|
||||||
|
`w-[500px] shrink-0`, active at `xl:` (≥1280); below that the columns stack
|
||||||
|
(§7). 500px is the top of the licensed 420–520 range because piano cells
|
||||||
|
need it (§4): at 500 the row interior is ~456px, which fits a 284px
|
||||||
|
two-octave cell **plus** a 160px one-octave cell per line (by ~4px — D-51
|
||||||
|
hardens the margin, §4); at 420 every two-octave cell rides alone.
|
||||||
|
- **The rail is height-bounded: `xl:max-h-[calc(100vh-1.5rem)]
|
||||||
|
xl:overflow-y-auto` — and NOT sticky.** (`sticky top-3` here would be inert:
|
||||||
|
inside the flex row the rail is the tallest item, so its containing block
|
||||||
|
equals its own height and there is zero travel to pin against — specifying
|
||||||
|
it would be a lie in class form.) What the bound actually buys, honestly:
|
||||||
|
the rail is the one unbounded surface (§4 math — a jazz piano loop is
|
||||||
|
~3,000px of rows). **(a)** Unbounded, it stretches the *document* to
|
||||||
|
~3,000px+, pushing the below-grid region (LoopStation, the whole learning
|
||||||
|
area) thousands of pixels down instead of one flick below the dashboard.
|
||||||
|
**(b)** The bound is exactly what jam view swaps to `h-full` — an unbounded
|
||||||
|
rail can never fit `h-screen` (§1.1). The rail's depth scrolls *within* its
|
||||||
|
column; the left column stays whole; at rest the rail shows ~644px (the
|
||||||
|
grid height). D-40 Rejected E (internal scroller) was rejected for the
|
||||||
|
*full-width band*, where it capped visible rows below 4 and nested a
|
||||||
|
scrollbar inside the page's only axis; in a two-column dashboard, bounding
|
||||||
|
the one unbounded column is what makes the dashboard a fixed-height unit —
|
||||||
|
the rejection does not carry over. **No auto-scroll in this sprint** (§4).
|
||||||
|
|
||||||
|
Vertical budget, normal mode at rest: 836 − 52 (header) − 52 (controls) − 88
|
||||||
|
(strip + gap) ≈ **644px for the grid**. Left stack ≈ 240 + 190 + ~200 + 24
|
||||||
|
gaps ≈ **654px** — everything on screen except the last ~10–20px of the
|
||||||
|
related progressions card at exactly 900px window height; a micro-flick shows
|
||||||
|
it. In normal mode that residue is acceptable (the page scrolls anyway); **in
|
||||||
|
jam view it is not** — §1.1 makes the fit exact by construction, with the
|
||||||
|
related card as the left column's flex absorber.
|
||||||
|
|
||||||
|
### 1.1 Jam view — the one-screen lock + fullscreen toggle
|
||||||
|
|
||||||
|
The refinement's "fullscreen button". **Mechanism chosen: one button, two
|
||||||
|
layers on one state.**
|
||||||
|
|
||||||
|
- **Layer 1 — CSS jam view (the guarantee).** App gains a `jamView` boolean
|
||||||
|
(pure UI-state — nowhere near the audio callbacks/refs). When true:
|
||||||
|
- the page root becomes `h-screen overflow-hidden flex flex-col` (normal
|
||||||
|
mode: today's `min-h-screen` flow);
|
||||||
|
- **everything below the dashboard is not rendered** — LoopStation, Behind
|
||||||
|
the Scenes, Rhythm Analyser, Tuner, KnowledgeDock (conditional mount, not
|
||||||
|
`hidden`, so collapsed-state chrome can't leak height). Header, controls
|
||||||
|
bar, strip, grid remain — Stop/Start, the instrument selector, and the key
|
||||||
|
lock are jam-relevant chrome;
|
||||||
|
- the grid gets `flex-1 min-h-0`; the rail wrapper swaps its normal-mode
|
||||||
|
`xl:max-h-[calc(100vh-1.5rem)]` bound for `h-full overflow-y-auto` (the
|
||||||
|
column IS the viewport remainder, so the viewport-calc bound gives way to
|
||||||
|
the exact column height);
|
||||||
|
- the left column becomes `flex flex-col min-h-0`: instrument view and
|
||||||
|
licks strip fixed-height, the related progressions card `flex-1 min-h-0
|
||||||
|
overflow-y-auto` — the **one flex absorber** that soaks up the ±20px
|
||||||
|
between window sizes. Internal scroll here is the licensed last resort
|
||||||
|
and only engages below ~950px-tall windowed viewports (numbers below).
|
||||||
|
- **Layer 2 — browser fullscreen (the enhancement, best-effort).** The same
|
||||||
|
toggle calls `document.documentElement.requestFullscreen()` on enter and
|
||||||
|
`document.exitFullscreen()` on exit. Both return **Promises** — a bare
|
||||||
|
try/catch does not swallow the rejection; the calls must be
|
||||||
|
`.catch(() => {})` (or awaited inside try/catch). Electron grants it (plain
|
||||||
|
renderer, no IPC needed); if a browser build ever refuses, jam view still
|
||||||
|
works at layer 1. Fullscreen reclaims the ~32px
|
||||||
|
title bar (and any taskbar), which is exactly what turns "fits minus 20px"
|
||||||
|
into "fits clean" at 900-high screens.
|
||||||
|
- **The button** lives at the right end of the controls bar (the global,
|
||||||
|
always-visible chrome — same reasoning as the instrument selector):
|
||||||
|
`⛶ Jam view` / `✕ Exit` , `aria-pressed`, min-32px target,
|
||||||
|
`focus-visible:ring-2 ring-accent`, tokens only.
|
||||||
|
- **Exit paths, all restoring normal flow:** the button; **Escape** (a
|
||||||
|
`keydown` listener active only while `jamView` — needed because layer 1 can
|
||||||
|
exist without layer 2); and the native fullscreen Esc, synced via a
|
||||||
|
`fullscreenchange` listener (leaving fullscreen by any means switches
|
||||||
|
`jamView` off — one state, never half-exited). Entering does NOT auto-start
|
||||||
|
listening; leaving does NOT stop it — the toggle is layout-only.
|
||||||
|
|
||||||
|
**Jam-view budget (the hard numbers).** Grid height = viewport − p-3 (24) −
|
||||||
|
header 52 − controls 52 − strip + gap 88:
|
||||||
|
|
||||||
|
| Viewport | Grid (= rail height) | Left: fixed 454 (instrument 240 + licks 190 + gaps) → related card gets | Verdict |
|
||||||
|
|---|---|---|---|
|
||||||
|
| 1280×900 window (layer 1 only, content ~836) | **644px** | ~190px → heading + ~2.8 of 3 entries | fits; the card's last entry may shave ~20px — its internal scroll absorbs it |
|
||||||
|
| 1280×900 screen, true fullscreen (content ~876) | **684px** | ~230px → 3 entries fully clear, ~20px spare | **fits clean — the ~20px story is gone** |
|
||||||
|
| 1280×960+ screen, true fullscreen (content ≥936) | **≥744px** | ≥290px → up to 5 entries | fits with room |
|
||||||
|
|
||||||
|
The rail's *depth* still exceeds any of these for piano loops (§4 table — a
|
||||||
|
4-chord jazz loop is ~2,600–3,000px of rows). That is the one place "see
|
||||||
|
everything at once" and "every voicing, all levels, zero clicks" (D-30)
|
||||||
|
mathematically collide; the cell strategy compresses first (recommended cell
|
||||||
|
leads; the 284+160 pair-fit halves mixed-station heights, §4) and the
|
||||||
|
remainder falls to the rail's contained scroll — the justified internal
|
||||||
|
scroller. All four *bounded* surfaces (strip, instrument, licks, progressions)
|
||||||
|
fit whole; guitar and bass rails fit ~2.5–3 of 4 rows with the "now" row
|
||||||
|
highlighted wherever it sits.
|
||||||
|
|
||||||
|
### 1.2 The slim loop strip — banner inventory
|
||||||
|
|
||||||
|
What `ProgressionBanner` renders today, and its disposition:
|
||||||
|
|
||||||
|
| Banner element today | Disposition |
|
||||||
|
|---|---|
|
||||||
|
| Key chip (root text-2xl accent + mode + confidence %) | **Survives** — leftmost, unchanged |
|
||||||
|
| Chord history (last 8, age-faded, tap → ChordDetailModal; current chip enlarged text-3xl + amber rn + pop-in animation) | **Survives, capped to last 5** — the enlarged current chip IS the now-playing display now; the pop-in animation moves with it |
|
||||||
|
| Loop row (♻ + chips, chord + rn, active chip accent-glow via `findLoopPosition`, "→ loop" tail) | **Survives, promoted onto the same row** as key + history (divider between) |
|
||||||
|
| `hidden lg:block` divider + right 30% column: "NOW PLAYING" label, **text-6xl amber chord**, rn, "tap for voicings" | **GONE.** The user's words: the loop chips already carry it. The tap-for-voicings affordance is not lost — every chip already opens ChordDetailModal, and the rail shows the loop's voicings permanently |
|
||||||
|
| Empty states ("Detecting key…", "Start listening…", "Play a chord") | First two survive; "Play a chord" dies with its column |
|
||||||
|
|
||||||
|
One row: key chip (~90px) + 5 history chips (~230px) + divider + up to 8 loop
|
||||||
|
chips (~320px) + tail ≈ ~720px — fits 1,256 with room; 12-chord loops (12-bar
|
||||||
|
blues) wrap the loop chips to a second line (strip ~104px, still fine).
|
||||||
|
**Strip chrome trim (part of the slimming):** `p-4 → p-2` and drop the history
|
||||||
|
wrapper's `pb-1` — the enlarged current chip (text-3xl + rn + chip padding) is
|
||||||
|
~58px tall on its own, so with p-4 the strip lands at ~92–96px; the trim is
|
||||||
|
what makes the **~76px** figure true. Goes in L-50 commit 1 with the column
|
||||||
|
removal (§6.1).
|
||||||
|
Duplication audit: the current chord appears twice (last history chip + active
|
||||||
|
loop chip) — pre-existing, and the user's directive explicitly endorses the
|
||||||
|
loop chip as the "now"; the big third copy is what dies.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Compact instrument view — the mechanism
|
||||||
|
|
||||||
|
**Chosen: a `compact` prop on Fretboard / Piano / BassFretboard = trimmed card
|
||||||
|
chrome + a natural-width cap on the SVG. No fret reduction, no transform
|
||||||
|
scaling.**
|
||||||
|
|
||||||
|
- **Natural-width cap:** each SVG keeps `width:100%` but gains
|
||||||
|
`max-width: <its viewBox width>px` (Fretboard 674px, Piano 562px), i.e. it
|
||||||
|
never renders *above* scale 1.0. In the 744px left column (≈718px card
|
||||||
|
interior with the compact `p-3`) the fretboard sits at its designed 1.0 scale → SVG height
|
||||||
|
**186px** (today at 70% of 1,256 it renders at ~1.23 scale ≈ 229px + fat
|
||||||
|
chrome ≈ 320px card). Piano: 150px SVG.
|
||||||
|
- **Trimmed chrome:** `p-6 → p-3`, heading `mb-4 → mb-2`, and the legend row
|
||||||
|
(chord tone / pentatonic / scale dots) merges onto the heading line
|
||||||
|
(right-aligned) instead of a separate `mt-3` row. Card totals: fretboard
|
||||||
|
≈ **240px** (was ~320), piano ≈ **205px**.
|
||||||
|
- **Legibility, honestly:** at scale 1.0 the fretboard is at its *designed*
|
||||||
|
size — 20px note dots, 9px note labels, 10px string/fret labels, exactly
|
||||||
|
what ChordDiagram-era eyes were tuned on; nothing shrinks below today's
|
||||||
|
rendering (today it renders *larger* than designed, which is part of "too
|
||||||
|
big"). The compact card is smaller because the chrome and the over-scale go,
|
||||||
|
not because the notes do. Below ~700px column width the SVG scales down with
|
||||||
|
the column; at 0.9 scale (≈606px) labels are ~8px — the floor I'd defend.
|
||||||
|
The narrow plan (§7) gives the view the full window width anyway, so the
|
||||||
|
sub-1.0 zone only exists between ~1280 and ~1140px windows if the grid
|
||||||
|
breakpoint were lower — hence `xl:` for the grid, not `lg:`.
|
||||||
|
- Rejected mechanisms: **fewer frets** (0–7) kills position playing above the
|
||||||
|
7th fret — soloists live there; **CSS `transform: scale()`** blurs text and
|
||||||
|
shrinks hit targets — dishonest compactness; **hard height cap with
|
||||||
|
letterboxing** wastes the saved space as empty gutters.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. What's removed / moved (full inventory)
|
||||||
|
|
||||||
|
| Surface | Disposition |
|
||||||
|
|---|---|
|
||||||
|
| Big "Now Playing" chord (banner right 30% + divider) | **Removed** (§1.2) |
|
||||||
|
| `ProgressionSuggestions` | **Unmounted; file kept in place** (EducationPanel/RoadmapTrack precedent — joins the retire-then-delete backlog item). Its job splits in two per the directive: "what to play on these chords" → the voicings rail; "where these changes can go" → RelatedProgressions (§5). Its generic genre/mood table and circle-of-fifths padding retire with it |
|
||||||
|
| The 70/30 instrument row | **Dissolved** — the instrument view becomes the left column's first block; the 30% slot's replacement is the rail column |
|
||||||
|
| JamGuide band (rail + licks, full width) | **Recomposed** — JamGuide stops rendering a band and renders the grid's jam surfaces: rail into the right column, LicksStrip + a related-progressions slot into the left (§6, component boundary) |
|
||||||
|
| LicksStrip | **Stays module-local in JamGuide.jsx** — no file move. It renders from JamGuide's match/context memos (`activeStyle`, `contextStation`); extracting it to its own file buys nothing and forces prop plumbing for the token-boundary context sort. It just mounts in the left column now |
|
||||||
|
| LoopStation | **Below the grid, first — and hidden in jam view.** Recorded call: the user's enumeration of the live-jam view is "the jam and the voicings and the licks and the chords and the loop", where "the loop" is the *chord* loop (the strip's ♻ chips), not the audio looper. LoopStation is a performance tool, but it is not on the list — it goes below with the learning surfaces, first in line because it feeds the detected loop. If the user misses it mid-jam, admitting it into jam view is a one-line conditional — the reversal path is cheap and noted in §9 |
|
||||||
|
| Behind the Scenes / Rhythm Analyser / Tuner collapsibles | Below LoopStation, unchanged |
|
||||||
|
| KnowledgeDock | **Last, unchanged** — browse & study stays below the fold |
|
||||||
|
| ChordDetailModal, AudioCapture, all `src/lib/**` audio/theory | Zero changes |
|
||||||
|
|
||||||
|
In **normal mode** everything below the grid remains exactly what the
|
||||||
|
refinement asks for — the learning / behind-the-scenes area on the ordinary
|
||||||
|
page scroll ("everything that is learning and behind the scenes etc you can
|
||||||
|
keep below/scrollable"). In **jam view** this whole region is hidden (§1.1) —
|
||||||
|
the dashboard is the entire page.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. The rail at column width (~500px shell, ~456px row interior)
|
||||||
|
|
||||||
|
Row interior arithmetic: 500 − rail section `p-3` + border (~26) − row `p-2` +
|
||||||
|
border (~18) ≈ **456px** for header + cells. The inherited 93/160/284 figures
|
||||||
|
are already **box values** — integrated-glance's own verified sums prove it
|
||||||
|
(4×284 + gaps + chrome ≈ 1,178 with no extra per-cell padding), so nothing
|
||||||
|
gets padding added on top below. Cell strategy: **recommended-first, gallery
|
||||||
|
wrapped below — all cells always rendered, zero clicks** (D-30's "all at once"
|
||||||
|
directive stands; only the *geometry* adapts).
|
||||||
|
|
||||||
|
- **The recommended cell leads and reads as the answer.** The station's own
|
||||||
|
voicing (guitar: KB play shape badged "play"; piano: the authored/threaded
|
||||||
|
voicing with its honest label) keeps its accent-bordered figure and is
|
||||||
|
always the first cell — at column width it is frequently alone on line one,
|
||||||
|
which makes prominence free. D-51 may add nothing more than a slightly
|
||||||
|
stronger figure treatment (accent/60 border → accent) — no size difference,
|
||||||
|
no new colour.
|
||||||
|
- **Guitar:** cells ~93px (box) → **4 per line** (4×93 + 3×8 gaps = 396 ≤ 456
|
||||||
|
— fits with ~60px to spare, not borderline; a 5th cell at 497 does not).
|
||||||
|
Typical station = play cell + 3–6 placeable shapes = 4–7 cells → 1–2 cell
|
||||||
|
lines (~140px each). Header content (chord + rn + now/next + solo label +
|
||||||
|
aim dots + transition chip ≈ 540px of inline content) **wraps to 2 lines
|
||||||
|
≈ 50px** — fine, it already `flex-wrap`s. Row ≈ **206–350px**.
|
||||||
|
- **Piano:** one-octave cells ~160px (box) → 2 per line (328 ≤ 456);
|
||||||
|
two-octave cells ~284px (box) → alone or, critically, **paired with a
|
||||||
|
one-octave cell: 284 + 160 + 8 = 452 ≤ 456 — the mixed pair FITS today, by
|
||||||
|
~4px**. That 4px is real but fragile (a longer label, a scrollbar gutter, a
|
||||||
|
browser rounding step could break it), so D-51's cell padding/gap shave is
|
||||||
|
**margin-hardening for an already-passing fit**, not a rescue — the pairing
|
||||||
|
is the difference between 5 and 3 cell lines on mixed stations. Worst
|
||||||
|
station (root above D with a true 7th — all five cells two-octave, per the
|
||||||
|
D-40 corrected math; 2×284 + 8 = 576 > 456 so they never pair with each
|
||||||
|
other): **5 cell lines ≈ 650 + header ≈ ~700px per row**. Best (roots C–D /
|
||||||
|
triads): 3 lines ≈ ~490px.
|
||||||
|
- **Bass:** BassGuideRows text rows (~70px) or BassPatternCard rows — narrow
|
||||||
|
by construction; the column fits them with no adaptation beyond wrap, which
|
||||||
|
it inherits.
|
||||||
|
- **Wrap, never horizontal scroll** — unchanged invariant. The only permitted
|
||||||
|
horizontal scroller stays VoicingBrowser's per-cell guard around MiniPiano
|
||||||
|
thumbs on sub-320px pathologies.
|
||||||
|
|
||||||
|
### The honest vertical budget
|
||||||
|
|
||||||
|
| Scenario | Full rail height | Visible: normal rest (~644px) / jam view fullscreen (~684px) |
|
||||||
|
|---|---|---|
|
||||||
|
| 4-chord loop, guitar | ≈ 4×~275 avg + chrome ≈ **~1,150px** | ~2.3 / ~2.5 rows |
|
||||||
|
| 4-chord loop, piano (jazz flagship, mostly worst-case rows) | ≈ **~2,600–3,000px** | ~1 / ~1.1 rows |
|
||||||
|
| 8–12 chord loop (12-bar) | guitar ~2,300 / piano ~5,000+ | scroll; the strip's loop chips always carry the position |
|
||||||
|
|
||||||
|
**What "one screen" honestly means:** all five surfaces are simultaneously
|
||||||
|
present at 1280×900 (whole, in jam view — §1.1) — but the rail's *depth* is a
|
||||||
|
scroll, contained in its column: it is the one panel whose content is
|
||||||
|
unbounded by construction (every voicing of every loop chord, D-30's "all at
|
||||||
|
once"), so it is the design's justified last-resort internal scroller; the
|
||||||
|
cell strategy above compresses first. A 4-chord guitar loop is ~1.4
|
||||||
|
rail-screenfuls; a 4-chord jazz piano loop is ~3.5. The playhead highlight
|
||||||
|
travels whether or not the row is in the scroller's window; the strip up top
|
||||||
|
always shows where you are. **No
|
||||||
|
auto-scroll in D-51** — same reasoning as D-40 §4, plus: contained auto-follow
|
||||||
|
is now *technically safe* (the scroller is no longer the document, so it can't
|
||||||
|
yank the page), so I flag it to Maestro as an optional 1-point follow-up
|
||||||
|
**after** the user has felt the manual version — auto-motion during a jam is
|
||||||
|
exactly the "it changes while I play" complaint in a new hat, so it must be
|
||||||
|
user-pulled, not designer-pushed.
|
||||||
|
|
||||||
|
Flag (not in scope): a **root-aligned MiniPiano crop** would turn most
|
||||||
|
two-octave piano cells into one-octave ones (~160px), roughly halving piano
|
||||||
|
rail heights. It reopens D-24's C-aligned-crop decision and MiniPiano is
|
||||||
|
frozen this sprint — Maestro may file it as a D-52 candidate.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Related progressions — the spec for L-51
|
||||||
|
|
||||||
|
**What it is:** 3–5 KB progressions genuinely related to the *detected loop*,
|
||||||
|
replacing ProgressionSuggestions' generic genre table. KB-sourced only
|
||||||
|
(`kb[style].progressions` — id, name, rn, degrees, qualities, level, songs),
|
||||||
|
loop-relative by construction.
|
||||||
|
|
||||||
|
### Ranking (computable today, no new theory)
|
||||||
|
|
||||||
|
Inputs: `detectedProgression` (chord-name strings), the KB registry, and
|
||||||
|
`matchLoopToProgression`'s result. Reuse `src/lib/match.js` machinery —
|
||||||
|
`loopToDegrees` and `canonicalDegrees` are currently module-private and must
|
||||||
|
become **additive exports** (L-51 lock addition; no behaviour change), next to
|
||||||
|
the already-exported `matchLoopToProgression`/`buildLoopIndex`.
|
||||||
|
|
||||||
|
1. `loopDeg = loopToDegrees(loop)`; bail to empty state if null.
|
||||||
|
`loopCanon = canonicalDegrees(loopDeg)`. `match = matchLoopToProgression(…)`
|
||||||
|
(the component computes its own — see §6's parallelism note).
|
||||||
|
2. Build the loop's **transition set** `T(loop)`: for each i (wrap-around),
|
||||||
|
the triple `(Δ = (deg[i+1]−deg[i]) mod 12, q[i], q[i+1])` with qualities
|
||||||
|
from the chord-name suffixes (unmappable suffix → wildcard: match on Δ
|
||||||
|
alone). Same for every KB progression from its `degrees`/`qualities`.
|
||||||
|
|
||||||
|
**Collapse first — mandatory.** The live `detectedProgression` is a
|
||||||
|
*collapsed* form (detection never commits the same chord twice in a row),
|
||||||
|
while KB `degrees` are *raw*, bar-per-bar — blues-12bar is
|
||||||
|
`[0,0,0,0,5,5,0,0,7,5,0,7]`. Compared raw, the +100 same-canonical-shape
|
||||||
|
term would NEVER fire for the ~10 collapse-affected KB progressions —
|
||||||
|
silently killing the flagship "this 12-bar IS their 12-bar" relation (it
|
||||||
|
degrades, never misfires, which is why it would go unnoticed). So: before
|
||||||
|
`canonicalDegrees(p.degrees)` AND before building `T(p)`, **collapse
|
||||||
|
consecutive equal `(degree, quality)` pairs** in `p` (also with the
|
||||||
|
wrap-around pair). This additionally removes the harmless-but-deflating
|
||||||
|
`Δ=0` self-transitions from `T(p)`. Alternative once D-62's fix (a) lands
|
||||||
|
collapsed-form indexing in match.js: consume that shared collapsed form
|
||||||
|
instead of collapsing locally — coordinate via the §9 match.js
|
||||||
|
shared-file note.
|
||||||
|
3. Score every KB progression `p` with `p.id !== match.id`:
|
||||||
|
- **+100** if `canonicalDegrees(p.degrees) === loopCanon` — the same
|
||||||
|
changes in another style/length ("this turnaround IS jazz's I–vi–ii–V");
|
||||||
|
- **+40** if `p.style === match.style` (0 when nothing matched — the
|
||||||
|
ranking still works loop-relative off the raw degrees);
|
||||||
|
- **+12 per shared transition** (distinct triples in `T(loop) ∩ T(p)`),
|
||||||
|
capped at 36 — this is what finds "shares the ii→V" honestly;
|
||||||
|
- **+ up to 16** for rebased degree-set overlap (Jaccard × 16);
|
||||||
|
- **−1 per chord of length difference** (tie-break toward similar-size loops).
|
||||||
|
4. Floor **24** (at least a shared transition + some overlap, or same-style +
|
||||||
|
substance) — never pad with junk; fewer honest entries beat five stretches.
|
||||||
|
Sort desc (stable by style, id), take **max 5; the dashboard budget
|
||||||
|
guarantees 3 visible** (§1.1) — the card is the left column's flex
|
||||||
|
absorber, so entries 4–5 show on tall viewports and scroll within the card
|
||||||
|
on tight ones.
|
||||||
|
|
||||||
|
### Per-entry render (~56px each)
|
||||||
|
|
||||||
|
- Line 1: **name** (gray-100 semibold) · style label (gray-500) · **level
|
||||||
|
chip** (ExplorePanel's `LevelBadge` language — untagged counts foundation) ·
|
||||||
|
annotation (gray-500, [10px]): `same changes` when the +100 fired, else
|
||||||
|
`shares {rn_a}→{rn_b}` naming p's rn at the top shared transition, else
|
||||||
|
`same style`.
|
||||||
|
- Line 2: the **chord chain realized in the current key** — rootPc =
|
||||||
|
`(keyRoot + degree) mod 12` + `CHORD_TYPES[quality].suffix` (the
|
||||||
|
stationVoicings formula), rendered as tappable chips with rn beneath
|
||||||
|
(banner-chip visual language, smaller); 12-bar chains truncate to the first
|
||||||
|
8 + "…". **Tap a chord → `onChordClick` → ChordDetailModal** — the existing
|
||||||
|
per-chord pattern (ExploreSection does exactly this); no new modal, no dock
|
||||||
|
deep-link API invented for v1.
|
||||||
|
|
||||||
|
### Empty states (honest)
|
||||||
|
|
||||||
|
- No loop detected → one-liner (~40px, dashed border):
|
||||||
|
*"Loop a progression — related changes from the songbook land here."*
|
||||||
|
- Loop but nothing ≥ floor → *"Nothing in the songbook genuinely relates to
|
||||||
|
this loop yet."* (never pad).
|
||||||
|
- Loop unmatched but candidates score (shape/transition terms only) → render
|
||||||
|
normally; the annotation still explains *why* each entry is there.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Component boundary + migration order (green at every commit)
|
||||||
|
|
||||||
|
**Boundary call:** `JamGuide` (default export) is promoted from "band" to
|
||||||
|
**jam-grid owner**: it renders the two-column `flex` region and takes two JSX
|
||||||
|
slot props from App — `mainView` (the instrument view — App keeps choosing
|
||||||
|
Fretboard/BassFretboard/Piano; JamGuide never imports them) and `relatedSlot`
|
||||||
|
(RelatedProgressions, mounted by App). Left column = `mainView` + LicksStrip +
|
||||||
|
`relatedSlot`; right column = the height-bounded scroller wrapping GlanceRail /
|
||||||
|
BassGuideRows / the heard-live fallback. Rationale: the match / stationVoicings
|
||||||
|
/ canonicalPos / focus machinery stays in ONE component with no context and no
|
||||||
|
logic lifted into App (the 🚨 App.jsx contract); the slots keep App as pure
|
||||||
|
mounts. **RelatedProgressions computes its own match** (memoized on the loop
|
||||||
|
key — `matchLoopToProgression` over a module-level index is trivially cheap);
|
||||||
|
this small duplicate computation is what makes L-51's files disjoint from
|
||||||
|
D-51's (they can run in parallel) and keeps the component pure/prop-driven:
|
||||||
|
`{ loop, keyInfo, onChordClick }`.
|
||||||
|
|
||||||
|
Sequenced: **L-50 → (D-51 ‖ L-51) → C-50.** Critic gates each.
|
||||||
|
|
||||||
|
### 6.1 L-50 (Luthier) — the dashboard restructure
|
||||||
|
|
||||||
|
**Files (re-lock at promotion):** `src/App.jsx` (layout/mounts only, 🚨 audio
|
||||||
|
contract grep-gated), `src/components/ProgressionBanner.jsx`,
|
||||||
|
`src/components/JamGuide.jsx`, `src/components/Fretboard.jsx`,
|
||||||
|
`src/components/Piano.jsx`, `src/components/BassFretboard.jsx` (compact prop —
|
||||||
|
mechanical chrome trim + max-width cap per §2; D-51 polishes visuals if
|
||||||
|
needed). **Not touched:** ProgressionSuggestions.jsx (unmounted, not edited),
|
||||||
|
GlanceRail.jsx, VoicingBrowser.jsx, all `src/lib/**`.
|
||||||
|
|
||||||
|
1. **Commit 1 — slim strip.** ProgressionBanner: delete the right 30% column +
|
||||||
|
divider + its `currentRN`/big-chord code path; merge key + history + loop
|
||||||
|
onto one row; `HISTORY_SHOWN` 8 → 5; chrome trim `p-4 → p-2` + drop the
|
||||||
|
history wrapper's `pb-1` (what makes the ~76px strip true, §1.2).
|
||||||
|
Standalone green.
|
||||||
|
2. **Commit 2 — the grid (atomic).** These land together or the page has a
|
||||||
|
hole: App replaces the 70/30 row + band with the `xl:` two-column grid;
|
||||||
|
**ProgressionSuggestions unmounted** (import + mount deleted); JamGuide
|
||||||
|
gains `mainView`/`relatedSlot` props and renders left/right columns, rail
|
||||||
|
wrapped in the height-bounded scroller (`xl:max-h-[calc(100vh-1.5rem)]
|
||||||
|
xl:overflow-y-auto` — no sticky, §1); instrument views gain
|
||||||
|
`compact` and App passes it; App passes `relatedSlot={null}` (slot renders
|
||||||
|
nothing until L-51). Green; contract grep clean.
|
||||||
|
3. **Commit 3 — jam view (§1.1).** App: `jamView` UI-state + the controls-bar
|
||||||
|
`⛶ Jam view` toggle button; page root `h-screen overflow-hidden flex
|
||||||
|
flex-col` + grid `flex-1 min-h-0` + left-column flex layout while active;
|
||||||
|
below-dashboard region conditionally unmounted; JamGuide's rail wrapper
|
||||||
|
accepts a `fill` (or `jamView`) prop switching the max-h bound → `h-full
|
||||||
|
overflow-y-auto`; best-effort `requestFullscreen()`/`exitFullscreen()`
|
||||||
|
**with `.catch(() => {})`** (they return Promises — a bare try/catch does
|
||||||
|
not swallow the rejection) + `fullscreenchange` sync + Escape keydown
|
||||||
|
(active only while `jamView`).
|
||||||
|
🚨 Pure layout/UI-state — zero contact with audio callbacks, refs, or
|
||||||
|
AudioCapture props; the toggle never starts/stops listening. Standalone
|
||||||
|
green on top of commit 2.
|
||||||
|
|
||||||
|
### 6.2 D-51 (Muse) — rail at column width
|
||||||
|
|
||||||
|
**Files:** `src/components/GlanceRail.jsx`, `src/components/VoicingBrowser.jsx`
|
||||||
|
(dense-path spacing only). Recommended-cell prominence; cell padding/gap shave
|
||||||
|
as **margin-hardening for the ~4px-tight 284+160 piano pair fit** (§4 — it
|
||||||
|
passes today; the shave makes it robust to label length / scrollbar gutters /
|
||||||
|
rounding); header wrap tuning at ~456px; verify wrap-never-scroll, playhead
|
||||||
|
highlight, AA contrast + focus rings; eyeball 1280×900, 1440×900, ~640px
|
||||||
|
stacked; recompute §4's table against the built thing. No auto-scroll
|
||||||
|
introduced.
|
||||||
|
|
||||||
|
### 6.3 L-51 (Luthier) — RelatedProgressions
|
||||||
|
|
||||||
|
**Files:** `src/components/RelatedProgressions.jsx` (new), `src/lib/match.js`
|
||||||
|
(**additive exports only**: `loopToDegrees`, `canonicalDegrees` — flag the
|
||||||
|
shared-file lock to Maestro at promotion), `src/App.jsx` (one-line: pass
|
||||||
|
`relatedSlot={<RelatedProgressions …/>}`). Ranking per §5, exported from the
|
||||||
|
component file for smoke coverage; honest empty states; build + smoke green.
|
||||||
|
Disjoint from D-51 (App.jsx/match.js vs GlanceRail/VoicingBrowser) → may run
|
||||||
|
in parallel after L-50.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Narrow plan (< xl, and the ~640px check)
|
||||||
|
|
||||||
|
Columns stack in the jam-following order: **loop strip → instrument view →
|
||||||
|
voicings rail → licks strip → related progressions** — i.e. the right column
|
||||||
|
tucks between mainView and LicksStrip, matching the user's list order.
|
||||||
|
Implementation: the rail block is simply the second child inside the stacked
|
||||||
|
flow below `xl` (JamGuide reorders its own children with responsive classes or
|
||||||
|
conditional order — no duplicate mounts). The rail **unbounds** below `xl`
|
||||||
|
(the max-h/overflow classes are `xl:`-prefixed) and lays out at natural height
|
||||||
|
in page flow — a nested scroller inside a scrolling page is a trap on touch.
|
||||||
|
Cell wrap at ~576px interior: guitar 5/line, piano two-octave cells alone —
|
||||||
|
same behaviour the D-41 gate already verified for the band. The instrument
|
||||||
|
selector never moves: it lives in the controls bar, global, above everything
|
||||||
|
at every width.
|
||||||
|
|
||||||
|
**Jam view below `xl`:** the toggle still works — below-dashboard surfaces
|
||||||
|
hide and fullscreen still fires — but the stacked dashboard is taller than any
|
||||||
|
narrow viewport, so the page keeps scrolling (`h-screen overflow-hidden`
|
||||||
|
applies only at `xl:`+ alongside the grid). One-screen is a two-column
|
||||||
|
promise; jam view narrows honestly to "distraction-free" rather than
|
||||||
|
pretending the geometry works.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Rejected alternatives
|
||||||
|
|
||||||
|
**Rejected A — keep the rail as the full-width band and put licks +
|
||||||
|
progressions in the right column instead.** The rail is the surface the
|
||||||
|
directive names for the right side ("i'd like to have the suggested voicings
|
||||||
|
on the right side of the screen (the jam guide)") — and the math agrees: full
|
||||||
|
width doesn't make the rail *shorter* in any useful way (rows are height-bound
|
||||||
|
by cell-line count, and at 1,240px most piano galleries fit one line, but the
|
||||||
|
band still starts below the instrument view and pushes licks/progressions off
|
||||||
|
screen — today's exact failure). Licks and progressions are short; they fit
|
||||||
|
under the instrument view; the tall thing is what needs the dedicated column.
|
||||||
|
|
||||||
|
**Rejected B — one-screen by truncation: show only the recommended voicing per
|
||||||
|
station, gallery behind a tap.** Fits 4 stations in ~640px with zero scroll —
|
||||||
|
and violates three standing calls at once: scroll > click, D-30's "all at once"
|
||||||
|
gallery directive, and the learning value the user praised ("potentially learn
|
||||||
|
new ways to play it while you are playing"). The gallery stays; its depth
|
||||||
|
becomes a contained scroll, not a click.
|
||||||
|
|
||||||
|
**Rejected C — rail in the LEFT column, detection surfaces right.** Reading
|
||||||
|
order puts the primary, continuously-tracked surfaces (strip, instrument view)
|
||||||
|
top-left where Western eyes rest; the rail is a reference you glance at. Also
|
||||||
|
geometric: the instrument view wants the wide column (674px natural fretboard
|
||||||
|
width > 500px rail), and swapped columns would force the fretboard to ~0.68
|
||||||
|
scale — sub-legible labels.
|
||||||
|
|
||||||
|
**Rejected D — compact the instrument view via CSS `transform: scale()` or a
|
||||||
|
reduced fret range.** Covered in §2: transform blurs text and shrinks targets;
|
||||||
|
frets 0–7 amputates upper-position play. The natural-width cap + chrome trim
|
||||||
|
achieves the same ~80px saving honestly.
|
||||||
|
|
||||||
|
**Rejected E — page-flow rail (no height bound, no contained scroll).** The
|
||||||
|
"pure" reading of the no-nested-scrollbar taste rule — and it structurally
|
||||||
|
fails the refinement: an unbounded rail stretches the *document* to the rail's
|
||||||
|
full height (a jazz piano loop ≈ ~3,000px+), so the below-grid region —
|
||||||
|
LoopStation and the whole learning area — lands thousands of pixels down
|
||||||
|
instead of one flick below the dashboard; and in jam view an unbounded rail
|
||||||
|
can never fit `h-screen`, so the 100vh hard constraint is unmeetable without
|
||||||
|
the bound anyway. (The left column's five surfaces sit at the top either way —
|
||||||
|
the cost is the document's length and the jam-view fit, not their
|
||||||
|
co-presence.) Below `xl` this rejection inverts — §7 — because stacked
|
||||||
|
layouts have no second column to preserve.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. Out of scope / flags for Maestro
|
||||||
|
|
||||||
|
- **Contained auto-follow** inside the rail scroller — now technically safe,
|
||||||
|
deliberately deferred; user-pulled follow-up only (§4).
|
||||||
|
- **LoopStation in jam view** — excluded per the user's own enumeration (§3
|
||||||
|
recorded call); if missed mid-jam, admitting it is a one-line conditional.
|
||||||
|
User-pulled follow-up only.
|
||||||
|
- **Root-aligned MiniPiano crop** (halves piano rail height) — reopens D-24;
|
||||||
|
D-52 candidate (§4).
|
||||||
|
- **`src/lib/match.js` additive exports** in L-51 — shared-file lock note at
|
||||||
|
promotion (§6.3). Same coordination point covers D-62: if its fix (a) lands
|
||||||
|
collapsed-form indexing in match.js first, L-51's ranking consumes that
|
||||||
|
shared collapsed form instead of collapsing locally (§5).
|
||||||
|
- **Retire-then-delete backlog** grows by ProgressionSuggestions.jsx
|
||||||
|
(unmounted L-50) alongside RoadmapTrack/CurrentJamPanel/EducationPanel.
|
||||||
|
- KnowledgeDock deep-link ("open Explore at style X") — not invented for v1;
|
||||||
|
RelatedProgressions taps go per-chord to ChordDetailModal (§5).
|
||||||
|
- No new tokens, no new colours, no dependencies, no KB/theory/audio changes
|
||||||
|
anywhere in this design. Geometry figures verified per integrated-glance.md;
|
||||||
|
module heights are estimates and D-51/C-50 re-measure the built thing.
|
||||||
+21
-15
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
The queue for the `/kb-expand` loop. One cell per session, top-to-bottom. Protocol and schema: [`docs/kb-plan.md`](kb-plan.md). Statuses: `todo` → `in-progress` → `done (YYYY-MM-DD, coverage)`.
|
The queue for the `/kb-expand` loop. One cell per session, top-to-bottom. Protocol and schema: [`docs/kb-plan.md`](kb-plan.md). Statuses: `todo` → `in-progress` → `done (YYYY-MM-DD, coverage)`.
|
||||||
|
|
||||||
|
> Ground truth (verified 2026-07-10): `node scripts/validate-kb.mjs` → ✓ KB valid — **10 style(s), 56 progressions, 164 plays, 23 licks**. Registered cells in `src/data/kb/index.js`: all 10 guitar; piano for jazz, blues, gospel, rnb.
|
||||||
|
>
|
||||||
|
> **Next cells:** piano column continues (pop, rock, funk, country, reggae, bossa remain) · **bass column is now active** — blues bass is next (ledger task P-41, pending the C-41 bass play schema), order blues → jazz → funk per plan.
|
||||||
|
|
||||||
## Phase 0 — Foundation (must be first)
|
## Phase 0 — Foundation (must be first)
|
||||||
|
|
||||||
| # | Cell | Status |
|
| # | Cell | Status |
|
||||||
@@ -12,27 +16,29 @@ The queue for the `/kb-expand` loop. One cell per session, top-to-bottom. Protoc
|
|||||||
|
|
||||||
| # | Style | Status |
|
| # | Style | Status |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| 1 | Jazz (part of bootstrap) | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
| 1 | Jazz (part of bootstrap) | done (2026-06-12, 5 progressions × 2 plays; +2 intermediate progressions 2026-07-08 → 7 × 2, validator ✓) |
|
||||||
| 2 | Blues | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
| 2 | Blues | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
||||||
| 3 | Rock | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
| 3 | Rock | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
||||||
| 4 | Bossa Nova | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
| 4 | Bossa Nova | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
||||||
| 5 | Funk | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
| 5 | Funk | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
||||||
| 6 | Reggae | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
| 6 | Reggae | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
||||||
| 7 | Country / Folk | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
| 7 | Country / Folk | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
||||||
| 8 | R&B / Neo-soul | done (2026-06-12, 5 progressions × 2 plays, validator ✓) |
|
| 8 | R&B / Neo-soul | done (2026-06-12, 5 progressions × 2 plays; +2 intermediate progressions 2026-07-08 → 7 × 2, validator ✓) |
|
||||||
| 9 | Gospel | todo |
|
| 9 | Gospel | done (2026-06-15, 5 progressions × 2 plays; +2 intermediate progressions 2026-07-08 → 7 × 2, validator ✓) |
|
||||||
| 10 | Pop | todo |
|
| 10 | Pop | done (2026-06-15, 5 progressions × 2 plays, validator ✓) |
|
||||||
|
|
||||||
|
> Guitar licks (not tracked as cells above; C-20 lick schema, 2026-07-08): 23 licks live in 6 guitar cells — blues 4, jazz 4, funk 4 (pack #1, 2026-07-08) + rock 4, country 4, reggae 3 (pack #2, 2026-07-08/09).
|
||||||
|
|
||||||
## Piano
|
## Piano
|
||||||
|
|
||||||
| # | Style | Status |
|
| # | Style | Status |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| 11 | Jazz | todo |
|
| 11 | Jazz | done (2026-07-08, 7 progressions × 2 plays, validator ✓) |
|
||||||
| 12 | Blues | todo |
|
| 12 | Blues | done (2026-07-10, 5 progressions × 2 plays, validator ✓) |
|
||||||
| 13 | Bossa Nova | todo |
|
| 13 | Bossa Nova | todo |
|
||||||
| 14 | Gospel | todo |
|
| 14 | Gospel | done (2026-07-09, 7 progressions × 2 plays, validator ✓) |
|
||||||
| 15 | R&B / Neo-soul | todo |
|
| 15 | R&B / Neo-soul | done (2026-07-10, 7 progressions × 2 plays, validator ✓) |
|
||||||
| 16 | Pop | todo |
|
| 16 | Pop | todo — **next piano cell** |
|
||||||
| 17 | Rock | todo |
|
| 17 | Rock | todo |
|
||||||
| 18 | Funk | todo |
|
| 18 | Funk | todo |
|
||||||
| 19 | Country / Folk | todo |
|
| 19 | Country / Folk | todo |
|
||||||
@@ -42,7 +48,7 @@ The queue for the `/kb-expand` loop. One cell per session, top-to-bottom. Protoc
|
|||||||
|
|
||||||
| # | Style | Status |
|
| # | Style | Status |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| 21 | Blues | todo |
|
| 21 | Blues | todo — **next bass cell** (ledger task P-41; blocked on the C-41 bass play schema) |
|
||||||
| 22 | Jazz | todo |
|
| 22 | Jazz | todo |
|
||||||
| 23 | Funk | todo |
|
| 23 | Funk | todo |
|
||||||
| 24 | Reggae | todo |
|
| 24 | Reggae | todo |
|
||||||
@@ -57,9 +63,9 @@ The queue for the `/kb-expand` loop. One cell per session, top-to-bottom. Protoc
|
|||||||
|
|
||||||
| Milestone | Depends on | Status |
|
| Milestone | Depends on | Status |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Jam Guide MVP (panel, matching, `ChordDiagram.jsx`, live sync) | cell 0 | todo |
|
| Jam Guide MVP (panel, matching, `ChordDiagram.jsx`, live sync) | cell 0 | done (2026-06-15, sprint-jam-guide, PR #2) |
|
||||||
| `MiniPiano.jsx` + recipe resolver | cell 11 | todo |
|
| `MiniPiano.jsx` + recipe resolver | cell 11 | done (2026-06-16 resolver + MiniPiano voicing prop; authored packs render at stations 2026-07-09) |
|
||||||
| Bass pattern renderer | cell 21 | todo |
|
| Bass pattern renderer | cell 21 | todo — activated in sprint-integrated-glance (ledger task L-42, after C-41 + P-41) |
|
||||||
| Improv layer (licks/tabs display) | a few guitar cells | todo |
|
| Improv layer (licks/tabs display) | a few guitar cells | done (2026-07-08, `LickCard.jsx` + licks section; 23 licks across 6 styles) |
|
||||||
|
|
||||||
> Notes for sessions: piano style order front-loads the styles where piano voicings differ most (jazz/gospel/neo-soul); bass order front-loads line-driven styles (blues/jazz/funk). Adjust freely — order is a default, not a rule.
|
> Notes for sessions: piano style order front-loaded the styles where piano voicings differ most (jazz/gospel/neo-soul — all shipped, plus blues); bass order front-loads line-driven styles (blues/jazz/funk). Adjust freely — order is a default, not a rule. Bass cells need the C-41 play schema in `SCHEMA.md` before authoring.
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ function createWindow() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
win.loadURL('http://localhost:5173')
|
win.loadURL('http://127.0.0.1:5173')
|
||||||
win.webContents.openDevTools()
|
win.webContents.openDevTools()
|
||||||
} else {
|
} else {
|
||||||
win.loadFile(path.join(__dirname, '../dist/index.html'))
|
win.loadFile(path.join(__dirname, '../dist/index.html'))
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-eval'; connect-src 'self' http://localhost:5173 ws://localhost:5173; style-src 'self' 'unsafe-inline'; img-src 'self' data:;">
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-eval'; connect-src 'self' http://localhost:5173 ws://localhost:5173 http://127.0.0.1:5173 ws://127.0.0.1:5173; style-src 'self' 'unsafe-inline'; img-src 'self' data:;">
|
||||||
<title>WhatTheFlat ♭? - JamBuddy</title>
|
<title>WhatTheFlat ♭? - JamBuddy</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"electron:dev": "concurrently -k \"vite\" \"wait-on http://localhost:5173 && electron .\"",
|
"electron:dev": "concurrently -k \"vite\" \"wait-on http://127.0.0.1:5173 && electron .\"",
|
||||||
"electron:build": "vite build && electron-builder",
|
"electron:build": "vite build && electron-builder",
|
||||||
"electron:build:win": "vite build && electron-builder --win --publish never",
|
"electron:build:win": "vite build && electron-builder --win --publish never",
|
||||||
"electron:build:mac": "vite build && electron-builder --mac --publish never",
|
"electron:build:mac": "vite build && electron-builder --mac --publish never",
|
||||||
|
|||||||
@@ -0,0 +1,185 @@
|
|||||||
|
// Loop-detection truth fixtures (task C-30) — the contract L-30 must satisfy.
|
||||||
|
//
|
||||||
|
// Each fixture is a realistic `chordHistory` as App.jsx commits it (plain chord
|
||||||
|
// name strings from matchChordFromChroma — "C", "Am", "G7", "Cmaj7"…; the commit
|
||||||
|
// layer at App.jsx:363-365 suppresses ADJACENT duplicates, so histories here are
|
||||||
|
// adjacent-dup-free except the one fixture that deliberately tests dups) plus the
|
||||||
|
// loop a musician would say they are playing (`expect`, or null for "no loop").
|
||||||
|
//
|
||||||
|
// Consumed by scripts/smoke.mjs:
|
||||||
|
// · fixture without expectedFail that fails → smoke exits non-zero (regression)
|
||||||
|
// · fixture with expectedFail that fails → annotated expected-fail (printed)
|
||||||
|
// · fixture with expectedFail that PASSES → smoke FAILS: stale marker, flip it
|
||||||
|
// L-30's definition of done = every expectedFail marker removed, all green.
|
||||||
|
//
|
||||||
|
// ─── FAILURE MAP OF THE PRE-L-30 ALGORITHM (historical — all fixed by L-30) ──
|
||||||
|
// (theory.js `detectRepeatingProgression` as of C-30, every fixture RUN against
|
||||||
|
// it 2026-07-10; L-30 redesigned the function and removed every expectedFail
|
||||||
|
// marker — all 17 fixtures now pass as plain regression guards)
|
||||||
|
//
|
||||||
|
// The pre-L-30 matcher: window = last 32 commits; candidate lengths 2–6; EXACT
|
||||||
|
// contiguous occurrence counting (scan advances by len on match, by 1 on miss);
|
||||||
|
// requires reps ≥ 2; score = reps × len²; returns the canonical (lexicographically
|
||||||
|
// smallest) rotation of the best candidate.
|
||||||
|
//
|
||||||
|
// 1. len²-weighting artifact — self-overlaps of a short vamp beat the vamp:
|
||||||
|
// a 2-chord vamp ×4 reports the 3-chord [Am,G,Am] (2 reps × 3² = 18 beats the
|
||||||
|
// true pair's 4 × 2² = 16); a SUSTAINED 2-chord vamp (full 32 window) reports
|
||||||
|
// the bogus 5-chord [Am,Am,G,Am,G] (fixtures: vamp-2x4, vamp-2-sustained).
|
||||||
|
// 2. One SUBSTITUTED misdetection inside one rep of a 3-loop flips the winner to
|
||||||
|
// a wrong 4-pattern: [F,C,Am,F] straddling the noise scores 2 × 4² = 32 and
|
||||||
|
// beats the real [C,Am,F] at 3 × 3² = 27 (fixture: spurious-substitution).
|
||||||
|
// NOTE: one INSERTED extra chord is survivable today — the miss-by-1 scan
|
||||||
|
// realigns after it (fixture spurious-insert-once stays green).
|
||||||
|
// 3. Insertions in 2 of 4 reps → the same wrong-4-pattern failure (spurious-2of4).
|
||||||
|
// 4. Consecutive duplicate commits of one chord create a wrong 4-pattern
|
||||||
|
// [C,Am,F,C] (2 × 16 > 3 × 9) instead of collapsing to the 3-loop
|
||||||
|
// (fixture: dup-commit). Unreachable from TODAY'S commit layer (App.jsx
|
||||||
|
// dedupes adjacent commits) — the fixture makes the detector safe standalone,
|
||||||
|
// per L-30's "collapse consecutive duplicates" requirement.
|
||||||
|
// 5. Loop lengths 7–8 are structurally impossible (len caps at 6): a 7- or
|
||||||
|
// 8-chord loop ×2 returns a truncated 6-chord slice of itself, not the loop
|
||||||
|
// (fixtures: seven-x2, eight-x2). This is the likely reading of the user's
|
||||||
|
// "5 and then 2 others": a 5+2 = 7-chord FORM can never be detected.
|
||||||
|
// 6. No recency weighting: after a section change (loop A ×3 → loop B ×3) the
|
||||||
|
// OLD 4-chord loop A still outscores the current 3-chord loop B
|
||||||
|
// (3 × 4² = 48 > 3 × 3² = 27), so the display is stuck on the previous
|
||||||
|
// section (fixture: section-change).
|
||||||
|
//
|
||||||
|
// What already WORKS at the pure-function level (regression guards — L-30 must
|
||||||
|
// keep these green): clean 2×3 / 3×2 / 3×3 / 4×3 / 6×2 loops; one inserted
|
||||||
|
// spurious chord; a 5-chord loop + 2-chord tag/turnaround, both with and without
|
||||||
|
// the loop resuming (the occurrence scan skips foreign chords). So if the user
|
||||||
|
// sees the 5+tag case fail live, the loss is in the App.jsx commit layer
|
||||||
|
// (miss-4-then-clear / 2-consecutive-identical vote) — that is L-31's territory,
|
||||||
|
// not this function's.
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotation-minimal normalization — a LOCAL REPLICA of theory.js's private
|
||||||
|
* `canonicalize` (it is not exported, and theory.js is locked to L-30, so we
|
||||||
|
* must not touch it to export it). Same semantics byte-for-byte: pick the
|
||||||
|
* lexicographically smallest rotation via '\0'-joined comparison, so [C,Am,F],
|
||||||
|
* [Am,F,C] and [F,C,Am] all compare equal as loops.
|
||||||
|
*/
|
||||||
|
export function canonicalLoop(pattern) {
|
||||||
|
let best = pattern
|
||||||
|
for (let i = 1; i < pattern.length; i++) {
|
||||||
|
const rot = [...pattern.slice(i), ...pattern.slice(0, i)]
|
||||||
|
if (rot.join('\0') < best.join('\0')) best = rot
|
||||||
|
}
|
||||||
|
return best
|
||||||
|
}
|
||||||
|
|
||||||
|
// repeat a loop n times into one flat history
|
||||||
|
const reps = (loop, n) => Array.from({ length: n }, () => loop).flat()
|
||||||
|
|
||||||
|
export const LOOP_FIXTURES = [
|
||||||
|
// ── Regression guards: what works today MUST keep working ──────────────────
|
||||||
|
{
|
||||||
|
id: 'clean-2x3',
|
||||||
|
description: 'clean 2-chord vamp played 3× — the minimal detectable loop',
|
||||||
|
history: reps(['Am', 'G'], 3),
|
||||||
|
expect: ['Am', 'G'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'clean-3x2',
|
||||||
|
description: 'clean 3-chord loop played exactly 2× (6 commits, the minimum history)',
|
||||||
|
history: reps(['C', 'Am', 'F'], 2),
|
||||||
|
expect: ['C', 'Am', 'F'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'clean-3x3',
|
||||||
|
description: 'clean 3-chord loop played 3× — the plain "3 chords return" case',
|
||||||
|
history: reps(['C', 'Am', 'F'], 3),
|
||||||
|
expect: ['C', 'Am', 'F'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'clean-4x3',
|
||||||
|
description: 'clean 4-chord axis loop played 3×',
|
||||||
|
history: reps(['C', 'G', 'Am', 'F'], 3),
|
||||||
|
expect: ['C', 'G', 'Am', 'F'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'clean-6x2',
|
||||||
|
description: 'clean 6-chord loop played 2× — the top of the current length range',
|
||||||
|
history: reps(['C', 'Am', 'Dm', 'G', 'Em', 'F'], 2),
|
||||||
|
expect: ['C', 'Am', 'Dm', 'G', 'Em', 'F'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'spurious-insert-once',
|
||||||
|
description: '3-chord loop with ONE spurious chord INSERTED mid-rep (C Am F | C Am E7 F | C Am F) — the scan realigns after an insertion',
|
||||||
|
history: ['C', 'Am', 'F', 'C', 'Am', 'E7', 'F', 'C', 'Am', 'F'],
|
||||||
|
expect: ['C', 'Am', 'F'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'five-plus-tag-resumes',
|
||||||
|
description: '5-chord loop ×2, a 2-chord turnaround tag (Dm E7), then the loop resumes — loop must survive the tag',
|
||||||
|
history: [...reps(['Am', 'F', 'C', 'G', 'Em'], 2), 'Dm', 'E7', 'Am', 'F', 'C', 'G', 'Em'],
|
||||||
|
expect: ['Am', 'F', 'C', 'G', 'Em'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'five-plus-tag-at-end',
|
||||||
|
description: '5-chord loop ×2 then 2 foreign chords with the history ending there — the just-played loop must still be reported',
|
||||||
|
history: [...reps(['Am', 'F', 'C', 'G', 'Em'], 2), 'Dm', 'E7'],
|
||||||
|
expect: ['Am', 'F', 'C', 'G', 'Em'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'chromatic-null',
|
||||||
|
description: 'non-repeating chromatic walk — no loop exists, must report null',
|
||||||
|
history: ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G'],
|
||||||
|
expect: null,
|
||||||
|
},
|
||||||
|
|
||||||
|
// ── Failure modes of the pre-L-30 algorithm — fixed by L-30 ────────────────
|
||||||
|
{
|
||||||
|
id: 'vamp-2x4',
|
||||||
|
description: 'clean 2-chord vamp played 4× — must still report the pair, not a self-overlap',
|
||||||
|
history: reps(['Am', 'G'], 4),
|
||||||
|
expect: ['Am', 'G'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'vamp-2-sustained',
|
||||||
|
description: 'sustained 2-chord vamp filling the whole window (×16) — the everyday two-chord jam',
|
||||||
|
history: reps(['Am', 'G'], 16),
|
||||||
|
expect: ['Am', 'G'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'spurious-substitution',
|
||||||
|
description: '3-chord loop ×4 with ONE substituted misdetection (Am read as E7 in the third rep) — must still report the 3-loop',
|
||||||
|
history: ['C', 'Am', 'F', 'C', 'Am', 'F', 'C', 'E7', 'F', 'C', 'Am', 'F'],
|
||||||
|
expect: ['C', 'Am', 'F'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'spurious-2of4',
|
||||||
|
description: '3-chord loop ×4 with an inserted misdetection in two different reps (E7, then Dm7) — realistic sustained noise',
|
||||||
|
history: ['C', 'Am', 'F', 'C', 'Am', 'E7', 'F', 'C', 'Am', 'F', 'C', 'Dm7', 'Am', 'F'],
|
||||||
|
expect: ['C', 'Am', 'F'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'dup-commit',
|
||||||
|
description: 'consecutive duplicate commit of the same chord inside an otherwise clean 3-loop (C Am F C C Am F …) — dups must collapse',
|
||||||
|
history: ['C', 'Am', 'F', 'C', 'C', 'Am', 'F', 'C', 'Am', 'F'],
|
||||||
|
expect: ['C', 'Am', 'F'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'seven-x2',
|
||||||
|
description: '7-chord loop played 2× — beyond the pre-L-30 length-6 cap',
|
||||||
|
history: reps(['Em', 'G', 'D', 'A', 'Em', 'C', 'B7'], 2),
|
||||||
|
expect: ['Em', 'G', 'D', 'A', 'Em', 'C', 'B7'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'eight-x2',
|
||||||
|
description: '8-chord loop (extended andalusian form) played 2× — beyond the pre-L-30 cap',
|
||||||
|
history: reps(['Am', 'G', 'F', 'E7', 'Am', 'C', 'Dm', 'E7'], 2),
|
||||||
|
expect: ['Am', 'G', 'F', 'E7', 'Am', 'C', 'Dm', 'E7'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'section-change',
|
||||||
|
description: 'section change: 4-chord loop A ×3, then 3-chord loop B ×3 — must report B, the loop being played NOW',
|
||||||
|
history: [...reps(['C', 'G', 'Am', 'F'], 3), ...reps(['Dm7', 'G7', 'Cmaj7'], 3)],
|
||||||
|
expect: ['Dm7', 'G7', 'Cmaj7'],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export default LOOP_FIXTURES
|
||||||
+969
-2
@@ -10,6 +10,7 @@
|
|||||||
import { register } from 'node:module'
|
import { register } from 'node:module'
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url'
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
||||||
import { dirname, join } from 'node:path'
|
import { dirname, join } from 'node:path'
|
||||||
|
import { existsSync } from 'node:fs'
|
||||||
|
|
||||||
// match.js imports './theory' extensionless (resolved by Vite at build time, but
|
// match.js imports './theory' extensionless (resolved by Vite at build time, but
|
||||||
// raw Node ESM requires the extension). Register a tiny resolve hook that retries
|
// raw Node ESM requires the extension). Register a tiny resolve hook that retries
|
||||||
@@ -65,6 +66,12 @@ const kb = (await load('src/data/kb/index.js')).default
|
|||||||
const match = await load('src/lib/match.js')
|
const match = await load('src/lib/match.js')
|
||||||
const { buildLoopIndex, matchLoopToProgression, findLoopPosition } = match
|
const { buildLoopIndex, matchLoopToProgression, findLoopPosition } = match
|
||||||
|
|
||||||
|
const theory = await load('src/lib/theory.js')
|
||||||
|
const { CHORD_TYPES, detectRepeatingProgression } = theory
|
||||||
|
|
||||||
|
const piano = await load('src/lib/piano.js')
|
||||||
|
const { pianoVoicing, pianoVoicingChain, voicingToneSet, hasTrueSeventh } = piano
|
||||||
|
|
||||||
// ─── 1. Registry integrity ────────────────────────────────────────────────────
|
// ─── 1. Registry integrity ────────────────────────────────────────────────────
|
||||||
|
|
||||||
console.log('\nRegistry integrity:')
|
console.log('\nRegistry integrity:')
|
||||||
@@ -227,7 +234,966 @@ const rebase = (arr) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── 3. Summary + exit code ───────────────────────────────────────────────────
|
// ─── 3. Piano voicing resolver (C-10) ─────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// Exercise src/lib/piano.js across every CHORD_TYPES quality (all 14) at a
|
||||||
|
// couple of roots, for each forced style + the default. Expected facts are
|
||||||
|
// derived from the resolver/theory (voicingToneSet / hasTrueSeventh / the chord
|
||||||
|
// intervals), never hardcoded as brittle note arrays.
|
||||||
|
|
||||||
|
console.log('\nPiano resolver:')
|
||||||
|
|
||||||
|
const QUALITIES = Object.keys(CHORD_TYPES) // all 14
|
||||||
|
const PIANO_ROOTS = [0, 7] // C and G
|
||||||
|
const PIANO_STYLES = ['root', 'shell', 'rootlessA', 'rootlessB', undefined] // undefined = default
|
||||||
|
const mod12 = (n) => (((n % 12) + 12) % 12)
|
||||||
|
const styleName = (s) => s ?? 'default'
|
||||||
|
|
||||||
|
check(`CHORD_TYPES exposes all 14 qualities for the piano sweep`, () => {
|
||||||
|
assert(QUALITIES.length === 14, `expected 14 CHORD_TYPES, got ${QUALITIES.length}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// --- 3a. Per (quality × root × style): valid shape, no wrong notes, 3rd & 7th --
|
||||||
|
for (const quality of QUALITIES) {
|
||||||
|
const ints = CHORD_TYPES[quality].intervals
|
||||||
|
const hasReal3rd = ints.some((i) => i === 3 || i === 4)
|
||||||
|
// The "real 3rd" target pc: minor/major 3rd if present, else the suspension
|
||||||
|
// tone (sus2 → 2, sus4 → 5) that stands in the 3rd slot.
|
||||||
|
const susTone = ints[1] // sus2 → 2, sus4 → 5 (index-1 stand-in for the 3rd)
|
||||||
|
const trueSeventh = hasTrueSeventh(quality) // interval 10 or 11 present
|
||||||
|
|
||||||
|
for (const rootPc of PIANO_ROOTS) {
|
||||||
|
// expected 3rd-slot pc (absolute pc)
|
||||||
|
const third3 = mod12(rootPc + 3)
|
||||||
|
const third4 = mod12(rootPc + 4)
|
||||||
|
const susPc = mod12(rootPc + susTone)
|
||||||
|
const seventhInt = ints.find((i) => i === 10 || i === 11)
|
||||||
|
const seventhPc = seventhInt === undefined ? null : mod12(rootPc + seventhInt)
|
||||||
|
|
||||||
|
for (const style of PIANO_STYLES) {
|
||||||
|
const chord = { rootPc, quality }
|
||||||
|
const opts = style === undefined ? {} : { style }
|
||||||
|
const tag = `${quality}@${rootPc} [${styleName(style)}]`
|
||||||
|
|
||||||
|
check(`${tag}: valid voicing shape`, () => {
|
||||||
|
const v = pianoVoicing(chord, opts)
|
||||||
|
assert(v && typeof v === 'object', 'no voicing object')
|
||||||
|
assert(Array.isArray(v.notes) && v.notes.length > 0, 'notes must be a non-empty array')
|
||||||
|
assert(v.notes.every((n) => Number.isFinite(n)), 'notes must all be numbers')
|
||||||
|
assert(Array.isArray(v.pcs) && v.pcs.length > 0, 'pcs must be a non-empty array')
|
||||||
|
assert(typeof v.bass === 'number', 'bass must be a number')
|
||||||
|
assert(typeof v.style === 'string' && v.style.length > 0, 'style must be a non-empty string')
|
||||||
|
assert(typeof v.label === 'string' && v.label.length > 0, 'label must be a non-empty string')
|
||||||
|
})
|
||||||
|
|
||||||
|
check(`${tag}: no wrong notes (pcs ⊆ voicingToneSet)`, () => {
|
||||||
|
const v = pianoVoicing(chord, opts)
|
||||||
|
// Scope the legal-tone set to the voicing's ACTUAL produced style.
|
||||||
|
const legal = voicingToneSet({ rootPc, quality }, v.style)
|
||||||
|
for (const pc of v.pcs) {
|
||||||
|
assert(legal.has(pc), `pc ${pc} not in voicingToneSet(${quality}, ${v.style}) {${[...legal].sort((a, b) => a - b)}}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
check(`${tag}: real 3rd (or suspension) present`, () => {
|
||||||
|
const v = pianoVoicing(chord, opts)
|
||||||
|
if (hasReal3rd) {
|
||||||
|
assert(v.pcs.includes(third3) || v.pcs.includes(third4),
|
||||||
|
`expected a 3rd (pc ${third3} or ${third4}) in pcs {${v.pcs}}`)
|
||||||
|
} else {
|
||||||
|
// sus2/sus4 — the 2 or 4 stands in the 3rd slot.
|
||||||
|
assert(v.pcs.includes(susPc),
|
||||||
|
`expected suspension tone pc ${susPc} in pcs {${v.pcs}}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
check(`${tag}: true 7th present in shell/rootless`, () => {
|
||||||
|
const v = pianoVoicing(chord, opts)
|
||||||
|
const isSeventhVoicing = v.style === 'shell' || v.style === 'rootlessA' || v.style === 'rootlessB'
|
||||||
|
if (trueSeventh && isSeventhVoicing) {
|
||||||
|
assert(v.pcs.includes(seventhPc),
|
||||||
|
`${v.style} of a true-7th chord must include the 7th pc ${seventhPc}, got {${v.pcs}}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
check(`${tag}: notes within [0,36] and bass == min(notes)`, () => {
|
||||||
|
const v = pianoVoicing(chord, opts)
|
||||||
|
assert(v.notes.every((n) => n >= 0 && n <= 36),
|
||||||
|
`notes ${JSON.stringify(v.notes)} out of [0,36]`)
|
||||||
|
assert(v.bass === Math.min(...v.notes),
|
||||||
|
`bass ${v.bass} ≠ min(notes) ${Math.min(...v.notes)}`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 3b. No duplicate absolute note within a single voicing (sus2 nit watch) ---
|
||||||
|
// Sweep every quality × style (forced + default). A duplicate absolute note in
|
||||||
|
// one voicing's `notes` is a defect surfaced as a ✗ (L-10 gate flagged a
|
||||||
|
// forced-rootless sus2 collision). If the resolver was since deduped, this
|
||||||
|
// passes. We report WHICH quality/style collides so it's visible.
|
||||||
|
{
|
||||||
|
const dupes = []
|
||||||
|
for (const quality of QUALITIES) {
|
||||||
|
for (const rootPc of PIANO_ROOTS) {
|
||||||
|
for (const style of PIANO_STYLES) {
|
||||||
|
const opts = style === undefined ? {} : { style }
|
||||||
|
const v = pianoVoicing({ rootPc, quality }, opts)
|
||||||
|
if (v.notes.length !== new Set(v.notes).size) {
|
||||||
|
dupes.push(`${quality}@${rootPc} [${styleName(style)}] notes=${JSON.stringify(v.notes)}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
check('no duplicate absolute note within any single voicing (all qualities × styles)', () => {
|
||||||
|
assert(dupes.length === 0,
|
||||||
|
`duplicate-note voicing(s) found: ${dupes.join('; ')}`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 3c. Determinism: same input → identical notes -----------------------------
|
||||||
|
{
|
||||||
|
check('pianoVoicing is deterministic (same input → identical notes)', () => {
|
||||||
|
for (const quality of QUALITIES) {
|
||||||
|
for (const rootPc of PIANO_ROOTS) {
|
||||||
|
for (const style of PIANO_STYLES) {
|
||||||
|
const opts = style === undefined ? {} : { style }
|
||||||
|
const a = pianoVoicing({ rootPc, quality }, opts)
|
||||||
|
const b = pianoVoicing({ rootPc, quality }, opts)
|
||||||
|
assert(a.notes.join(',') === b.notes.join(','),
|
||||||
|
`non-deterministic notes for ${quality}@${rootPc} [${styleName(style)}]: ${a.notes} vs ${b.notes}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 3d. Voice-leading sanity: chain pcs == per-chord unthreaded pcs ------------
|
||||||
|
// Threading re-registers (slides whole shapes by octaves) but never changes the
|
||||||
|
// pitch CONTENT — each chained voicing's pcs must equal the same chord voiced
|
||||||
|
// alone (default style), as a set.
|
||||||
|
{
|
||||||
|
const chords = [
|
||||||
|
{ rootPc: 2, quality: 'min7' }, // Dm7
|
||||||
|
{ rootPc: 7, quality: 'dom7' }, // G7
|
||||||
|
{ rootPc: 0, quality: 'maj7' }, // Cmaj7
|
||||||
|
]
|
||||||
|
const chain = pianoVoicingChain(chords)
|
||||||
|
const pcSet = (arr) => [...new Set(arr)].sort((a, b) => a - b).join(',')
|
||||||
|
|
||||||
|
check('pianoVoicingChain(ii–V–I) returns 3 voicings', () => {
|
||||||
|
assert(Array.isArray(chain) && chain.length === 3,
|
||||||
|
`expected 3 voicings, got ${Array.isArray(chain) ? chain.length : typeof chain}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('chain pcs match the per-chord unthreaded pcs (threading never changes pitch content)', () => {
|
||||||
|
chords.forEach((chord, i) => {
|
||||||
|
const solo = pianoVoicing(chord) // same default style, no prev
|
||||||
|
assert(pcSet(chain[i].pcs) === pcSet(solo.pcs),
|
||||||
|
`chord ${i} (${chord.quality}@${chord.rootPc}): chain pcs {${pcSet(chain[i].pcs)}} ≠ unthreaded {${pcSet(solo.pcs)}}`)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── 4. Lick + level schema validation (C-20) ─────────────────────────────────
|
||||||
|
//
|
||||||
|
// Import the REAL validator in lib mode (KB_VALIDATE_AS_LIB skips the full-KB
|
||||||
|
// run) and exercise its exported checkLick/LEVELS against in-memory fixtures:
|
||||||
|
// a good lick must pass, and bad-vocab / bad-string-range / duplicate-id licks
|
||||||
|
// must FAIL — proving the validator's lick rules actually bite.
|
||||||
|
|
||||||
|
console.log('\nLick + level schema (validate-kb lib mode):')
|
||||||
|
|
||||||
|
process.env.KB_VALIDATE_AS_LIB = '1'
|
||||||
|
const kbv = await load('scripts/validate-kb.mjs')
|
||||||
|
const { checkLick, LEVELS, LICK_TECHNIQUES } = kbv
|
||||||
|
|
||||||
|
check('validate-kb exports checkLick / LEVELS / LICK_TECHNIQUES in lib mode', () => {
|
||||||
|
assert(typeof checkLick === 'function', 'checkLick is not a function')
|
||||||
|
assert(Array.isArray(LEVELS) && LEVELS.join(',') === 'foundation,intermediate',
|
||||||
|
`LEVELS must be exactly [foundation, intermediate], got ${JSON.stringify(LEVELS)}`)
|
||||||
|
assert(Array.isArray(LICK_TECHNIQUES) && LICK_TECHNIQUES.length === 8,
|
||||||
|
`expected the 8-word technique vocab, got ${JSON.stringify(LICK_TECHNIQUES)}`)
|
||||||
|
for (const t of ['hammer-on', 'pull-off', 'slide', 'bend', 'double-stop', 'ghost-note', 'chromatic-approach', 'vibrato'])
|
||||||
|
assert(LICK_TECHNIQUES.includes(t), `vocab missing '${t}'`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// A realistic, fully-valid fixture (style-prefixed id, vocab techniques,
|
||||||
|
// strings 1–6, frets 0–15, per-note techniques present in the summary).
|
||||||
|
const goodLick = () => ({
|
||||||
|
id: 'blues-box1-roll',
|
||||||
|
name: 'B.B. box roll',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the I7',
|
||||||
|
techniques: ['bend', 'vibrato'],
|
||||||
|
tab: [
|
||||||
|
{ string: 2, fret: 8 },
|
||||||
|
{ string: 1, fret: 8, technique: 'bend' },
|
||||||
|
{ string: 1, fret: 10, technique: 'vibrato' },
|
||||||
|
{ string: 2, fret: 8 },
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
check('good in-memory lick fixture PASSES checkLick (0 errors)', () => {
|
||||||
|
const errs = checkLick('fixture', goodLick(), 'blues', new Set())
|
||||||
|
assert(errs.length === 0, `expected clean pass, got: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('bad-vocab lick FAILS (technique outside the fixed vocabulary)', () => {
|
||||||
|
const lick = goodLick()
|
||||||
|
lick.techniques = ['bend', 'tapping'] // 'tapping' is not in the vocab
|
||||||
|
const errs = checkLick('fixture', lick, 'blues', new Set())
|
||||||
|
assert(errs.length > 0, 'bad vocab was accepted')
|
||||||
|
assert(errs.some((e) => e.includes("'tapping'")), `no error names 'tapping': ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('bad per-note technique FAILS (vocab enforced on tab notes too)', () => {
|
||||||
|
const lick = goodLick()
|
||||||
|
lick.tab[1].technique = 'sweep-picking'
|
||||||
|
const errs = checkLick('fixture', lick, 'blues', new Set())
|
||||||
|
assert(errs.some((e) => e.includes("'sweep-picking'")), `per-note vocab not enforced: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('bad-string-range lick FAILS (string 7 / string 0 rejected)', () => {
|
||||||
|
for (const bad of [7, 0]) {
|
||||||
|
const lick = goodLick()
|
||||||
|
lick.tab[0].string = bad
|
||||||
|
const errs = checkLick('fixture', lick, 'blues', new Set())
|
||||||
|
assert(errs.some((e) => e.includes('string must be an integer 1–6')),
|
||||||
|
`string ${bad} was accepted: ${errs.join('; ')}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
check('bad-fret lick FAILS (fret 16 / negative / non-integer rejected)', () => {
|
||||||
|
for (const bad of [16, -1, 3.5]) {
|
||||||
|
const lick = goodLick()
|
||||||
|
lick.tab[0].fret = bad
|
||||||
|
const errs = checkLick('fixture', lick, 'blues', new Set())
|
||||||
|
assert(errs.some((e) => e.includes('fret must be an integer')),
|
||||||
|
`fret ${bad} was accepted: ${errs.join('; ')}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
check('duplicate-id lick FAILS (ids global across progressions AND licks)', () => {
|
||||||
|
const ids = new Set()
|
||||||
|
assert(checkLick('fixture', goodLick(), 'blues', ids).length === 0, 'first insert should pass')
|
||||||
|
const errs = checkLick('fixture', goodLick(), 'blues', ids) // same id again
|
||||||
|
assert(errs.some((e) => e.includes('duplicate id')), `duplicate id was accepted: ${errs.join('; ')}`)
|
||||||
|
// Colliding with an existing PROGRESSION id must also fail (shared namespace).
|
||||||
|
const progIds = new Set(['blues-box1-roll'])
|
||||||
|
const errs2 = checkLick('fixture', goodLick(), 'blues', progIds)
|
||||||
|
assert(errs2.some((e) => e.includes('duplicate id')), 'collision with a progression id was accepted')
|
||||||
|
})
|
||||||
|
|
||||||
|
check('wrong style prefix / bad level / empty tab all FAIL', () => {
|
||||||
|
const wrongPrefix = goodLick(); wrongPrefix.id = 'jazz-box1-roll'
|
||||||
|
assert(checkLick('fixture', wrongPrefix, 'blues', new Set()).some((e) => e.includes("starting with 'blues-'")),
|
||||||
|
'wrong style prefix accepted')
|
||||||
|
const badLevel = goodLick(); badLevel.level = 'advanced'
|
||||||
|
assert(checkLick('fixture', badLevel, 'blues', new Set()).some((e) => e.includes('level must be one of')),
|
||||||
|
"level 'advanced' accepted")
|
||||||
|
const emptyTab = goodLick(); emptyTab.tab = []
|
||||||
|
assert(checkLick('fixture', emptyTab, 'blues', new Set()).some((e) => e.includes('tab must be a non-empty')),
|
||||||
|
'empty tab accepted')
|
||||||
|
})
|
||||||
|
|
||||||
|
check('per-note technique missing from techniques[] summary FAILS (card tags stay honest)', () => {
|
||||||
|
const lick = goodLick()
|
||||||
|
lick.tab[2].technique = 'slide' // valid vocab, but not in techniques: [bend, vibrato]
|
||||||
|
const errs = checkLick('fixture', lick, 'blues', new Set())
|
||||||
|
assert(errs.some((e) => e.includes("must also appear in the lick's techniques[]")),
|
||||||
|
`summary consistency not enforced: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Progression `level` is optional in the KB — assert today's KB either omits it
|
||||||
|
// or uses a legal value (guards P-20's tagging against typos reaching main).
|
||||||
|
check("every KB progression 'level', when present, is foundation|intermediate", () => {
|
||||||
|
for (const styleName of styleNames) {
|
||||||
|
for (const p of kb[styleName]?.progressions ?? []) {
|
||||||
|
if (p.level !== undefined) {
|
||||||
|
assert(LEVELS.includes(p.level), `${styleName}/${p.id}: bad level '${p.level}'`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Same guard for any licks already shipped in the KB: run the REAL packs'
|
||||||
|
// licks (if any) through the instrument-routed checker — piano licks are
|
||||||
|
// degree-based (checkPianoLick, §5c below), everything else is tab-based
|
||||||
|
// checkLick — mirroring the validator's own routing.
|
||||||
|
check('every KB pack licks[] entry (if any) passes its instrument\'s lick check', () => {
|
||||||
|
const ids = new Set()
|
||||||
|
for (const styleName of styleNames) {
|
||||||
|
const instruments = kb[styleName]?.instruments ?? {}
|
||||||
|
for (const [inst, pack] of Object.entries(instruments)) {
|
||||||
|
if (pack?.licks === undefined) continue
|
||||||
|
assert(Array.isArray(pack.licks) && pack.licks.length,
|
||||||
|
`${styleName}/${inst}: licks, when present, must be a non-empty array`)
|
||||||
|
const checkInstLick = inst === 'piano' ? kbv.checkPianoLick : checkLick
|
||||||
|
for (const lick of pack.licks) {
|
||||||
|
const errs = checkInstLick(`${styleName}/${inst} ${lick?.id ?? '?'}`, lick, styleName, ids)
|
||||||
|
assert(errs.length === 0, errs.join('; '))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// ─── 5. Piano hand-span rule (C-22) ───────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// SCHEMA.md rule 3: one hand per recipe stays within a 10th. The validator
|
||||||
|
// enforces span ≤ MAX_HAND_SPAN (15 semitones, a minor 10th) by stacking the
|
||||||
|
// recipe's degrees low→high (each note in the nearest position above the
|
||||||
|
// previous — the documented jazz/piano.js convention). Prove the rule bites on
|
||||||
|
// synthetic fixtures, then run every REAL piano pack recipe through the check.
|
||||||
|
|
||||||
|
console.log('\nPiano hand-span rule (validate-kb lib mode):')
|
||||||
|
|
||||||
|
const { checkPianoRecipe, MAX_HAND_SPAN } = kbv
|
||||||
|
|
||||||
|
check('validate-kb exports checkPianoRecipe / MAX_HAND_SPAN (= 15, a minor 10th)', () => {
|
||||||
|
assert(typeof checkPianoRecipe === 'function', 'checkPianoRecipe is not a function')
|
||||||
|
assert(MAX_HAND_SPAN === 15, `MAX_HAND_SPAN must be 15 (minor 10th), got ${MAX_HAND_SPAN}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// dom7 LH ['1','7','3'] stacks 0 → 10 → 16 (the 3rd must sit ABOVE the ♭7):
|
||||||
|
// span 16 = a major 10th — one semitone past the rule. Must FAIL, and the
|
||||||
|
// error must name the hand and the computed span.
|
||||||
|
check('synthetic 16-semitone hand (dom7 LH [1 7 3]) FAILS with the span error', () => {
|
||||||
|
const errs = checkPianoRecipe('fixture', { recipe: { LH: ['1', '7', '3'] } }, 'dom7')
|
||||||
|
assert(errs.length > 0, 'a 16-semitone hand was accepted')
|
||||||
|
assert(errs.some((e) => e.includes('LH') && e.includes('spans 16')),
|
||||||
|
`no error names LH + span 16: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// dom7 LH ['1','7','#9'] stacks 0 → 10 → 15: span exactly 15 (the 7♯9 sound).
|
||||||
|
// The boundary is legal — SCHEMA's "within a 10th" includes the minor 10th.
|
||||||
|
check('synthetic 15-semitone hand (dom7 LH [1 7 #9]) passes (boundary is legal)', () => {
|
||||||
|
const errs = checkPianoRecipe('fixture', { recipe: { LH: ['1', '7', '#9'] } }, 'dom7')
|
||||||
|
assert(errs.length === 0, `span-15 boundary rejected: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// The rule must bite on the RIGHT hand too, and a legal LH must not mask it.
|
||||||
|
check('RH is checked independently (LH [1] fine, RH [1 7 3] fails naming RH)', () => {
|
||||||
|
const errs = checkPianoRecipe('fixture', { recipe: { LH: ['1'], RH: ['1', '7', '3'] } }, 'dom7')
|
||||||
|
assert(errs.some((e) => e.includes('RH') && e.includes('spans 16')),
|
||||||
|
`RH span not enforced: ${errs.join('; ')}`)
|
||||||
|
assert(!errs.some((e) => e.includes('LH')), `legal LH wrongly flagged: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// P-22's widest verified voicing: ø11 rootless ['3','5','7','11'] on half_dim
|
||||||
|
// stacks 3 → 6 → 10 → 17: span 14. It must stay legal — that's why the
|
||||||
|
// constant is 15, not 12 or 16.
|
||||||
|
check("jazz's widest voicing (half_dim LH [3 5 7 11], span 14) stays legal", () => {
|
||||||
|
const errs = checkPianoRecipe('fixture', { recipe: { LH: ['3', '5', '7', '11'] } }, 'half_dim')
|
||||||
|
assert(errs.length === 0, `the verified 14-span ø11 voicing was rejected: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Live-KB guard: every piano recipe in every registered pack (present and
|
||||||
|
// future — e.g. the incoming gospel piano cell) passes checkPianoRecipe.
|
||||||
|
check('every KB piano pack recipe passes checkPianoRecipe (span ≤ 15 everywhere)', () => {
|
||||||
|
let recipes = 0
|
||||||
|
for (const styleName of styleNames) {
|
||||||
|
const pack = kb[styleName]?.instruments?.piano
|
||||||
|
if (!pack) continue
|
||||||
|
const progById = Object.fromEntries((kb[styleName].progressions ?? []).map((p) => [p.id, p]))
|
||||||
|
for (const [pid, plays] of Object.entries(pack.plays ?? {})) {
|
||||||
|
const prog = progById[pid]
|
||||||
|
assert(prog, `${styleName}/piano plays key '${pid}' is not a progression of this style`)
|
||||||
|
plays.forEach((play, pi) => {
|
||||||
|
(play.chords ?? []).forEach((step, ci) => {
|
||||||
|
recipes++
|
||||||
|
const where = `${styleName}/piano ${pid} play[${pi}] "${play.label ?? '?'}" chord[${ci}]`
|
||||||
|
const errs = checkPianoRecipe(where, step, prog.qualities[ci])
|
||||||
|
assert(errs.length === 0, errs.join('; '))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(` (${recipes} live piano recipes checked)`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// ─── 5b. Bass play schema (C-41) ──────────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// Same lib-mode pattern as §4/§5: exercise the exported checkBassPlay against
|
||||||
|
// in-memory fixtures — a realistic boogie play must pass, and each malformed
|
||||||
|
// variant must FAIL with the specific error — proving the bass rules bite
|
||||||
|
// before any bass cell (P-41) is authored against them.
|
||||||
|
|
||||||
|
console.log('\nBass play schema (validate-kb lib mode):')
|
||||||
|
|
||||||
|
const { checkBassPlay, MIN_PLAYS_BASS, BASS_APPROACHES, BASS_MAX_OFFSET } = kbv
|
||||||
|
|
||||||
|
check('validate-kb exports checkBassPlay / MIN_PLAYS_BASS(=1) / BASS_APPROACHES / BASS_MAX_OFFSET(=19)', () => {
|
||||||
|
assert(typeof checkBassPlay === 'function', 'checkBassPlay is not a function')
|
||||||
|
assert(MIN_PLAYS_BASS === 1, `MIN_PLAYS_BASS must be 1 (SCHEMA bass coverage floor), got ${MIN_PLAYS_BASS}`)
|
||||||
|
assert(Array.isArray(BASS_APPROACHES) && BASS_APPROACHES.join(',') === 'chrom-below,chrom-above,fifth-of-next',
|
||||||
|
`BASS_APPROACHES must be exactly [chrom-below, chrom-above, fifth-of-next], got ${JSON.stringify(BASS_APPROACHES)}`)
|
||||||
|
assert(BASS_MAX_OFFSET === 19, `BASS_MAX_OFFSET must be 19 (an octave + a fifth), got ${BASS_MAX_OFFSET}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// A 2-step I7→IV7 fixture progression; the IV7 gets 2 bars (exercises the
|
||||||
|
// per-step beat range). The good play: classic boogie cell + a chromatic walk.
|
||||||
|
const bassProg = () => ({
|
||||||
|
id: 'blues-fixture', rn: ['I7', 'IV7'], degrees: [0, 5],
|
||||||
|
qualities: ['dom7', 'dom7'], bars: [1, 2],
|
||||||
|
})
|
||||||
|
const goodBassPlay = () => ({
|
||||||
|
label: 'Boogie cell',
|
||||||
|
level: 'foundation',
|
||||||
|
feel: 'swung 8ths, locked with the kick',
|
||||||
|
tips: 'The same cell moves to the IV unchanged — degrees, not frets.',
|
||||||
|
chords: [
|
||||||
|
{
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 },
|
||||||
|
{ deg: '3', beat: 2 },
|
||||||
|
{ deg: '5', beat: 3, technique: 'ghost-note' },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'walk up into the IV',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 },
|
||||||
|
{ deg: '6', beat: 3 },
|
||||||
|
{ deg: 'b7', beat: 5 },
|
||||||
|
{ deg: '1', octave: 1, beat: 7 },
|
||||||
|
{ approach: 'fifth-of-next', beat: 8 },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
check('good boogie fixture PASSES checkBassPlay (0 errors)', () => {
|
||||||
|
const errs = checkBassPlay('fixture', goodBassPlay(), bassProg())
|
||||||
|
assert(errs.length === 0, `expected clean pass, got: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check("unresolvable degree FAILS ('2' is not a bass degree)", () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[0].pattern[1] = { deg: '2', beat: 2 }
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes("unresolvable degree '2'")), `deg '2' was accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('numeric deg FAILS (degrees are strings, one convention with piano)', () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[0].pattern[0] = { deg: 1, beat: 1 }
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes('deg must be a degree STRING')), `numeric deg accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check("octave cap bites (b7 octave 1 = 22 semitones > 19) and bad octave values FAIL", () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[1].pattern[3] = { deg: 'b7', octave: 1, beat: 7 }
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes(`max ${BASS_MAX_OFFSET}`)), `22-semitone offset accepted: ${errs.join('; ')}`)
|
||||||
|
const play2 = goodBassPlay()
|
||||||
|
play2.chords[1].pattern[3] = { deg: '1', octave: 2, beat: 7 }
|
||||||
|
const errs2 = checkBassPlay('fixture', play2, bassProg())
|
||||||
|
assert(errs2.some((e) => e.includes('octave, when present, must be 0 or 1')), `octave 2 accepted: ${errs2.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('empty pattern FAILS', () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[0].pattern = []
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes('pattern must be a non-empty ordered array')), `empty pattern accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check("rootless pattern FAILS (every pattern must state '1')", () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[0].pattern = [{ deg: '3', beat: 1 }, { deg: '5', beat: 2 }]
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes("never states the root ('1')")), `rootless pattern accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('approach notes must CLOSE the pattern (deg after approach fails)', () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[0].pattern = [{ deg: '1', beat: 1 }, { approach: 'chrom-below', beat: 2 }, { deg: '5', beat: 3 }]
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes('deg note after an approach')), `mid-pattern approach accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check("unknown approach type FAILS ('tritone-sub' is not in the typed set)", () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[0].pattern[3] = { approach: 'tritone-sub', beat: 4 }
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes("unknown approach 'tritone-sub'")), `unknown approach accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('beat range + ordering bite (beat 9 on a 2-bar step; decreasing beats)', () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[1].pattern[4] = { approach: 'fifth-of-next', beat: 9 } // 2 bars → beat < 9
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes('beat must be a number in [1, 9)')), `beat 9 on a 2-bar step accepted: ${errs.join('; ')}`)
|
||||||
|
const play2 = goodBassPlay()
|
||||||
|
play2.chords[0].pattern[2] = { deg: '5', beat: 1.5 } // after beat 2 — decreasing
|
||||||
|
const errs2 = checkBassPlay('fixture', play2, bassProg())
|
||||||
|
assert(errs2.some((e) => e.includes('beats must be non-decreasing')), `decreasing beats accepted: ${errs2.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('chords length ≠ progression length FAILS; missing feel FAILS; bad technique FAILS', () => {
|
||||||
|
const short = goodBassPlay(); short.chords = short.chords.slice(0, 1)
|
||||||
|
assert(checkBassPlay('fixture', short, bassProg()).some((e) => e.includes('chords length 1 ≠ progression length 2')),
|
||||||
|
'short chords array accepted')
|
||||||
|
const noFeel = goodBassPlay(); delete noFeel.feel
|
||||||
|
assert(checkBassPlay('fixture', noFeel, bassProg()).some((e) => e.includes('feel required')),
|
||||||
|
'missing feel accepted')
|
||||||
|
const badTech = goodBassPlay(); badTech.chords[0].pattern[2].technique = 'slap-pop'
|
||||||
|
assert(checkBassPlay('fixture', badTech, bassProg()).some((e) => e.includes("unknown technique 'slap-pop'")),
|
||||||
|
'off-vocabulary technique accepted')
|
||||||
|
})
|
||||||
|
|
||||||
|
check('density cap bites (> 8 notes per bar is not intermediate)', () => {
|
||||||
|
const play = goodBassPlay()
|
||||||
|
play.chords[0].pattern = Array.from({ length: 9 }, () => ({ deg: '1' }))
|
||||||
|
const errs = checkBassPlay('fixture', play, bassProg())
|
||||||
|
assert(errs.some((e) => e.includes('8ths density cap')), `9 notes in one bar accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Live-KB guard (future-proofs P-41): every bass pack play in the registry
|
||||||
|
// passes checkBassPlay. Zero bass cells today — the loop is a no-op until the
|
||||||
|
// first bass.js registers, then it gates it exactly like the validator does.
|
||||||
|
check('every KB bass pack play passes checkBassPlay', () => {
|
||||||
|
let bassPlays = 0
|
||||||
|
for (const styleName of styleNames) {
|
||||||
|
const pack = kb[styleName]?.instruments?.bass
|
||||||
|
if (!pack) continue
|
||||||
|
const progById = Object.fromEntries((kb[styleName].progressions ?? []).map((p) => [p.id, p]))
|
||||||
|
for (const [pid, plays] of Object.entries(pack.plays ?? {})) {
|
||||||
|
const prog = progById[pid]
|
||||||
|
assert(prog, `${styleName}/bass plays key '${pid}' is not a progression of this style`)
|
||||||
|
plays.forEach((play, pi) => {
|
||||||
|
bassPlays++
|
||||||
|
const errs = checkBassPlay(`${styleName}/bass ${pid} play[${pi}] "${play.label ?? '?'}"`, play, prog)
|
||||||
|
assert(errs.length === 0, errs.join('; '))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(` (${bassPlays} live bass plays checked)`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// ─── 5c. Piano lick schema (C-60) ─────────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// Same lib-mode pattern as §4/§5/§5b: exercise the exported checkPianoLick
|
||||||
|
// against in-memory fixtures — a realistic enclosure lick must pass, and each
|
||||||
|
// malformed variant must FAIL with the specific error — proving the piano-lick
|
||||||
|
// rules bite before any piano licks (P-60) are authored against them.
|
||||||
|
|
||||||
|
console.log('\nPiano lick schema (validate-kb lib mode):')
|
||||||
|
|
||||||
|
const { checkPianoLick, PIANO_LICK_TECHNIQUES, PIANO_LICK_APPROACHES, PIANO_LICK_MAX_OFFSET } = kbv
|
||||||
|
|
||||||
|
check('validate-kb exports checkPianoLick / PIANO_LICK_TECHNIQUES / PIANO_LICK_APPROACHES / PIANO_LICK_MAX_OFFSET(=25)', () => {
|
||||||
|
assert(typeof checkPianoLick === 'function', 'checkPianoLick is not a function')
|
||||||
|
assert(Array.isArray(PIANO_LICK_TECHNIQUES)
|
||||||
|
&& PIANO_LICK_TECHNIQUES.join(',') === 'slide,double-stop,ghost-note,grace-note',
|
||||||
|
`PIANO_LICK_TECHNIQUES must be exactly [slide, double-stop, ghost-note, grace-note], got ${JSON.stringify(PIANO_LICK_TECHNIQUES)}`)
|
||||||
|
assert(Array.isArray(PIANO_LICK_APPROACHES) && PIANO_LICK_APPROACHES.join(',') === 'chrom-below,chrom-above',
|
||||||
|
`PIANO_LICK_APPROACHES must be exactly [chrom-below, chrom-above] (no fifth-of-next — licks have no next station), got ${JSON.stringify(PIANO_LICK_APPROACHES)}`)
|
||||||
|
assert(PIANO_LICK_MAX_OFFSET === 25,
|
||||||
|
`PIANO_LICK_MAX_OFFSET must be 25 (root in the bottom octave: 11 + 25 = 36, MiniPiano's top key), got ${PIANO_LICK_MAX_OFFSET}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Vocabulary-family consistency: every piano word except the piano-specific
|
||||||
|
// 'grace-note' must also be a guitar lick word WITH THE SAME SPELLING — one
|
||||||
|
// vocabulary family, not a third counting scheme. (The guitar set-equality
|
||||||
|
// guard in §7b is untouched: LICK_TECHNIQUES itself did not change.)
|
||||||
|
check("piano vocab ⊂ guitar vocab + 'grace-note' (shared words, one spelling)", () => {
|
||||||
|
const guitar = new Set(LICK_TECHNIQUES)
|
||||||
|
const strays = PIANO_LICK_TECHNIQUES.filter((t) => t !== 'grace-note' && !guitar.has(t))
|
||||||
|
assert(strays.length === 0,
|
||||||
|
`piano technique word(s) [${strays}] are neither 'grace-note' nor in LICK_TECHNIQUES — shared words must keep the guitar spelling`)
|
||||||
|
assert(!guitar.has('grace-note'),
|
||||||
|
"guitar vocab now contains 'grace-note' — it was piano-specific; update SCHEMA + this guard deliberately")
|
||||||
|
})
|
||||||
|
|
||||||
|
// A realistic, fully-valid fixture: a bebop enclosure into the 3rd over min7.
|
||||||
|
// Offsets: '5'@1 → 19; approaches target '3'@1 → 15, deriving 16 and 14;
|
||||||
|
// final deg '3'@1 → 15. All in [0, 25]; beats non-decreasing.
|
||||||
|
const goodPianoLick = () => ({
|
||||||
|
id: 'jazz-enclosure-into-3',
|
||||||
|
name: 'Bebop enclosure into the 3rd',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the ii7',
|
||||||
|
quality: 'min7',
|
||||||
|
techniques: ['grace-note'],
|
||||||
|
source: 'Barry Harris workshop vocabulary',
|
||||||
|
notes: [
|
||||||
|
{ deg: '5', octave: 1, beat: 1 },
|
||||||
|
{ approach: 'chrom-above', beat: 2 },
|
||||||
|
{ approach: 'chrom-below', beat: 2.5 },
|
||||||
|
{ deg: '3', octave: 1, beat: 3, technique: 'grace-note' },
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
check('good enclosure fixture PASSES checkPianoLick (0 errors)', () => {
|
||||||
|
const errs = checkPianoLick('fixture', goodPianoLick(), 'jazz', new Set())
|
||||||
|
assert(errs.length === 0, `expected clean pass, got: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check("missing / unknown quality FAILS (degrees need a machine context, chordContext is prose)", () => {
|
||||||
|
const noQ = goodPianoLick(); delete noQ.quality
|
||||||
|
assert(checkPianoLick('fixture', noQ, 'jazz', new Set()).some((e) => e.includes('quality must be a CHORD_TYPES key')),
|
||||||
|
'missing quality accepted')
|
||||||
|
const badQ = goodPianoLick(); badQ.quality = 'minor7' // not a CHORD_TYPES key
|
||||||
|
assert(checkPianoLick('fixture', badQ, 'jazz', new Set()).some((e) => e.includes('quality must be a CHORD_TYPES key')),
|
||||||
|
"quality 'minor7' accepted")
|
||||||
|
})
|
||||||
|
|
||||||
|
check("unresolvable degree FAILS ('7' resolves on min7 but '2' never does)", () => {
|
||||||
|
const lick = goodPianoLick()
|
||||||
|
lick.notes[0] = { deg: '2', beat: 1 }
|
||||||
|
const errs = checkPianoLick('fixture', lick, 'jazz', new Set())
|
||||||
|
assert(errs.some((e) => e.includes("unresolvable degree '2'")), `deg '2' accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('terminal approach FAILS (targets the next deg — the final note must be a deg)', () => {
|
||||||
|
const lick = goodPianoLick()
|
||||||
|
lick.notes.push({ approach: 'chrom-below', beat: 4 })
|
||||||
|
const errs = checkPianoLick('fixture', lick, 'jazz', new Set())
|
||||||
|
assert(errs.some((e) => e.includes('approach cannot close a piano lick')), `terminal approach accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check('consecutive SAME-type approaches FAIL (identical derived pitch); the enclosure (alternating) passes', () => {
|
||||||
|
const lick = goodPianoLick()
|
||||||
|
lick.notes[2] = { approach: 'chrom-above', beat: 2.5 } // above, above
|
||||||
|
const errs = checkPianoLick('fixture', lick, 'jazz', new Set())
|
||||||
|
assert(errs.some((e) => e.includes('consecutive')), `same-type approach pair accepted: ${errs.join('; ')}`)
|
||||||
|
// and the alternating original stays clean (already asserted above, but the contrast is the point)
|
||||||
|
assert(checkPianoLick('fixture', goodPianoLick(), 'jazz', new Set()).length === 0, 'alternating enclosure rejected')
|
||||||
|
})
|
||||||
|
|
||||||
|
check('chrom-below of a root-position target FAILS (derives −1, below the window)', () => {
|
||||||
|
const lick = goodPianoLick()
|
||||||
|
lick.notes = [{ approach: 'chrom-below', beat: 1 }, { deg: '1', beat: 2 }]
|
||||||
|
const errs = checkPianoLick('fixture', lick, 'jazz', new Set())
|
||||||
|
assert(errs.some((e) => e.includes('derives −1')), `sub-window approach accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
check("range cap bites both ways: deg '5' octave 2 (=31) and chrom-above of a 25-offset target (=26) FAIL", () => {
|
||||||
|
const lick = goodPianoLick()
|
||||||
|
lick.notes[0] = { deg: '5', octave: 2, beat: 1 } // 7 + 24 = 31 > 25
|
||||||
|
const errs = checkPianoLick('fixture', lick, 'jazz', new Set())
|
||||||
|
assert(errs.some((e) => e.includes(`max ${PIANO_LICK_MAX_OFFSET}`)), `31-semitone deg accepted: ${errs.join('; ')}`)
|
||||||
|
const lick2 = goodPianoLick() // b9 @ octave 2 = 25 (legal boundary); chrom-above derives 26
|
||||||
|
lick2.quality = 'dom7'
|
||||||
|
lick2.notes = [{ approach: 'chrom-above', beat: 1 }, { deg: 'b9', octave: 2, beat: 2 }]
|
||||||
|
const errs2 = checkPianoLick('fixture', lick2, 'jazz', new Set())
|
||||||
|
assert(errs2.some((e) => e.includes('derived pitch sits 26')), `26-semitone derived approach accepted: ${errs2.join('; ')}`)
|
||||||
|
const lick3 = goodPianoLick() // the 25 boundary itself is legal: high root via octave 2 + b9… use deg '1' octave 2 = 24 and chrom-above = 25
|
||||||
|
lick3.notes = [{ approach: 'chrom-above', beat: 1 }, { deg: '1', octave: 2, beat: 2 }]
|
||||||
|
assert(checkPianoLick('fixture', lick3, 'jazz', new Set()).length === 0,
|
||||||
|
'the 25-semitone boundary (chrom-above of the double-octave root) was rejected — cap off by one')
|
||||||
|
})
|
||||||
|
|
||||||
|
check('bad octave values FAIL (3 and non-integers rejected; approaches take no octave)', () => {
|
||||||
|
const lick = goodPianoLick()
|
||||||
|
lick.notes[0] = { deg: '5', octave: 3, beat: 1 }
|
||||||
|
assert(checkPianoLick('fixture', lick, 'jazz', new Set()).some((e) => e.includes('octave, when present, must be 0, 1 or 2')),
|
||||||
|
'octave 3 accepted')
|
||||||
|
const lick2 = goodPianoLick()
|
||||||
|
lick2.notes[1] = { approach: 'chrom-above', octave: 1, beat: 2 }
|
||||||
|
assert(checkPianoLick('fixture', lick2, 'jazz', new Set()).some((e) => e.includes('octave applies to deg notes only')),
|
||||||
|
'octave on an approach accepted')
|
||||||
|
})
|
||||||
|
|
||||||
|
check("guitar-only technique words FAIL on piano ('bend' in summary; 'vibrato' per-note; summary honesty)", () => {
|
||||||
|
const lick = goodPianoLick()
|
||||||
|
lick.techniques = ['grace-note', 'bend']
|
||||||
|
assert(checkPianoLick('fixture', lick, 'jazz', new Set()).some((e) => e.includes("unknown piano technique 'bend'")),
|
||||||
|
"'bend' accepted on keys")
|
||||||
|
const lick2 = goodPianoLick()
|
||||||
|
lick2.notes[3].technique = 'vibrato'
|
||||||
|
assert(checkPianoLick('fixture', lick2, 'jazz', new Set()).some((e) => e.includes("unknown piano technique 'vibrato'")),
|
||||||
|
"'vibrato' accepted on keys")
|
||||||
|
const lick3 = goodPianoLick()
|
||||||
|
lick3.notes[3].technique = 'slide' // valid word, but not in techniques: [grace-note]
|
||||||
|
assert(checkPianoLick('fixture', lick3, 'jazz', new Set()).some((e) => e.includes("must also appear in the lick's techniques[]")),
|
||||||
|
'summary honesty not enforced')
|
||||||
|
})
|
||||||
|
|
||||||
|
check('beat range + ordering bite (beat 9; decreasing beats); density cap bites (17 notes)', () => {
|
||||||
|
const lick = goodPianoLick()
|
||||||
|
lick.notes[3].beat = 9
|
||||||
|
assert(checkPianoLick('fixture', lick, 'jazz', new Set()).some((e) => e.includes('beat must be a number in [1, 9)')),
|
||||||
|
'beat 9 accepted')
|
||||||
|
const lick2 = goodPianoLick()
|
||||||
|
lick2.notes[3].beat = 2.25 // after 2.5 — decreasing
|
||||||
|
assert(checkPianoLick('fixture', lick2, 'jazz', new Set()).some((e) => e.includes('beats must be non-decreasing')),
|
||||||
|
'decreasing beats accepted')
|
||||||
|
const lick3 = goodPianoLick()
|
||||||
|
lick3.notes = Array.from({ length: 17 }, () => ({ deg: '1' }))
|
||||||
|
assert(checkPianoLick('fixture', lick3, 'jazz', new Set()).some((e) => e.includes('17 notes > 16')),
|
||||||
|
'17-note lick accepted')
|
||||||
|
})
|
||||||
|
|
||||||
|
check('duplicate id FAILS (shared namespace with progressions and guitar licks)', () => {
|
||||||
|
const ids = new Set()
|
||||||
|
assert(checkPianoLick('fixture', goodPianoLick(), 'jazz', ids).length === 0, 'first insert should pass')
|
||||||
|
const errs = checkPianoLick('fixture', goodPianoLick(), 'jazz', ids)
|
||||||
|
assert(errs.some((e) => e.includes('duplicate id')), `duplicate id accepted: ${errs.join('; ')}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// (The PianoLickCard vocab drift guard lives in §7b-piano below — it needs the
|
||||||
|
// jsx load hook, which is registered in §7.)
|
||||||
|
|
||||||
|
// ─── 6. Loop-detection truth fixtures (C-30) ──────────────────────────────────
|
||||||
|
//
|
||||||
|
// Run every scripts/loop-fixtures.mjs case against the REAL
|
||||||
|
// detectRepeatingProgression. Comparison is rotation-canonical on BOTH sides
|
||||||
|
// (the fixture module replicates theory.js's private `canonicalize`), so a
|
||||||
|
// correct loop reported from any rotation passes. Semantics:
|
||||||
|
// · no expectedFail + mismatch → ✗ smoke failure (regression in what works)
|
||||||
|
// · expectedFail + mismatch → ⚠ annotated expected-fail (printed, counted,
|
||||||
|
// NOT a failure — this is L-30's todo list)
|
||||||
|
// · expectedFail + MATCH → ✗ smoke failure: stale marker — the fixture
|
||||||
|
// now passes, L-30 must flip expectedFail off
|
||||||
|
//
|
||||||
|
// The failure map of the current algorithm lives in the fixture file header.
|
||||||
|
|
||||||
|
console.log('\nLoop-detection fixtures (C-30):')
|
||||||
|
|
||||||
|
const { LOOP_FIXTURES, canonicalLoop } = await load('scripts/loop-fixtures.mjs')
|
||||||
|
let expectedFails = 0
|
||||||
|
|
||||||
|
check('loop-fixtures module exports a non-empty fixture array + canonicalLoop', () => {
|
||||||
|
assert(Array.isArray(LOOP_FIXTURES) && LOOP_FIXTURES.length > 0, 'LOOP_FIXTURES missing/empty')
|
||||||
|
assert(typeof canonicalLoop === 'function', 'canonicalLoop is not a function')
|
||||||
|
const ids = new Set(LOOP_FIXTURES.map((f) => f.id))
|
||||||
|
assert(ids.size === LOOP_FIXTURES.length, 'duplicate fixture ids')
|
||||||
|
// canonicalLoop must be rotation-invariant (replica sanity: all rotations of a
|
||||||
|
// loop normalise to the same key — the property the comparisons rely on).
|
||||||
|
const key = canonicalLoop(['C', 'Am', 'F']).join(',')
|
||||||
|
assert(canonicalLoop(['Am', 'F', 'C']).join(',') === key && canonicalLoop(['F', 'C', 'Am']).join(',') === key,
|
||||||
|
'canonicalLoop is not rotation-invariant')
|
||||||
|
})
|
||||||
|
|
||||||
|
const loopKey = (loop) => (loop === null ? 'null' : canonicalLoop(loop).join(','))
|
||||||
|
|
||||||
|
for (const f of LOOP_FIXTURES ?? []) {
|
||||||
|
const got = detectRepeatingProgression(f.history)
|
||||||
|
const gotKey = loopKey(Array.isArray(got) ? got : null)
|
||||||
|
const wantKey = loopKey(f.expect)
|
||||||
|
const matches = gotKey === wantKey
|
||||||
|
const label = `loop fixture '${f.id}' — ${f.description}`
|
||||||
|
|
||||||
|
if (!f.expectedFail) {
|
||||||
|
check(label, () => {
|
||||||
|
assert(matches, `got [${gotKey}], expected [${wantKey}]`)
|
||||||
|
})
|
||||||
|
} else if (!matches) {
|
||||||
|
// Documented current-algorithm failure — annotated, never silently skipped.
|
||||||
|
expectedFails++
|
||||||
|
console.log(` ⚠ EXPECTED-FAIL ${label}\n today: [${gotKey}] · contract (L-30): [${wantKey}]`)
|
||||||
|
} else {
|
||||||
|
// The algorithm now satisfies this contract — the marker is stale and MUST
|
||||||
|
// be removed (L-30's DoD is zero expectedFail markers). Fail loudly.
|
||||||
|
check(`${label} [STALE expectedFail marker]`, () => {
|
||||||
|
assert(false, `fixture PASSES (got [${gotKey}]) but is still marked expectedFail — remove the marker in scripts/loop-fixtures.mjs`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expectedFails) {
|
||||||
|
console.log(` (${expectedFails} annotated expected-fail(s) — the current detectRepeatingProgression's known gaps, awaiting L-30)`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── 7. Hand-sync drift guards (C-40) ─────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// Two pieces of logic/data are deliberately duplicated by hand across files
|
||||||
|
// (src/ must not import from scripts/, so validator ↔ component pairs can't
|
||||||
|
// share a module). These guards turn silent drift into a red smoke run.
|
||||||
|
//
|
||||||
|
// (a) resolveDegree — scripts/validate-kb.mjs holds the KB contract's reference
|
||||||
|
// implementation; src/components/JamGuide.jsx carries a hand-synced copy
|
||||||
|
// (its header says "keep the two in sync by hand"). If they drift, authored
|
||||||
|
// piano recipes validate against one rule and RENDER with another — wrong
|
||||||
|
// pitches, no error. Guard: a LITERAL 16-degree × 14-quality truth table
|
||||||
|
// (pinned values, NOT derived from CHORD_TYPES at runtime — deriving would
|
||||||
|
// let the expectation co-move with the very code under test) asserted
|
||||||
|
// against BOTH implementations for every pair.
|
||||||
|
// · The validator's resolveDegree is unexported; it is probed BEHAVIOURALLY
|
||||||
|
// through the exported checkPianoRecipe: recipe LH ['1','1','1', deg]
|
||||||
|
// stacks 0 → 12 → 24 → 24 + offset (a repeated pc climbs an octave —
|
||||||
|
// stackHand's documented convention), so the span error always fires
|
||||||
|
// (span 25–36 > MAX_HAND_SPAN 15) and REPORTS the span, from which the
|
||||||
|
// offset is recovered exactly: offset = span − 24 (36 → 0). An
|
||||||
|
// unresolvable degree instead yields the 'unresolvable degree' error.
|
||||||
|
// · JamGuide.jsx's copy IS directly comparable (since 2026-07-10):
|
||||||
|
// L-40's ride-along exported `resolveDegree` (the C-40 follow-up), so
|
||||||
|
// this section imports the real component module under the jsx load
|
||||||
|
// hook below and sweeps the copy against the same pinned table, cell
|
||||||
|
// for cell. A '.jsx'-retry resolve hook (registered next to the load
|
||||||
|
// hook) lets JamGuide's extensionless component imports
|
||||||
|
// ('./GlanceRail', './BassPatternCard'…) resolve under raw Node ESM —
|
||||||
|
// the top-of-file hook only retries '.js'.
|
||||||
|
//
|
||||||
|
// (b) Technique vocabulary — validate-kb.mjs LICK_TECHNIQUES (the schema gate)
|
||||||
|
// vs LickCard.jsx TECHNIQUE_VOCAB (the renderer's glyph vocabulary). A word
|
||||||
|
// added to one but not the other means licks that validate but render with
|
||||||
|
// no glyph, or dead glyph code. Guard: import BOTH and assert set-equality.
|
||||||
|
// LickCard.jsx is JSX, so a node:module load hook transpiles .jsx on the
|
||||||
|
// fly via esbuild (already in node_modules as Vite's transpiler).
|
||||||
|
|
||||||
|
console.log('\nHand-sync drift guards (C-40):')
|
||||||
|
|
||||||
|
// -- jsx load hook: lets Node import component files (esbuild transform) -------
|
||||||
|
register(
|
||||||
|
'data:text/javascript,' +
|
||||||
|
encodeURIComponent(`
|
||||||
|
import { readFileSync } from 'node:fs'
|
||||||
|
const esbuildP = import(${JSON.stringify(import.meta.resolve('esbuild'))})
|
||||||
|
export async function load(url, context, next) {
|
||||||
|
if (url.endsWith('.jsx')) {
|
||||||
|
const { transform } = await esbuildP
|
||||||
|
const src = readFileSync(new URL(url), 'utf8')
|
||||||
|
const { code } = await transform(src, { loader: 'jsx', jsx: 'automatic', jsxImportSource: 'react' })
|
||||||
|
return { format: 'module', source: code, shortCircuit: true }
|
||||||
|
}
|
||||||
|
return next(url, context)
|
||||||
|
}
|
||||||
|
`),
|
||||||
|
import.meta.url,
|
||||||
|
)
|
||||||
|
|
||||||
|
// -- '.jsx' resolve retry: component files import siblings extensionless -------
|
||||||
|
// (e.g. JamGuide.jsx does `import GlanceRail from './GlanceRail'`; the top-of-
|
||||||
|
// file hook retries '.js' only). Registered last so it runs FIRST and catches
|
||||||
|
// the whole chain's failure, then retries with '.jsx' appended.
|
||||||
|
register(
|
||||||
|
'data:text/javascript,' +
|
||||||
|
encodeURIComponent(`
|
||||||
|
export async function resolve(specifier, context, next) {
|
||||||
|
try {
|
||||||
|
return await next(specifier, context)
|
||||||
|
} catch (e) {
|
||||||
|
if (/^\\.{1,2}\\//.test(specifier) && !/\\.([mc]?js|jsx)$/.test(specifier)) {
|
||||||
|
try { return await next(specifier + '.jsx', context) } catch { throw e }
|
||||||
|
}
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`),
|
||||||
|
import.meta.url,
|
||||||
|
)
|
||||||
|
|
||||||
|
// -- (a) resolveDegree truth table ---------------------------------------------
|
||||||
|
|
||||||
|
// Quality order for the per-quality rows below (must stay CHORD_TYPES' keys —
|
||||||
|
// a new chord quality MUST extend this table, and the check enforces that).
|
||||||
|
const Q14 = ['maj', 'min', 'dom7', 'maj7', 'min7', 'dim', 'dim7', 'half_dim', 'aug', 'sus4', 'sus2', 'maj6', 'min6', 'add9']
|
||||||
|
|
||||||
|
// resolveDegree(deg, quality) → pitch-class offset from the chord root.
|
||||||
|
// Scalar = same for all 14 qualities (the fixed-offset degrees); array = one
|
||||||
|
// value per Q14 entry ('3'/'5'/'7' resolve through the quality's intervals).
|
||||||
|
// '2' is the canary row: not a legal degree, must stay null everywhere.
|
||||||
|
const DEGREE_TABLE = {
|
||||||
|
'1': 0,
|
||||||
|
'b9': 1,
|
||||||
|
'9': 2,
|
||||||
|
'#9': 3,
|
||||||
|
'11': 5,
|
||||||
|
'#11': 6,
|
||||||
|
'b5': 6,
|
||||||
|
'b13': 8,
|
||||||
|
'13': 9,
|
||||||
|
'6': 9,
|
||||||
|
'b3': 3,
|
||||||
|
'b7': 10,
|
||||||
|
// maj min dom7 maj7 min7 dim dim7 ø aug sus4 sus2 maj6 min6 add9
|
||||||
|
'3': [ 4, 3, 4, 4, 3, 3, 3, 3, 4, 5, 2, 4, 3, 4 ],
|
||||||
|
'5': [ 7, 7, 7, 7, 7, 6, 6, 6, 8, 7, 7, 7, 7, 7 ],
|
||||||
|
'7': [ null, null, 10, 11, 10, null, 9, 10, null, null, null, 9, 9, null],
|
||||||
|
'2': null,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Behavioural probe of the validator's unexported resolveDegree (see header).
|
||||||
|
function probeValidatorResolveDegree(deg, quality) {
|
||||||
|
const errs = checkPianoRecipe('probe', { recipe: { LH: ['1', '1', '1', deg] } }, quality)
|
||||||
|
if (errs.some((e) => e.includes(`unresolvable degree '${deg}'`))) return null
|
||||||
|
const m = errs.map((e) => /spans (\d+) semitones/.exec(e)).find(Boolean)
|
||||||
|
if (!m) throw new Error(`probe(${deg}, ${quality}) got neither an 'unresolvable degree' nor a span error — checkPianoRecipe/stackHand changed shape; re-derive the probe. Errors: ${JSON.stringify(errs)}`)
|
||||||
|
const offset = Number(m[1]) - 24
|
||||||
|
return offset === 12 ? 0 : offset // '1'-repeat lands an octave up: span 36 ⇒ offset 0
|
||||||
|
}
|
||||||
|
|
||||||
|
check('truth table covers 16 degrees × all 14 CHORD_TYPES qualities', () => {
|
||||||
|
const degs = Object.keys(DEGREE_TABLE)
|
||||||
|
assert(degs.length === 16, `expected 16 degrees, table has ${degs.length}`)
|
||||||
|
assert(Q14.join(',') === QUALITIES.join(','),
|
||||||
|
`Q14 ≠ CHORD_TYPES keys — a quality was added/renamed; extend DEGREE_TABLE. Q14: ${Q14} · CHORD_TYPES: ${QUALITIES}`)
|
||||||
|
for (const [deg, row] of Object.entries(DEGREE_TABLE))
|
||||||
|
if (Array.isArray(row)) assert(row.length === 14, `row '${deg}' has ${row.length} entries, expected 14`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// JamGuide's hand-synced copy, imported directly (exported by the L-40
|
||||||
|
// ride-along; transpiled by the jsx load hook above).
|
||||||
|
const jamGuideMod = await load('src/components/JamGuide.jsx')
|
||||||
|
|
||||||
|
check('JamGuide.jsx exports resolveDegree (L-40 ride-along) so the drift guard can sweep it directly', () => {
|
||||||
|
assert(typeof jamGuideMod.resolveDegree === 'function',
|
||||||
|
`resolveDegree is ${typeof jamGuideMod.resolveDegree}, expected an exported function — the export at JamGuide.jsx (see its header) was removed; the drift guard lost its direct probe`)
|
||||||
|
})
|
||||||
|
|
||||||
|
for (const [deg, row] of Object.entries(DEGREE_TABLE)) {
|
||||||
|
check(`validator resolveDegree('${deg}') matches the pinned table for all 14 qualities`, () => {
|
||||||
|
Q14.forEach((quality, qi) => {
|
||||||
|
const want = Array.isArray(row) ? row[qi] : row
|
||||||
|
const got = probeValidatorResolveDegree(deg, quality)
|
||||||
|
assert(got === want,
|
||||||
|
`resolveDegree('${deg}', '${quality}') drifted: validator says ${got}, pinned table says ${want} — re-sync scripts/validate-kb.mjs ↔ src/components/JamGuide.jsx (hand-synced pair) or fix the table if the contract legitimately changed`)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
check(`JamGuide resolveDegree('${deg}') matches the pinned table for all 14 qualities`, () => {
|
||||||
|
Q14.forEach((quality, qi) => {
|
||||||
|
const want = Array.isArray(row) ? row[qi] : row
|
||||||
|
const got = jamGuideMod.resolveDegree(String(deg), quality) ?? null
|
||||||
|
assert(got === want,
|
||||||
|
`resolveDegree('${deg}', '${quality}') drifted: JamGuide.jsx says ${got}, pinned table says ${want} — re-sync src/components/JamGuide.jsx ↔ scripts/validate-kb.mjs (hand-synced pair) or fix the table if the contract legitimately changed`)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// -- (b) technique vocab set-equality -------------------------------------------
|
||||||
|
|
||||||
|
const lickCardMod = await load('src/components/LickCard.jsx')
|
||||||
|
|
||||||
|
check('LickCard.jsx imports under the jsx hook and exports TECHNIQUE_VOCAB', () => {
|
||||||
|
assert(Array.isArray(lickCardMod.TECHNIQUE_VOCAB), 'TECHNIQUE_VOCAB is not an exported array')
|
||||||
|
assert(lickCardMod.TECHNIQUE_VOCAB.length > 0, 'TECHNIQUE_VOCAB is empty')
|
||||||
|
})
|
||||||
|
|
||||||
|
check('TECHNIQUE_VOCAB (LickCard.jsx) ≡ LICK_TECHNIQUES (validate-kb.mjs) as sets', () => {
|
||||||
|
const vocab = new Set(lickCardMod.TECHNIQUE_VOCAB ?? [])
|
||||||
|
const schema = new Set(LICK_TECHNIQUES)
|
||||||
|
const missingInCard = [...schema].filter((t) => !vocab.has(t))
|
||||||
|
const missingInSchema = [...vocab].filter((t) => !schema.has(t))
|
||||||
|
assert(missingInCard.length === 0 && missingInSchema.length === 0,
|
||||||
|
`technique vocab drift — in validator but not LickCard: [${missingInCard}] · in LickCard but not validator: [${missingInSchema}] — the two lists are hand-synced; add the word to BOTH or neither`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// -- (b-piano) piano technique vocab set-equality (C-60 forward guard) ----------
|
||||||
|
// Once D-60's PianoLickCard.jsx lands, its exported PIANO_TECHNIQUE_VOCAB must
|
||||||
|
// be set-equal to the validator's PIANO_LICK_TECHNIQUES — the same hand-sync
|
||||||
|
// rule as LickCard. Conditional so smoke stays green until the component
|
||||||
|
// exists, then bites automatically (D-60's DoD includes making this pass).
|
||||||
|
if (existsSync(join(ROOT, 'src/components/PianoLickCard.jsx'))) {
|
||||||
|
const pianoCardMod = await load('src/components/PianoLickCard.jsx')
|
||||||
|
check('PIANO_TECHNIQUE_VOCAB (PianoLickCard.jsx) ≡ PIANO_LICK_TECHNIQUES (validate-kb.mjs) as sets', () => {
|
||||||
|
const vocab = new Set(pianoCardMod.PIANO_TECHNIQUE_VOCAB ?? [])
|
||||||
|
const schema = new Set(PIANO_LICK_TECHNIQUES)
|
||||||
|
const missingInCard = [...schema].filter((t) => !vocab.has(t))
|
||||||
|
const missingInSchema = [...vocab].filter((t) => !schema.has(t))
|
||||||
|
assert(missingInCard.length === 0 && missingInSchema.length === 0,
|
||||||
|
`piano technique vocab drift — in validator but not PianoLickCard: [${missingInCard}] · in PianoLickCard but not validator: [${missingInSchema}] — hand-synced; add the word to BOTH or neither`)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
warn('PianoLickCard vocab drift guard', 'src/components/PianoLickCard.jsx not yet authored (D-60)')
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── 8. Summary + exit code ───────────────────────────────────────────────────
|
||||||
|
|
||||||
const total = passed + failures.length
|
const total = passed + failures.length
|
||||||
console.log('')
|
console.log('')
|
||||||
@@ -236,5 +1202,6 @@ if (failures.length) {
|
|||||||
for (const f of failures) console.error(' ' + f)
|
for (const f of failures) console.error(' ' + f)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
console.log(`✓ Smoke test passed — ${passed}/${total} checks green (${styleNames.length} styles, ${allIds.size} progressions)`)
|
console.log(`✓ Smoke test passed — ${passed}/${total} checks green (${styleNames.length} styles, ${allIds.size} progressions)`
|
||||||
|
+ (expectedFails ? ` · ${expectedFails} annotated loop-fixture expected-fail(s) awaiting L-30` : ''))
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
|
|||||||
+343
-21
@@ -1,5 +1,13 @@
|
|||||||
// KB quality gate — validates src/data/kb/ against the contract in src/data/kb/SCHEMA.md.
|
// KB quality gate — validates src/data/kb/ against the contract in src/data/kb/SCHEMA.md.
|
||||||
// Run: node scripts/validate-kb.mjs (exit 1 on any error)
|
// Run: node scripts/validate-kb.mjs (exit 1 on any error)
|
||||||
|
//
|
||||||
|
// Lib mode: scripts/smoke.mjs imports this file with KB_VALIDATE_AS_LIB=1 set to
|
||||||
|
// reuse the exported pure checks (checkLick, checkPianoRecipe, checkBassPlay,
|
||||||
|
// checkPianoLick, LEVELS, LICK_TECHNIQUES, PIANO_LICK_TECHNIQUES,
|
||||||
|
// PIANO_LICK_APPROACHES, PIANO_LICK_MAX_OFFSET, MAX_HAND_SPAN, MIN_PLAYS_BASS,
|
||||||
|
// BASS_APPROACHES, BASS_MAX_OFFSET) against in-memory fixtures — same logic,
|
||||||
|
// no copy. When the env var is absent the script runs the full KB validation
|
||||||
|
// as before.
|
||||||
import { readdirSync, existsSync } from 'node:fs'
|
import { readdirSync, existsSync } from 'node:fs'
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url'
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
||||||
import { dirname, join } from 'node:path'
|
import { dirname, join } from 'node:path'
|
||||||
@@ -11,11 +19,23 @@ const KB = join(ROOT, 'src', 'data', 'kb')
|
|||||||
const MODES = ['major', 'minor', 'dorian', 'phrygian', 'lydian', 'mixolydian']
|
const MODES = ['major', 'minor', 'dorian', 'phrygian', 'lydian', 'mixolydian']
|
||||||
const OPEN_PC = [4, 9, 2, 7, 11, 4] // EADGBe low-E first
|
const OPEN_PC = [4, 9, 2, 7, 11, 4] // EADGBe low-E first
|
||||||
const PERFECT_FIFTH = 7
|
const PERFECT_FIFTH = 7
|
||||||
const BASS_TOKENS = ['R', 'b3', '3', '5', '6', 'b7', '7', '9', 'O', 'chrom>', 'chrom<', '5>', 'x', '-']
|
|
||||||
const MIN_PROGRESSIONS = 4
|
const MIN_PROGRESSIONS = 4
|
||||||
const MIN_PLAYS = 2
|
const MIN_PLAYS = 2
|
||||||
|
// Bass floor is 1, not 2 (SCHEMA.md "Bass play"): the band wants one bassline
|
||||||
|
// at a time, and rule 4's "idiomatically different" bar invites filler at 2.
|
||||||
|
export const MIN_PLAYS_BASS = 1
|
||||||
const MAX_SPAN = 4
|
const MAX_SPAN = 4
|
||||||
|
|
||||||
|
// Optional progression/lick difficulty tags (SCHEMA.md — absent = 'foundation').
|
||||||
|
export const LEVELS = ['foundation', 'intermediate']
|
||||||
|
// Fixed technique vocabulary for licks — both the techniques[] summary and each
|
||||||
|
// tab note's optional technique must come from this list (SCHEMA.md).
|
||||||
|
export const LICK_TECHNIQUES = [
|
||||||
|
'hammer-on', 'pull-off', 'slide', 'bend',
|
||||||
|
'double-stop', 'ghost-note', 'chromatic-approach', 'vibrato',
|
||||||
|
]
|
||||||
|
const LICK_MAX_FRET = 15
|
||||||
|
|
||||||
const errors = []
|
const errors = []
|
||||||
const err = (where, msg) => errors.push(`${where}: ${msg}`)
|
const err = (where, msg) => errors.push(`${where}: ${msg}`)
|
||||||
|
|
||||||
@@ -80,35 +100,309 @@ function checkGuitarShape(where, chordStep, quality) {
|
|||||||
if (!sounded.has(pc)) return err(where, `defining tone pc ${pc} of ${quality} missing from shape`)
|
if (!sounded.has(pc)) return err(where, `defining tone pc ${pc} of ${quality} missing from shape`)
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkPianoRecipe(where, chordStep, quality) {
|
// Piano hand-span rule (SCHEMA.md rule 3: "one hand per recipe stays within a
|
||||||
|
// 10th"). Enforced as ≤ 15 semitones — a minor 10th, the widest reading of
|
||||||
|
// "a 10th" — so the hand-verified 14-semitone ø11 rootless voicing in
|
||||||
|
// jazz/piano.js (P-22) stays legal while anything wider fails. Task C-22.
|
||||||
|
export const MAX_HAND_SPAN = 15
|
||||||
|
|
||||||
|
// Resolve one hand's degree list to stacked absolute semitone offsets per the
|
||||||
|
// documented convention (src/data/kb/jazz/piano.js header, ~line 14): order
|
||||||
|
// inside a hand = voicing order low→high, each note placed in the nearest
|
||||||
|
// position strictly above the previous (a repeated pitch class = octave up).
|
||||||
|
// Returns null if any degree is unresolvable (reported separately by caller).
|
||||||
|
function stackHand(degs, quality) {
|
||||||
|
const notes = []
|
||||||
|
for (const d of degs) {
|
||||||
|
const pc = resolveDegree(d, quality)
|
||||||
|
if (pc === null) return null
|
||||||
|
if (!notes.length) { notes.push(pc); continue }
|
||||||
|
const prev = notes[notes.length - 1]
|
||||||
|
const step = (pc - (prev % 12) + 12) % 12
|
||||||
|
notes.push(prev + (step === 0 ? 12 : step))
|
||||||
|
}
|
||||||
|
return notes
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pure piano-recipe validation. Returns an array of where-prefixed error
|
||||||
|
// strings (empty = valid). Exported for reuse by scripts/smoke.mjs (lib mode).
|
||||||
|
export function checkPianoRecipe(where, chordStep, quality) {
|
||||||
|
const out = []
|
||||||
|
const e = (msg) => out.push(`${where}: ${msg}`)
|
||||||
|
if (!CHORD_TYPES[quality]) { e(`unknown quality '${quality}'`); return out }
|
||||||
const { recipe } = chordStep
|
const { recipe } = chordStep
|
||||||
if (!recipe) return err(where, 'missing recipe')
|
if (!recipe) { e('missing recipe'); return out }
|
||||||
for (const hand of ['LH', 'RH']) {
|
for (const hand of ['LH', 'RH']) {
|
||||||
const degs = recipe[hand]
|
const degs = recipe[hand]
|
||||||
if (degs === undefined) continue
|
if (degs === undefined) continue
|
||||||
if (!Array.isArray(degs) || !degs.length) return err(where, `${hand} must be a non-empty array`)
|
if (!Array.isArray(degs) || !degs.length) { e(`${hand} must be a non-empty array`); continue }
|
||||||
if (degs.length > 5) return err(where, `${hand} has ${degs.length} notes — one hand, max 5`)
|
if (degs.length > 5) e(`${hand} has ${degs.length} notes — one hand, max 5`)
|
||||||
for (const d of degs)
|
for (const d of degs)
|
||||||
if (resolveDegree(d, quality) === null) err(where, `unresolvable degree '${d}' for ${quality}`)
|
if (resolveDegree(d, quality) === null) e(`unresolvable degree '${d}' for ${quality}`)
|
||||||
|
const stacked = stackHand(degs, quality)
|
||||||
|
if (stacked === null) continue // unresolvable degree already reported
|
||||||
|
const span = stacked[stacked.length - 1] - stacked[0]
|
||||||
|
if (span > MAX_HAND_SPAN)
|
||||||
|
e(`${hand} [${degs.join(' ')}] spans ${span} semitones stacked low→high — max ${MAX_HAND_SPAN} (a minor 10th; SCHEMA rule 3, one hand within a 10th)`)
|
||||||
}
|
}
|
||||||
if (recipe.LH === undefined && recipe.RH === undefined) err(where, 'recipe needs LH and/or RH')
|
if (recipe.LH === undefined && recipe.RH === undefined) e('recipe needs LH and/or RH')
|
||||||
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkBassPlay(where, play, prog) {
|
// ── Bass plays (SCHEMA.md "Bass play") ────────────────────────────────────────
|
||||||
const totalBars = prog.bars.reduce((a, b) => a + b, 0)
|
// Degree-based per-station patterns: one chords[] entry per progression step,
|
||||||
if (!Array.isArray(play.bars) || play.bars.length !== totalBars)
|
// each a non-empty ORDERED pattern of {deg,…} chord/color tones (resolved
|
||||||
return err(where, `bars length ${play.bars?.length} ≠ progression total ${totalBars}`)
|
// through the step's quality — a degree can't misspell a pitch class) and
|
||||||
play.bars.forEach((bar, i) => {
|
// typed {approach,…} notes whose pitch is DERIVED from the next station's
|
||||||
if (!Array.isArray(bar.beats) || !bar.beats.length) return err(`${where} bar ${i}`, 'missing beats')
|
// root, so the validator can allow the non-chord tone without blessing
|
||||||
for (const b of bar.beats)
|
// arbitrary chromatics. Data never encodes strings/frets (key-agnostic,
|
||||||
if (!BASS_TOKENS.includes(b)) err(`${where} bar ${i}`, `unknown beat token '${b}'`)
|
// hard rule 1); the renderer places patterns on E–A–D–G, frets 0–15.
|
||||||
|
export const BASS_APPROACHES = ['chrom-below', 'chrom-above', 'fifth-of-next']
|
||||||
|
// Widest legal offset above the root: an octave + a fifth keeps every pattern
|
||||||
|
// placeable on E–A–D–G within frets 0–15 in one position.
|
||||||
|
export const BASS_MAX_OFFSET = 19
|
||||||
|
const BASS_BEATS_PER_BAR = 4 // patterns are notated in 4 — 12/8 is `feel`
|
||||||
|
const BASS_MAX_NOTES_PER_BAR = 8 // straight-8ths density cap (rule 3)
|
||||||
|
|
||||||
|
// Pure bass-play validation. Returns an array of where-prefixed error strings
|
||||||
|
// (empty = valid). Exported for reuse by scripts/smoke.mjs (lib mode).
|
||||||
|
export function checkBassPlay(where, play, prog) {
|
||||||
|
const out = []
|
||||||
|
const e = (msg) => out.push(`${where}: ${msg}`)
|
||||||
|
if (typeof play.feel !== 'string' || !play.feel)
|
||||||
|
e("feel required — the groove in one line (e.g. 'swung 8ths, locked with the kick')")
|
||||||
|
if (play.level !== undefined && !LEVELS.includes(play.level))
|
||||||
|
e(`level must be one of ${LEVELS.join(' | ')}, got '${play.level}'`)
|
||||||
|
if (!Array.isArray(play.chords) || play.chords.length !== prog.degrees.length) {
|
||||||
|
e(`chords length ${play.chords?.length} ≠ progression length ${prog.degrees.length}`)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
play.chords.forEach((step, ci) => {
|
||||||
|
const cw = `chord[${ci}] (${prog.rn?.[ci] ?? ci})`
|
||||||
|
const quality = prog.qualities[ci]
|
||||||
|
if (!CHORD_TYPES[quality]) return e(`${cw}: unknown quality '${quality}'`)
|
||||||
|
const bars = prog.bars?.[ci] ?? 1
|
||||||
|
const pat = step?.pattern
|
||||||
|
if (!Array.isArray(pat) || !pat.length)
|
||||||
|
return e(`${cw}: pattern must be a non-empty ordered array of notes`)
|
||||||
|
if (pat.length > BASS_MAX_NOTES_PER_BAR * bars)
|
||||||
|
e(`${cw}: ${pat.length} notes > ${BASS_MAX_NOTES_PER_BAR * bars} (8ths density cap over ${bars} bar(s)) — not intermediate-friendly`)
|
||||||
|
let approachSeen = false
|
||||||
|
let rootSeen = false
|
||||||
|
let lastBeat = -Infinity
|
||||||
|
pat.forEach((n, ni) => {
|
||||||
|
const nw = `${cw} pattern[${ni}]`
|
||||||
|
if (!n || typeof n !== 'object') return e(`${nw}: note must be an object ({deg,…} or {approach,…})`)
|
||||||
|
const isDeg = n.deg !== undefined
|
||||||
|
const isApproach = n.approach !== undefined
|
||||||
|
if (isDeg === isApproach) return e(`${nw}: exactly one of deg | approach per note`)
|
||||||
|
if (isApproach) {
|
||||||
|
approachSeen = true
|
||||||
|
if (!BASS_APPROACHES.includes(n.approach))
|
||||||
|
e(`${nw}: unknown approach '${n.approach}' — allowed: ${BASS_APPROACHES.join(', ')}`)
|
||||||
|
if (n.octave !== undefined)
|
||||||
|
e(`${nw}: octave applies to deg notes only (the renderer places approaches beside the next root)`)
|
||||||
|
} else {
|
||||||
|
if (approachSeen)
|
||||||
|
e(`${nw}: deg note after an approach — approach notes must close the pattern (they lead into the next chord)`)
|
||||||
|
if (typeof n.deg !== 'string') {
|
||||||
|
e(`${nw}: deg must be a degree STRING ('1', 'b7', …), got ${JSON.stringify(n.deg)}`)
|
||||||
|
} else {
|
||||||
|
const pc = resolveDegree(n.deg, quality)
|
||||||
|
if (pc === null) e(`${nw}: unresolvable degree '${n.deg}' for ${quality}`)
|
||||||
|
if (n.deg === '1') rootSeen = true
|
||||||
|
if (n.octave !== undefined && n.octave !== 0 && n.octave !== 1)
|
||||||
|
e(`${nw}: octave, when present, must be 0 or 1 — got ${JSON.stringify(n.octave)}`)
|
||||||
|
else if (pc !== null && pc + 12 * (n.octave === 1 ? 1 : 0) > BASS_MAX_OFFSET)
|
||||||
|
e(`${nw}: '${n.deg}' octave ${n.octave} sits ${pc + 12} semitones above the root — max ${BASS_MAX_OFFSET} (an octave + a fifth; keeps the pattern in one position on E–A–D–G)`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (n.technique !== undefined && !LICK_TECHNIQUES.includes(n.technique))
|
||||||
|
e(`${nw}: unknown technique '${n.technique}' — allowed: ${LICK_TECHNIQUES.join(', ')}`)
|
||||||
|
if (n.beat !== undefined) {
|
||||||
|
const maxBeat = BASS_BEATS_PER_BAR * bars
|
||||||
|
if (typeof n.beat !== 'number' || !(n.beat >= 1 && n.beat < maxBeat + 1))
|
||||||
|
e(`${nw}: beat must be a number in [1, ${maxBeat + 1}) for a ${bars}-bar step, got ${JSON.stringify(n.beat)}`)
|
||||||
|
else if (n.beat < lastBeat)
|
||||||
|
e(`${nw}: beat ${n.beat} < previous beat ${lastBeat} — beats must be non-decreasing in pattern order`)
|
||||||
|
else lastBeat = n.beat
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (!rootSeen)
|
||||||
|
e(`${cw}: pattern never states the root ('1') — a bassline grounds the chord (SCHEMA "Bass play" root rule)`)
|
||||||
})
|
})
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pure lick validation (SCHEMA.md "Licks" section). Returns an array of error
|
||||||
|
// strings (already where-prefixed); mutates seenIds by adding the lick's id so
|
||||||
|
// ids stay globally unique across ALL progressions and licks (same rule as
|
||||||
|
// progression ids). Exported for reuse by scripts/smoke.mjs.
|
||||||
|
export function checkLick(where, lick, style, seenIds) {
|
||||||
|
const out = []
|
||||||
|
const e = (msg) => out.push(`${where}: ${msg}`)
|
||||||
|
if (!lick || typeof lick !== 'object') { e('lick must be an object'); return out }
|
||||||
|
if (typeof lick.id !== 'string' || !lick.id.startsWith(`${style}-`))
|
||||||
|
e(`id must be a string starting with '${style}-'`)
|
||||||
|
else if (seenIds.has(lick.id)) e(`duplicate id '${lick.id}' (ids are global across progressions AND licks)`)
|
||||||
|
else seenIds.add(lick.id)
|
||||||
|
if (!lick.name) e('name missing')
|
||||||
|
if (!LEVELS.includes(lick.level)) e(`level must be one of ${LEVELS.join(' | ')}, got '${lick.level}'`)
|
||||||
|
if (typeof lick.chordContext !== 'string' || !lick.chordContext)
|
||||||
|
e("chordContext missing (which chord/station the lick fits, e.g. 'dom7' or 'over the I7')")
|
||||||
|
const summary = new Set()
|
||||||
|
if (!Array.isArray(lick.techniques)) e('techniques must be an array (may be empty for a plain-picked lick)')
|
||||||
|
else for (const t of lick.techniques) {
|
||||||
|
if (!LICK_TECHNIQUES.includes(t)) e(`unknown technique '${t}' — allowed: ${LICK_TECHNIQUES.join(', ')}`)
|
||||||
|
summary.add(t)
|
||||||
|
}
|
||||||
|
if (!Array.isArray(lick.tab) || !lick.tab.length) { e('tab must be a non-empty ordered array of notes'); return out }
|
||||||
|
lick.tab.forEach((note, i) => {
|
||||||
|
const nw = `tab[${i}]`
|
||||||
|
if (!note || typeof note !== 'object') return e(`${nw} must be an object {string, fret, technique?}`)
|
||||||
|
if (!Number.isInteger(note.string) || note.string < 1 || note.string > 6)
|
||||||
|
e(`${nw} string must be an integer 1–6 (1 = high e, 6 = low E), got ${JSON.stringify(note.string)}`)
|
||||||
|
if (!Number.isInteger(note.fret) || note.fret < 0 || note.fret > LICK_MAX_FRET)
|
||||||
|
e(`${nw} fret must be an integer 0–${LICK_MAX_FRET}, got ${JSON.stringify(note.fret)}`)
|
||||||
|
if (note.technique !== undefined) {
|
||||||
|
if (!LICK_TECHNIQUES.includes(note.technique))
|
||||||
|
e(`${nw} unknown technique '${note.technique}' — allowed: ${LICK_TECHNIQUES.join(', ')}`)
|
||||||
|
else if (!summary.has(note.technique))
|
||||||
|
e(`${nw} technique '${note.technique}' must also appear in the lick's techniques[] summary`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Piano licks (SCHEMA.md "Piano licks") ────────────────────────────────────
|
||||||
|
// Degree-based melodic phrases over ONE explicit quality (guitar tab is
|
||||||
|
// instrument-truth and needs no quality; degrees need a context to resolve
|
||||||
|
// through — chordContext stays the human sentence, `quality` is the machine
|
||||||
|
// truth). Approaches are typed and DERIVED: each targets the next deg note in
|
||||||
|
// the lick (there is no "next station" inside a self-contained lick), so the
|
||||||
|
// validator can allow the non-chord tone without blessing arbitrary
|
||||||
|
// chromatics — and an approach can never close a lick (nothing to target).
|
||||||
|
//
|
||||||
|
// Piano technique vocabulary — deliberately NOT LICK_TECHNIQUES: keys don't
|
||||||
|
// bend, hammer, pull off, or sustain vibrato; chromatic-approach is redundant
|
||||||
|
// (approaches are typed notes here). The three shared words keep their
|
||||||
|
// guitar-lick meanings; grace-note (the crushed blues/gospel ornament) is
|
||||||
|
// piano-specific. smoke.mjs guards both lists' consistency.
|
||||||
|
export const PIANO_LICK_TECHNIQUES = ['slide', 'double-stop', 'ghost-note', 'grace-note']
|
||||||
|
export const PIANO_LICK_APPROACHES = ['chrom-below', 'chrom-above']
|
||||||
|
// Range cap on every RESOLVED offset (deg: pc + 12·octave; approach: derived):
|
||||||
|
// [0, 25] semitones above the root. Proof against MiniPiano's render window
|
||||||
|
// (absolute notes [0, 36], 0 = low C): place the root at its pitch class in
|
||||||
|
// the bottom octave (0–11); the highest possible note is then 11 + 25 = 36 —
|
||||||
|
// exactly the window's top key — so every legal lick fits in all 12 keys.
|
||||||
|
export const PIANO_LICK_MAX_OFFSET = 25
|
||||||
|
const PIANO_LICK_MAX_NOTES = 16 // 8ths over the 2-bar beat window (rule 3)
|
||||||
|
const PIANO_LICK_MAX_BEAT = 9 // exclusive: 1 ≤ beat < 9 (two 4/4 bars)
|
||||||
|
|
||||||
|
// Pure piano-lick validation. Returns an array of where-prefixed error strings
|
||||||
|
// (empty = valid); mutates seenIds like checkLick (shared global id
|
||||||
|
// namespace). Exported for reuse by scripts/smoke.mjs (lib mode).
|
||||||
|
export function checkPianoLick(where, lick, style, seenIds) {
|
||||||
|
const out = []
|
||||||
|
const e = (msg) => out.push(`${where}: ${msg}`)
|
||||||
|
if (!lick || typeof lick !== 'object') { e('lick must be an object'); return out }
|
||||||
|
if (typeof lick.id !== 'string' || !lick.id.startsWith(`${style}-`))
|
||||||
|
e(`id must be a string starting with '${style}-'`)
|
||||||
|
else if (seenIds.has(lick.id)) e(`duplicate id '${lick.id}' (ids are global across progressions AND licks)`)
|
||||||
|
else seenIds.add(lick.id)
|
||||||
|
if (!lick.name) e('name missing')
|
||||||
|
if (!LEVELS.includes(lick.level)) e(`level must be one of ${LEVELS.join(' | ')}, got '${lick.level}'`)
|
||||||
|
if (typeof lick.chordContext !== 'string' || !lick.chordContext)
|
||||||
|
e("chordContext missing (which chord/station the lick fits, e.g. 'over the ii7')")
|
||||||
|
const quality = lick.quality
|
||||||
|
if (!CHORD_TYPES[quality]) {
|
||||||
|
e(`quality must be a CHORD_TYPES key (the context every deg resolves through), got '${quality}'`)
|
||||||
|
return out // nothing below is checkable without a quality
|
||||||
|
}
|
||||||
|
const summary = new Set()
|
||||||
|
if (!Array.isArray(lick.techniques)) e('techniques must be an array (may be empty for a plain lick)')
|
||||||
|
else for (const t of lick.techniques) {
|
||||||
|
if (!PIANO_LICK_TECHNIQUES.includes(t))
|
||||||
|
e(`unknown piano technique '${t}' — allowed: ${PIANO_LICK_TECHNIQUES.join(', ')}`)
|
||||||
|
summary.add(t)
|
||||||
|
}
|
||||||
|
const notes = lick.notes
|
||||||
|
if (!Array.isArray(notes) || !notes.length) { e('notes must be a non-empty ordered array'); return out }
|
||||||
|
if (notes.length > PIANO_LICK_MAX_NOTES)
|
||||||
|
e(`${notes.length} notes > ${PIANO_LICK_MAX_NOTES} (8ths over two bars) — not intermediate-friendly`)
|
||||||
|
|
||||||
|
// Pass 1: resolved offset of every deg note (null = unresolvable/malformed),
|
||||||
|
// so approaches can look up their target (the NEXT deg note in order).
|
||||||
|
const degOffsets = notes.map((n) => {
|
||||||
|
if (!n || typeof n !== 'object' || n.deg === undefined || typeof n.deg !== 'string') return null
|
||||||
|
const pc = resolveDegree(n.deg, quality)
|
||||||
|
if (pc === null) return null
|
||||||
|
const oct = n.octave === undefined ? 0 : n.octave
|
||||||
|
return oct === 0 || oct === 1 || oct === 2 ? pc + 12 * oct : null
|
||||||
|
})
|
||||||
|
|
||||||
|
let lastBeat = -Infinity
|
||||||
|
let prevApproach = null // type of the immediately preceding approach note
|
||||||
|
notes.forEach((n, ni) => {
|
||||||
|
const nw = `notes[${ni}]`
|
||||||
|
if (!n || typeof n !== 'object') return e(`${nw}: note must be an object ({deg,…} or {approach,…})`)
|
||||||
|
const isDeg = n.deg !== undefined
|
||||||
|
const isApproach = n.approach !== undefined
|
||||||
|
if (isDeg === isApproach) return e(`${nw}: exactly one of deg | approach per note`)
|
||||||
|
if (isApproach) {
|
||||||
|
if (!PIANO_LICK_APPROACHES.includes(n.approach))
|
||||||
|
e(`${nw}: unknown approach '${n.approach}' — allowed: ${PIANO_LICK_APPROACHES.join(', ')} (piano licks have no next station; 'fifth-of-next' is bass-only)`)
|
||||||
|
if (n.octave !== undefined)
|
||||||
|
e(`${nw}: octave applies to deg notes only (approach pitch is derived from its target)`)
|
||||||
|
if (prevApproach === n.approach)
|
||||||
|
e(`${nw}: two consecutive '${n.approach}' approaches derive the identical pitch — write the note you mean as a deg, or alternate types (the enclosure)`)
|
||||||
|
// Target = the NEXT deg note in order (scan past intervening approaches).
|
||||||
|
const ti = notes.findIndex((m, i) => i > ni && m?.deg !== undefined)
|
||||||
|
if (ti === -1) {
|
||||||
|
e(`${nw}: approach cannot close a piano lick — it targets the NEXT deg note (the final note must be a deg)`)
|
||||||
|
} else if (degOffsets[ti] !== null) {
|
||||||
|
const derived = degOffsets[ti] + (n.approach === 'chrom-below' ? -1 : 1)
|
||||||
|
if (derived < 0)
|
||||||
|
e(`${nw}: chrom-below of a root-position target derives −1 — below the render window; raise the target an octave`)
|
||||||
|
else if (derived > PIANO_LICK_MAX_OFFSET)
|
||||||
|
e(`${nw}: derived pitch sits ${derived} semitones above the root — max ${PIANO_LICK_MAX_OFFSET} (fits MiniPiano's 37-key window for all 12 roots)`)
|
||||||
|
} // target exists but is itself malformed → its own error already reports it
|
||||||
|
prevApproach = n.approach
|
||||||
|
} else {
|
||||||
|
prevApproach = null
|
||||||
|
if (typeof n.deg !== 'string') {
|
||||||
|
e(`${nw}: deg must be a degree STRING ('1', 'b7', …), got ${JSON.stringify(n.deg)}`)
|
||||||
|
} else {
|
||||||
|
const pc = resolveDegree(n.deg, quality)
|
||||||
|
if (pc === null) e(`${nw}: unresolvable degree '${n.deg}' for ${quality}`)
|
||||||
|
if (n.octave !== undefined && n.octave !== 0 && n.octave !== 1 && n.octave !== 2)
|
||||||
|
e(`${nw}: octave, when present, must be 0, 1 or 2 — got ${JSON.stringify(n.octave)}`)
|
||||||
|
else if (pc !== null && degOffsets[ni] !== null && degOffsets[ni] > PIANO_LICK_MAX_OFFSET)
|
||||||
|
e(`${nw}: '${n.deg}' octave ${n.octave} sits ${degOffsets[ni]} semitones above the root — max ${PIANO_LICK_MAX_OFFSET} (fits MiniPiano's 37-key window for all 12 roots)`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (n.technique !== undefined) {
|
||||||
|
if (!PIANO_LICK_TECHNIQUES.includes(n.technique))
|
||||||
|
e(`${nw}: unknown piano technique '${n.technique}' — allowed: ${PIANO_LICK_TECHNIQUES.join(', ')}`)
|
||||||
|
else if (!summary.has(n.technique))
|
||||||
|
e(`${nw}: technique '${n.technique}' must also appear in the lick's techniques[] summary`)
|
||||||
|
}
|
||||||
|
if (n.beat !== undefined) {
|
||||||
|
if (typeof n.beat !== 'number' || !(n.beat >= 1 && n.beat < PIANO_LICK_MAX_BEAT))
|
||||||
|
e(`${nw}: beat must be a number in [1, ${PIANO_LICK_MAX_BEAT}) — a lick spans at most two 4/4 bars, got ${JSON.stringify(n.beat)}`)
|
||||||
|
else if (n.beat < lastBeat)
|
||||||
|
e(`${nw}: beat ${n.beat} < previous beat ${lastBeat} — beats must be non-decreasing in note order`)
|
||||||
|
else lastBeat = n.beat
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadModule(path) {
|
async function loadModule(path) {
|
||||||
return (await import(pathToFileURL(path).href)).default
|
return (await import(pathToFileURL(path).href)).default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
const styleDirs = readdirSync(KB, { withFileTypes: true }).filter(d => d.isDirectory()).map(d => d.name)
|
const styleDirs = readdirSync(KB, { withFileTypes: true }).filter(d => d.isDirectory()).map(d => d.name)
|
||||||
if (!styleDirs.length) { console.error('No style folders in src/data/kb/'); process.exit(1) }
|
if (!styleDirs.length) { console.error('No style folders in src/data/kb/'); process.exit(1) }
|
||||||
|
|
||||||
@@ -116,7 +410,7 @@ const registry = existsSync(join(KB, 'index.js')) ? await loadModule(join(KB, 'i
|
|||||||
if (!registry) err('kb/index.js', 'registry missing')
|
if (!registry) err('kb/index.js', 'registry missing')
|
||||||
|
|
||||||
const allIds = new Set()
|
const allIds = new Set()
|
||||||
let totals = { styles: 0, progressions: 0, plays: 0 }
|
let totals = { styles: 0, progressions: 0, plays: 0, licks: 0 }
|
||||||
|
|
||||||
for (const style of styleDirs) {
|
for (const style of styleDirs) {
|
||||||
const dir = join(KB, style)
|
const dir = join(KB, style)
|
||||||
@@ -147,6 +441,9 @@ for (const style of styleDirs) {
|
|||||||
if (!MODES.includes(p.mode)) err(pw, `unknown mode '${p.mode}'`)
|
if (!MODES.includes(p.mode)) err(pw, `unknown mode '${p.mode}'`)
|
||||||
if (!Array.isArray(p.songs) || !p.songs.length) err(pw, 'songs missing')
|
if (!Array.isArray(p.songs) || !p.songs.length) err(pw, 'songs missing')
|
||||||
if (!p.tip) err(pw, 'tip missing')
|
if (!p.tip) err(pw, 'tip missing')
|
||||||
|
// Optional difficulty tag — absent means 'foundation' (consumer default).
|
||||||
|
if (p.level !== undefined && !LEVELS.includes(p.level))
|
||||||
|
err(pw, `level, when present, must be one of ${LEVELS.join(' | ')} — got '${p.level}'`)
|
||||||
}
|
}
|
||||||
totals.styles++; totals.progressions += progs.length
|
totals.styles++; totals.progressions += progs.length
|
||||||
|
|
||||||
@@ -160,9 +457,10 @@ for (const style of styleDirs) {
|
|||||||
if (inst !== 'bass' && (!pack.improv?.scales?.length || !pack.improv?.targetNotes))
|
if (inst !== 'bass' && (!pack.improv?.scales?.length || !pack.improv?.targetNotes))
|
||||||
err(iw, 'improv.scales / improv.targetNotes required')
|
err(iw, 'improv.scales / improv.targetNotes required')
|
||||||
|
|
||||||
|
const minPlays = inst === 'bass' ? MIN_PLAYS_BASS : MIN_PLAYS
|
||||||
for (const p of progs)
|
for (const p of progs)
|
||||||
if ((pack.plays?.[p.id]?.length ?? 0) < MIN_PLAYS)
|
if ((pack.plays?.[p.id]?.length ?? 0) < minPlays)
|
||||||
err(iw, `progression '${p.id}' has < ${MIN_PLAYS} plays`)
|
err(iw, `progression '${p.id}' has < ${minPlays} play(s)`)
|
||||||
|
|
||||||
for (const [pid, plays] of Object.entries(pack.plays ?? {})) {
|
for (const [pid, plays] of Object.entries(pack.plays ?? {})) {
|
||||||
const prog = progById[pid]
|
const prog = progById[pid]
|
||||||
@@ -171,16 +469,33 @@ for (const style of styleDirs) {
|
|||||||
const lw = `${iw} ${pid} play[${pi}] "${play.label ?? '?'}"`
|
const lw = `${iw} ${pid} play[${pi}] "${play.label ?? '?'}"`
|
||||||
if (!play.label || !play.level || !play.tips) err(lw, 'label/level/tips required')
|
if (!play.label || !play.level || !play.tips) err(lw, 'label/level/tips required')
|
||||||
totals.plays++
|
totals.plays++
|
||||||
if (inst === 'bass') return checkBassPlay(lw, play, prog)
|
if (inst === 'bass') { for (const m of checkBassPlay(lw, play, prog)) errors.push(m); return }
|
||||||
if (!Array.isArray(play.chords) || play.chords.length !== prog.degrees.length)
|
if (!Array.isArray(play.chords) || play.chords.length !== prog.degrees.length)
|
||||||
return err(lw, `chords length ≠ progression length ${prog.degrees.length}`)
|
return err(lw, `chords length ≠ progression length ${prog.degrees.length}`)
|
||||||
play.chords.forEach((step, ci) => {
|
play.chords.forEach((step, ci) => {
|
||||||
const cw = `${lw} chord[${ci}] (${prog.rn[ci]})`
|
const cw = `${lw} chord[${ci}] (${prog.rn[ci]})`
|
||||||
if (inst === 'guitar') checkGuitarShape(cw, step, prog.qualities[ci])
|
if (inst === 'guitar') checkGuitarShape(cw, step, prog.qualities[ci])
|
||||||
else checkPianoRecipe(cw, step, prog.qualities[ci])
|
else for (const m of checkPianoRecipe(cw, step, prog.qualities[ci])) errors.push(m)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Optional structured licks (SCHEMA.md "Licks" / "Piano licks") — a
|
||||||
|
// top-level `licks` key on the instrument pack. Absent is fine; when
|
||||||
|
// present it must validate. Routed by instrument: piano licks are
|
||||||
|
// degree-based (checkPianoLick); guitar licks are tab-based (checkLick).
|
||||||
|
if (pack.licks !== undefined) {
|
||||||
|
if (!Array.isArray(pack.licks) || !pack.licks.length) {
|
||||||
|
err(iw, 'licks, when present, must be a non-empty array')
|
||||||
|
} else {
|
||||||
|
const checkInstLick = inst === 'piano' ? checkPianoLick : checkLick
|
||||||
|
pack.licks.forEach((lick, li) => {
|
||||||
|
const lkw = `${iw} licks[${li}] "${lick?.id ?? '?'}"`
|
||||||
|
for (const m of checkInstLick(lkw, lick, style, allIds)) errors.push(m)
|
||||||
|
})
|
||||||
|
totals.licks += pack.licks.length
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,4 +504,11 @@ if (errors.length) {
|
|||||||
for (const e of errors) console.error(' ' + e)
|
for (const e of errors) console.error(' ' + e)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
console.log(`✓ KB valid — ${totals.styles} style(s), ${totals.progressions} progressions, ${totals.plays} plays`)
|
const lickNote = totals.licks ? `, ${totals.licks} licks` : ''
|
||||||
|
console.log(`✓ KB valid — ${totals.styles} style(s), ${totals.progressions} progressions, ${totals.plays} plays${lickNote}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run the full validation unless imported as a library (see header comment).
|
||||||
|
// Safe-by-default: an unset env var always means "run" — the gate can't be
|
||||||
|
// skipped by a path-comparison quirk.
|
||||||
|
if (!process.env.KB_VALIDATE_AS_LIB) await main()
|
||||||
|
|||||||
+60
-17
@@ -11,9 +11,8 @@ import DebugView from './components/DebugView'
|
|||||||
import DrumView from './components/DrumView'
|
import DrumView from './components/DrumView'
|
||||||
import { NOTES, detectKey, detectTopKeys, matchChordFromChroma, detectRepeatingProgression, getChordTones, getChordCandidates, getNoteHistoryAnalysis } from './lib/theory'
|
import { NOTES, detectKey, detectTopKeys, matchChordFromChroma, detectRepeatingProgression, getChordTones, getChordCandidates, getNoteHistoryAnalysis } from './lib/theory'
|
||||||
import ChordDetailModal from './components/ChordDetailModal'
|
import ChordDetailModal from './components/ChordDetailModal'
|
||||||
import CurrentJamPanel from './components/CurrentJamPanel'
|
|
||||||
import LoopStation from './components/LoopStation'
|
import LoopStation from './components/LoopStation'
|
||||||
import JamGuide from './components/JamGuide'
|
import JamGuide, { KnowledgeDock } from './components/JamGuide'
|
||||||
import { useLoopEngine } from './services/loopEngine'
|
import { useLoopEngine } from './services/loopEngine'
|
||||||
import settingIcon from './assets/setting-icon.png'
|
import settingIcon from './assets/setting-icon.png'
|
||||||
|
|
||||||
@@ -151,24 +150,65 @@ export default function App() {
|
|||||||
chromaIdxRef.current = 0
|
chromaIdxRef.current = 0
|
||||||
}, [config.chromaSmooth])
|
}, [config.chromaSmooth])
|
||||||
|
|
||||||
// ── Detect progression — require 2 consecutive identical results to commit ────
|
// ── Progression commit layer (task L-31) ─────────────────────────────────────
|
||||||
|
// Runs once per chord commit. progressionVoteRef holds
|
||||||
|
// { committedKey, candidateKey, candidateCount } — null until first evidence.
|
||||||
|
//
|
||||||
|
// Thresholds are in chord-commits (one detector run each):
|
||||||
|
// · COMMIT_VOTES = 2 — first commit needs 2 consecutive identical detections
|
||||||
|
// (≈ one bar). Post-L-30 detection is stable on clean loops so this lands
|
||||||
|
// immediately; a noisy 2-rep history flaps through data-faithful sub-cycles
|
||||||
|
// that never repeat twice in a row, so noise can't commit early.
|
||||||
|
// · REPLACE_VOTES = 3 — replacing a committed loop needs 3 consecutive
|
||||||
|
// detections of the SAME new loop: one transient detection (or an
|
||||||
|
// alternating flap) must never displace the loop the musician is still in;
|
||||||
|
// a genuine section change is detected consistently and just lands one
|
||||||
|
// commit later than a first commit would.
|
||||||
|
// · NULL_CLEAR = 6 — the detector only returns null once the loop has
|
||||||
|
// aged out of its 32-commit window (it needs 2 exact in-window
|
||||||
|
// occurrences): traced, that is ~28 commits of foreign material after
|
||||||
|
// the loop last played. Fills, turnarounds and window-boundary resumes
|
||||||
|
// yield non-null sub-cycle detections rather than nulls (traced), so
|
||||||
|
// they can NEVER clear a committed loop — a new established loop
|
||||||
|
// replaces via REPLACE_VOTES instead. A null run therefore means the
|
||||||
|
// jam truly left loop-land ~30 commits ago; 6 more (≈ two bars of
|
||||||
|
// structureless playing) confirms it wasn't a flicker before the
|
||||||
|
// display goes dark. (The old value 4 was sized as if nulls happened
|
||||||
|
// during fills — post-L-30 they don't.)
|
||||||
|
const COMMIT_VOTES = 2
|
||||||
|
const REPLACE_VOTES = 3
|
||||||
|
const NULL_CLEAR = 6
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const detected = detectRepeatingProgression(chordHistory)
|
const detected = detectRepeatingProgression(chordHistory)
|
||||||
|
const vote = progressionVoteRef.current
|
||||||
if (!detected) {
|
if (!detected) {
|
||||||
progressionMissRef.current++
|
progressionMissRef.current++
|
||||||
// Clear stale loop after 4 chord changes with no pattern found
|
if (progressionMissRef.current >= NULL_CLEAR) {
|
||||||
if (progressionMissRef.current >= 4) {
|
|
||||||
setDetectedProgression(null)
|
setDetectedProgression(null)
|
||||||
progressionVoteRef.current = null
|
progressionVoteRef.current = null
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
progressionMissRef.current = 0
|
progressionMissRef.current = 0 // any detected structure keeps the committed loop alive
|
||||||
const key = detected.join(',')
|
const key = detected.join(',')
|
||||||
if (progressionVoteRef.current === key) {
|
|
||||||
|
if (vote && vote.committedKey === key) {
|
||||||
|
// Agreement with the committed loop — refresh it, drop any pending rival.
|
||||||
setDetectedProgression(detected)
|
setDetectedProgression(detected)
|
||||||
|
vote.candidateKey = null
|
||||||
|
vote.candidateCount = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const committedKey = vote ? vote.committedKey : null
|
||||||
|
if (vote && vote.candidateKey === key) {
|
||||||
|
vote.candidateCount++
|
||||||
} else {
|
} else {
|
||||||
progressionVoteRef.current = key
|
progressionVoteRef.current = { committedKey, candidateKey: key, candidateCount: 1 }
|
||||||
|
}
|
||||||
|
if (progressionVoteRef.current.candidateCount >= (committedKey ? REPLACE_VOTES : COMMIT_VOTES)) {
|
||||||
|
setDetectedProgression(detected)
|
||||||
|
progressionVoteRef.current = { committedKey: key, candidateKey: null, candidateCount: 0 }
|
||||||
}
|
}
|
||||||
}, [chordHistory])
|
}, [chordHistory])
|
||||||
|
|
||||||
@@ -589,12 +629,16 @@ export default function App() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{/* ── Current jam — collapsible ── */}
|
{/* ── Jam Guide band — always open, right below the instrument row (L-40,
|
||||||
<CurrentJamPanel
|
D-40 §1: CurrentJamPanel's old slot; the loop shows ONCE, in the
|
||||||
|
banner above). Follows the one global instrument selector. ── */}
|
||||||
|
<JamGuide
|
||||||
|
detectedProgression={detectedProgression}
|
||||||
keyInfo={effectiveKey}
|
keyInfo={effectiveKey}
|
||||||
chordHistory={chordHistory}
|
chordHistory={chordHistory}
|
||||||
detectedProgression={detectedProgression}
|
currentChord={currentChord}
|
||||||
onChordClick={setSelectedChord}
|
onFocusChord={setJamFocusChord}
|
||||||
|
instrument={instrument}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* ── Loop station ── */}
|
{/* ── Loop station ── */}
|
||||||
@@ -667,14 +711,13 @@ export default function App() {
|
|||||||
{showTuner && <div className="border-t border-border"><Tuner /></div>}
|
{showTuner && <div className="border-t border-border"><Tuner /></div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* ── Jam Guide — bottom dock (Roadmap) ── */}
|
{/* ── Knowledge Center — bottom browse & study dock (L-40, D-40 §5) ── */}
|
||||||
<JamGuide
|
<KnowledgeDock
|
||||||
detectedProgression={detectedProgression}
|
|
||||||
keyInfo={effectiveKey}
|
keyInfo={effectiveKey}
|
||||||
chordHistory={chordHistory}
|
chordHistory={chordHistory}
|
||||||
bpm={bpm}
|
|
||||||
currentChord={currentChord}
|
currentChord={currentChord}
|
||||||
onFocusChord={setJamFocusChord}
|
onChordClick={setSelectedChord}
|
||||||
|
instrument={instrument}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,415 @@
|
|||||||
|
// BassPatternCard — per-station authored bass pattern as compact 4-string tab
|
||||||
|
// (task L-42, per docs/design/integrated-glance.md §3's gallery-slot contract
|
||||||
|
// and SCHEMA.md "Bass play").
|
||||||
|
//
|
||||||
|
// Given a station's { rootPc, quality }, one play's per-station `pattern`, and
|
||||||
|
// the NEXT station's root (approach pitches derive from it — the loop wraps),
|
||||||
|
// this renders the REALIZED line: the degree/approach data resolved to actual
|
||||||
|
// pitches and placed on the bass. Visually it rhymes with LickCard's tab SVG
|
||||||
|
// (same string-line + surface-pill-number language, same technique-glyph
|
||||||
|
// vocabulary) but with the bass rendering convention from SCHEMA.md:
|
||||||
|
//
|
||||||
|
// standard 4-string tuning E–A–D–G, string 1 = G (HIGHEST) rendered on top,
|
||||||
|
// string 4 = low E at the bottom — the same "1 = highest string" counting as
|
||||||
|
// lick tab and `rootStr`, so no third scheme exists in this codebase.
|
||||||
|
//
|
||||||
|
// ── Realization rules (SCHEMA.md "Bass play") ─────────────────────────────────
|
||||||
|
// Pitch space: semitones above open low E (E1). Open strings sit at 0 (E),
|
||||||
|
// 5 (A), 10 (D), 15 (G); the playable ceiling is 30 (G string, fret 15).
|
||||||
|
//
|
||||||
|
// · The station ROOT lands on its lowest playable position:
|
||||||
|
// rootAbs = (rootPc − 4) mod 12 (open E's pitch class is 4).
|
||||||
|
// · A `deg` note sits at rootAbs + resolveDegree(deg, quality) + 12·octave.
|
||||||
|
// The schema caps the resolved offset at 19 semitones, so every deg note
|
||||||
|
// fits ≤ 30 by construction (11 + 19); anything unresolvable nulls the
|
||||||
|
// whole pattern and the card renders its placeholder instead of lying.
|
||||||
|
// · An `approach` note's PITCH CLASS derives from the next station's root:
|
||||||
|
// chrom-below = next−1 · chrom-above = next+1 · fifth-of-next = next+7
|
||||||
|
// (mod 12). Its OCTAVE is the placement nearest the previous realized note
|
||||||
|
// (approaches are terminal, so a previous note always exists), which keeps
|
||||||
|
// the walkup/walkdown contour the author described — e.g. the 12-bar bar-4
|
||||||
|
// walkup C–D–E♭ lands its E right above the E♭, not two octaves away.
|
||||||
|
// · 🚨 C-41 gate rule — the open-E floor: a chrom-below into a next root at
|
||||||
|
// open E (abs 0) has NO pitch below the instrument (−1 does not exist).
|
||||||
|
// When the nearest placement falls below abs 0 it is OCTAVE-DISPLACED up
|
||||||
|
// (+12): the approach plays a half-step under the OCTAVE root instead —
|
||||||
|
// e.g. D♯ at abs 11 leading into E. The symmetric ceiling guard (> 30 →
|
||||||
|
// −12) exists for completeness. This is the displacement rule the ledger
|
||||||
|
// row mandates; keep it.
|
||||||
|
// · String/fret: each realized pitch takes the HIGHEST-tuned open string at
|
||||||
|
// or below it — the minimum-fret assignment. Because the root starts at
|
||||||
|
// its lowest position (fret ≤ 11 worst case, usually ≤ 8) and strings are
|
||||||
|
// tuned in fourths, the whole pattern lands in one hand position within
|
||||||
|
// frets 0–15 (the schema's ≤ 19-semitone span guarantee).
|
||||||
|
//
|
||||||
|
// ── Rendering ─────────────────────────────────────────────────────────────────
|
||||||
|
// Beat spacing when every note carries a `beat` (columns proportional to beat,
|
||||||
|
// faint beat numbers under the bottom string); plain even columns otherwise.
|
||||||
|
// Approach notes draw AMBER (the established secondary-tone colour) with a
|
||||||
|
// small arrow after the final one — they belong to the NEXT chord. Technique
|
||||||
|
// marks reuse the lick glyph vocabulary in its light form (amber letter/symbol
|
||||||
|
// above the note; ghost notes parenthesise and dim, as in LickCard).
|
||||||
|
//
|
||||||
|
// ── Playback (▶) ──────────────────────────────────────────────────────────────
|
||||||
|
// Sequential single-note scheduling through chordAudio's playVoicing (one call
|
||||||
|
// per note — playVoicing itself sorts/dedupes, which is wrong for a melodic
|
||||||
|
// line, so the ORDER lives here in setTimeout scheduling). Bass register:
|
||||||
|
// realized abs − 20 puts open E at chordAudio note −20 = E1 ≈ 41.2 Hz
|
||||||
|
// (chordAudio's space is 0 = C3; negatives are documented-legal input).
|
||||||
|
// Timing: beats at a fixed preview tempo when present, else even eighths.
|
||||||
|
// One pattern at a time module-wide: each play stops the previous sequence
|
||||||
|
// AND calls stopAll() so it never layers over a VoicingBrowser preview.
|
||||||
|
|
||||||
|
import { useEffect } from 'react'
|
||||||
|
import { NOTES } from '../lib/theory'
|
||||||
|
import { resolveDegree } from './JamGuide'
|
||||||
|
import { playVoicing, stopAll } from '../lib/chordAudio'
|
||||||
|
|
||||||
|
// SVG palette — mirrors LickCard's token constants (SVG fills can't read
|
||||||
|
// Tailwind classes): amber = technique/approach, surface = backing pills.
|
||||||
|
const AMBER = '#f59e0b'
|
||||||
|
const FRET_TEXT = '#e5e7eb' // gray-200
|
||||||
|
const GHOST_TEXT = '#9ca3af' // gray-400
|
||||||
|
const STRING_LINE = '#3a3a3a'
|
||||||
|
const STRING_LABEL = '#6b7280' // gray-500
|
||||||
|
const BEAT_LABEL = '#6b7280'
|
||||||
|
const CARD_BG = '#0f0f0f' // token `surface`
|
||||||
|
|
||||||
|
// Strings top → bottom: 1 = G (highest), 4 = low E. `open` = semitones above E1.
|
||||||
|
const STRINGS = [
|
||||||
|
{ n: 1, name: 'G', open: 15 },
|
||||||
|
{ n: 2, name: 'D', open: 10 },
|
||||||
|
{ n: 3, name: 'A', open: 5 },
|
||||||
|
{ n: 4, name: 'E', open: 0 },
|
||||||
|
]
|
||||||
|
const OPEN_E_PC = 4 // pitch class of the low E string
|
||||||
|
const ABS_MAX = 30 // G string fret 15 — the playable ceiling
|
||||||
|
|
||||||
|
// Approach-type → semitone delta from the NEXT station's root (SCHEMA.md).
|
||||||
|
const APPROACH_DELTA = { 'chrom-below': -1, 'chrom-above': 1, 'fifth-of-next': 7 }
|
||||||
|
|
||||||
|
// Technique mark drawn above the note (light form of LickCard's glyphs; the
|
||||||
|
// full vocabulary is legal per SCHEMA.md — ghost-note is handled by the
|
||||||
|
// parenthesised dim label, double-stop by equal beats, chromatic-approach and
|
||||||
|
// unknown words get no mark, exactly like LickCard's graceful default).
|
||||||
|
const TECH_MARK = {
|
||||||
|
'hammer-on': 'h',
|
||||||
|
'pull-off': 'p',
|
||||||
|
slide: '⟋',
|
||||||
|
bend: '↑',
|
||||||
|
vibrato: '~',
|
||||||
|
}
|
||||||
|
|
||||||
|
const mod12 = (n) => ((n % 12) + 12) % 12
|
||||||
|
|
||||||
|
// abs (semitones above open E1 = MIDI 28) → "E1"/"C2"… scientific spelling.
|
||||||
|
function absName(abs) {
|
||||||
|
return `${NOTES[mod12(abs + OPEN_E_PC)]}${Math.floor((abs + 28) / 12) - 1}`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Min-fret string assignment: highest-tuned open string at or below the pitch.
|
||||||
|
function placeOnString(abs) {
|
||||||
|
for (const s of STRINGS) {
|
||||||
|
if (abs >= s.open && abs - s.open <= 15) return { string: s.n, fret: abs - s.open }
|
||||||
|
}
|
||||||
|
return null // abs outside [0, 30] — caller nulls the pattern
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* realizeBassPattern(pattern, rootPc, quality, nextRootPc)
|
||||||
|
* → [{ abs, string, fret, beat?, technique?, approach }] | null
|
||||||
|
*
|
||||||
|
* Pure realization per the header rules. Returns null on ANY malformed or
|
||||||
|
* unplaceable note so the caller can render a placeholder — authored data is
|
||||||
|
* validator-guaranteed, but a renderer must never crash on bad input.
|
||||||
|
*/
|
||||||
|
export function realizeBassPattern(pattern, rootPc, quality, nextRootPc) {
|
||||||
|
if (!Array.isArray(pattern) || pattern.length === 0) return null
|
||||||
|
if (!Number.isFinite(rootPc)) return null
|
||||||
|
const rootAbs = mod12(rootPc - OPEN_E_PC) // lowest playable root position
|
||||||
|
const out = []
|
||||||
|
let prev = rootAbs // approach placement anchor (root until a note lands)
|
||||||
|
for (const note of pattern) {
|
||||||
|
if (!note || typeof note !== 'object') return null
|
||||||
|
let abs
|
||||||
|
if (note.deg !== undefined && note.approach === undefined) {
|
||||||
|
const off = resolveDegree(String(note.deg), quality)
|
||||||
|
if (off === null || off === undefined) return null
|
||||||
|
abs = rootAbs + off + (note.octave === 1 ? 12 : 0)
|
||||||
|
} else if (note.approach !== undefined && note.deg === undefined) {
|
||||||
|
const delta = APPROACH_DELTA[note.approach]
|
||||||
|
if (delta === undefined || !Number.isFinite(nextRootPc)) return null
|
||||||
|
const pc = mod12(nextRootPc + delta)
|
||||||
|
const base = mod12(pc - OPEN_E_PC)
|
||||||
|
// Nearest octave placement to the previous note (ties resolve upward).
|
||||||
|
abs = base + 12 * Math.round((prev - base) / 12)
|
||||||
|
// C-41 open-E floor: chrom-below into a next root at open E resolves to
|
||||||
|
// abs −1, which does not exist on the instrument — octave-displace the
|
||||||
|
// approach up (+12: a half-step under the OCTAVE root). Ceiling mirror.
|
||||||
|
if (abs < 0) abs += 12
|
||||||
|
if (abs > ABS_MAX) abs -= 12
|
||||||
|
} else {
|
||||||
|
return null // exactly one of deg | approach per note (schema)
|
||||||
|
}
|
||||||
|
const placed = placeOnString(abs)
|
||||||
|
if (!placed) return null
|
||||||
|
out.push({
|
||||||
|
abs,
|
||||||
|
string: placed.string,
|
||||||
|
fret: placed.fret,
|
||||||
|
beat: Number.isFinite(note.beat) ? note.beat : undefined,
|
||||||
|
technique: typeof note.technique === 'string' ? note.technique : undefined,
|
||||||
|
approach: note.approach !== undefined,
|
||||||
|
})
|
||||||
|
prev = abs
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Sequential playback (module-level: one pattern at a time, app-wide) ─────
|
||||||
|
|
||||||
|
const PREVIEW_BPM = 96 // relaxed shuffle-ish preview tempo (display is tempo-free)
|
||||||
|
|
||||||
|
let currentSeq = null // { timeouts: number[], handles: {stop}[] }
|
||||||
|
|
||||||
|
function stopPattern() {
|
||||||
|
if (!currentSeq) return
|
||||||
|
for (const t of currentSeq.timeouts) clearTimeout(t)
|
||||||
|
for (const h of currentSeq.handles) h.stop()
|
||||||
|
currentSeq = null
|
||||||
|
}
|
||||||
|
|
||||||
|
function playPattern(realized) {
|
||||||
|
stopPattern()
|
||||||
|
stopAll() // never layer over a VoicingBrowser (or any other) preview
|
||||||
|
const beatMs = 60000 / PREVIEW_BPM
|
||||||
|
const hasBeats = realized.every((n) => Number.isFinite(n.beat))
|
||||||
|
// Beats drive onsets when authored; otherwise even eighths.
|
||||||
|
const times = realized.map((n, i) => (hasBeats ? (n.beat - 1) * beatMs : (i * beatMs) / 2))
|
||||||
|
const seq = { timeouts: [], handles: [] }
|
||||||
|
realized.forEach((n, i) => {
|
||||||
|
// Ring until the next distinct onset (equal beats = a dyad, same onset);
|
||||||
|
// the last note gets one beat. Small floor so ghost-short gaps still sound.
|
||||||
|
const nextT = times.slice(i + 1).find((t) => t > times[i])
|
||||||
|
const durMs = Math.max(160, (nextT !== undefined ? nextT - times[i] : beatMs) + 120)
|
||||||
|
seq.timeouts.push(
|
||||||
|
setTimeout(() => {
|
||||||
|
// abs − 20: open E1 in chordAudio's 0 = C3 note space (negatives legal).
|
||||||
|
seq.handles.push(playVoicing([n.abs - 20], { strumMs: 0, durMs, gain: 0.5 }))
|
||||||
|
}, times[i]),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
currentSeq = seq
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── SVG geometry (LickCard's idiom, 4 strings) ───────────────────────────────
|
||||||
|
|
||||||
|
const STR_GAP = 13
|
||||||
|
const PAD_T = 14
|
||||||
|
const PAD_B = 6
|
||||||
|
const PAD_L = 20
|
||||||
|
const PAD_R = 12
|
||||||
|
const COL_W = 26
|
||||||
|
const BEAT_ROW = 10 // extra bottom room for beat numbers when beats render
|
||||||
|
|
||||||
|
function layoutPattern(realized) {
|
||||||
|
const hasBeats =
|
||||||
|
realized.every((n) => Number.isFinite(n.beat)) &&
|
||||||
|
realized.every((n, i) => i === 0 || n.beat >= realized[i - 1].beat)
|
||||||
|
let xs, width, maxBeat, unit = null
|
||||||
|
if (hasBeats) {
|
||||||
|
// Columns proportional to beat; scale so the tightest gap ≥ one column.
|
||||||
|
const gaps = realized
|
||||||
|
.map((n, i) => (i > 0 ? n.beat - realized[i - 1].beat : 0))
|
||||||
|
.filter((g) => g > 0)
|
||||||
|
const minGap = gaps.length ? Math.min(...gaps) : 1
|
||||||
|
unit = Math.min(COL_W / minGap, COL_W * 4)
|
||||||
|
xs = realized.map((n) => PAD_L + (n.beat - 1) * unit + 10)
|
||||||
|
maxBeat = realized[realized.length - 1].beat
|
||||||
|
width = PAD_L + (maxBeat - 1) * unit + 20 + PAD_R
|
||||||
|
} else {
|
||||||
|
xs = realized.map((_, i) => PAD_L + i * COL_W + COL_W / 2)
|
||||||
|
width = PAD_L + realized.length * COL_W + PAD_R
|
||||||
|
maxBeat = null
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
hasBeats,
|
||||||
|
maxBeat,
|
||||||
|
unit,
|
||||||
|
width,
|
||||||
|
height: PAD_T + 3 * STR_GAP + PAD_B + (hasBeats ? BEAT_ROW : 0),
|
||||||
|
notes: realized.map((n, i) => ({
|
||||||
|
...n,
|
||||||
|
x: xs[i],
|
||||||
|
y: PAD_T + (n.string - 1) * STR_GAP,
|
||||||
|
ghost: n.technique === 'ghost-note',
|
||||||
|
label: n.technique === 'ghost-note' ? `(${n.fret})` : String(n.fret),
|
||||||
|
})),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function PatternSvg({ layout, ariaLabel }) {
|
||||||
|
const { notes, width, height, hasBeats, maxBeat, unit } = layout
|
||||||
|
const bottomY = PAD_T + 3 * STR_GAP
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
viewBox={`0 0 ${width} ${height}`}
|
||||||
|
width="100%"
|
||||||
|
style={{ display: 'block', height: 'auto', maxWidth: width * 1.4 }}
|
||||||
|
role="img"
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
{/* String lines — string 1 (G) on top, string 4 (low E) at the bottom. */}
|
||||||
|
{STRINGS.map((s, i) => {
|
||||||
|
const y = PAD_T + i * STR_GAP
|
||||||
|
return (
|
||||||
|
<g key={s.name}>
|
||||||
|
<line
|
||||||
|
x1={PAD_L - 6} y1={y} x2={width - PAD_R + 6} y2={y}
|
||||||
|
stroke={STRING_LINE} strokeWidth={i === 3 ? 1.4 : 1}
|
||||||
|
/>
|
||||||
|
<text x={7} y={y + 3} textAnchor="middle" fontSize={7} fill={STRING_LABEL}>
|
||||||
|
{s.name}
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
|
{/* Beat numbers under the bottom string (only when beats are authored;
|
||||||
|
x mirrors the note columns: beat 1 at PAD_L + 10, `unit` px per beat). */}
|
||||||
|
{hasBeats &&
|
||||||
|
Array.from({ length: Math.floor(maxBeat + 1e-6) }, (_, b) => (
|
||||||
|
<text
|
||||||
|
key={`b${b}`}
|
||||||
|
x={PAD_L + b * unit + 10}
|
||||||
|
y={bottomY + BEAT_ROW}
|
||||||
|
textAnchor="middle" fontSize={6.5} fill={BEAT_LABEL}
|
||||||
|
>
|
||||||
|
{b + 1}
|
||||||
|
</text>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Technique marks (light lick vocabulary) above their notes. */}
|
||||||
|
{notes.map((n, i) =>
|
||||||
|
TECH_MARK[n.technique] ? (
|
||||||
|
<text
|
||||||
|
key={`t${i}`} x={n.x} y={n.y - 8} textAnchor="middle" fontSize={8}
|
||||||
|
fontStyle="italic" fill={AMBER}
|
||||||
|
>
|
||||||
|
{TECH_MARK[n.technique]}
|
||||||
|
</text>
|
||||||
|
) : null,
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Fret numbers on surface pills; approach notes amber (next chord's). */}
|
||||||
|
{notes.map((n, i) => {
|
||||||
|
const w = n.label.length * 5.2 + 3
|
||||||
|
const isLast = i === notes.length - 1
|
||||||
|
return (
|
||||||
|
<g key={`n${i}`}>
|
||||||
|
<rect x={n.x - w / 2} y={n.y - 5.5} width={w} height={11} rx={2} fill={CARD_BG} />
|
||||||
|
<text
|
||||||
|
x={n.x} y={n.y + 3.2} textAnchor="middle" fontSize={9.5} fontWeight="600"
|
||||||
|
fill={n.approach ? AMBER : n.ghost ? GHOST_TEXT : FRET_TEXT}
|
||||||
|
>
|
||||||
|
{n.label}
|
||||||
|
</text>
|
||||||
|
{/* The final approach points at the next chord. */}
|
||||||
|
{n.approach && isLast && (
|
||||||
|
<text x={n.x + w / 2 + 5} y={n.y + 3} textAnchor="middle" fontSize={8} fill={AMBER}>
|
||||||
|
→
|
||||||
|
</text>
|
||||||
|
)}
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── The card ─────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
// Same ▶ pill as VoicingBrowser's gallery cells (its PlayButton is file-local;
|
||||||
|
// classes mirrored so the two galleries read identically).
|
||||||
|
function PlayButton({ ariaLabel, onClick }) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
onClick={onClick}
|
||||||
|
className={
|
||||||
|
'inline-flex h-7 shrink-0 items-center gap-1.5 rounded-full border border-accent ' +
|
||||||
|
'bg-surface px-2.5 text-xs font-semibold text-accent outline-none transition ' +
|
||||||
|
'hover:bg-accent hover:text-black focus-visible:ring-2 focus-visible:ring-accent'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 12 12" className="h-3 w-3 fill-current">
|
||||||
|
<path d="M2.5 1.5v9l8-4.5z" />
|
||||||
|
</svg>
|
||||||
|
Play
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <BassPatternCard rootPc quality nextRootPc pattern playLabel feel note chordLabel />
|
||||||
|
*
|
||||||
|
* Pure/presentational gallery cell for one station of one bass play. Renders
|
||||||
|
* the realized 4-string tab + the authored per-station note + its own ▶.
|
||||||
|
* Malformed/unplaceable patterns render an honest placeholder, never crash.
|
||||||
|
*/
|
||||||
|
export default function BassPatternCard({
|
||||||
|
rootPc,
|
||||||
|
quality,
|
||||||
|
nextRootPc,
|
||||||
|
pattern,
|
||||||
|
playLabel,
|
||||||
|
feel,
|
||||||
|
note,
|
||||||
|
chordLabel,
|
||||||
|
}) {
|
||||||
|
const realized = realizeBassPattern(pattern, rootPc, quality, nextRootPc)
|
||||||
|
|
||||||
|
// Unmount (loop/style/instrument change) silences any running sequence —
|
||||||
|
// module-level state, so this is idempotent across sibling cards.
|
||||||
|
useEffect(() => () => stopPattern(), [])
|
||||||
|
|
||||||
|
if (!realized) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
role="group"
|
||||||
|
aria-label={`${playLabel ?? 'bass pattern'} — unavailable`}
|
||||||
|
className="flex min-h-[72px] min-w-[140px] flex-col items-center justify-center rounded-md border border-dashed border-border p-2 text-gray-500"
|
||||||
|
>
|
||||||
|
<span className="text-lg leading-none" aria-hidden="true">—</span>
|
||||||
|
<span className="mt-1 text-[10px]">pattern unavailable</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const layout = layoutPattern(realized)
|
||||||
|
const pitchNames = realized.map((n) => absName(n.abs)).join(', ')
|
||||||
|
const label = playLabel ?? 'Bass pattern'
|
||||||
|
|
||||||
|
return (
|
||||||
|
<figure className="flex w-[220px] min-w-0 shrink-0 flex-col gap-1.5 rounded-md border border-border bg-surface p-2">
|
||||||
|
<figcaption
|
||||||
|
className="text-[11px] font-medium leading-tight text-gray-300"
|
||||||
|
title={feel ?? undefined}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</figcaption>
|
||||||
|
<div className="max-w-full overflow-x-auto">
|
||||||
|
<PatternSvg
|
||||||
|
layout={layout}
|
||||||
|
ariaLabel={`Bass tab for ${chordLabel ?? 'this chord'} — ${label}: ${pitchNames}`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{note && <p className="text-[10px] leading-snug text-gray-500">{note}</p>}
|
||||||
|
<PlayButton
|
||||||
|
ariaLabel={`Play ${chordLabel ?? 'chord'} bass pattern — ${label}`}
|
||||||
|
onClick={() => playPattern(realized)}
|
||||||
|
/>
|
||||||
|
</figure>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import ChordBox from './ChordBox'
|
import ChordBox from './ChordBox'
|
||||||
import MiniPiano from './MiniPiano'
|
import MiniPiano from './MiniPiano'
|
||||||
|
import VoicingBrowser from './VoicingBrowser'
|
||||||
import { getGuitarVoicings, getPianoTechniques, parseChord } from '../lib/voicings'
|
import { getGuitarVoicings, getPianoTechniques, parseChord } from '../lib/voicings'
|
||||||
import { CHORD_TYPES, NOTES, getChordsInKey, toRomanNumeral, getSuggestedProgressions } from '../lib/theory'
|
import { CHORD_TYPES, NOTES, getChordsInKey, toRomanNumeral, getSuggestedProgressions } from '../lib/theory'
|
||||||
import { FAMOUS_PROGRESSIONS, progressionInKey, getChordSubstitutions, CHORD_PLAYBOOK } from '../lib/education'
|
import { FAMOUS_PROGRESSIONS, progressionInKey, getChordSubstitutions, CHORD_PLAYBOOK } from '../lib/education'
|
||||||
@@ -29,36 +30,50 @@ function chordDisplayName(root, typeKey) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function GuitarTab({ chordName }) {
|
function GuitarTab({ chordName }) {
|
||||||
|
// parseChord's `type` is a CHORD_TYPES key — exactly VoicingBrowser's
|
||||||
|
// `quality` prop (same mapping PianoTab/ExploreTab already rely on). L-21.
|
||||||
|
const parsed = parseChord(chordName)
|
||||||
const voicings = getGuitarVoicings(chordName)
|
const voicings = getGuitarVoicings(chordName)
|
||||||
if (!voicings.length) {
|
if (!parsed && !voicings.length) {
|
||||||
return <p className="text-gray-500 text-sm text-center py-8">No guitar voicings found for {chordName}.</p>
|
return <p className="text-gray-500 text-sm text-center py-8">No guitar voicings found for {chordName}.</p>
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="flex flex-col gap-5">
|
||||||
<p className="text-xs text-gray-500 mb-4">
|
{/* Playable voicing browser (D-21) — browse + audition shapes.
|
||||||
Click any voicing to learn it. Purple = chord tones. Finger numbers inside dots (1=index, 4=pinky).
|
Instrument-scoped to this tab via `show` (task L-25). */}
|
||||||
Barre chords show the fret number on the left.
|
{parsed && <VoicingBrowser rootPc={parsed.rootPc} quality={parsed.type} show="guitar" />}
|
||||||
</p>
|
|
||||||
<div className="flex flex-wrap gap-6 justify-start">
|
{/* Static grid kept as the fingering reference — it carries finger
|
||||||
{voicings.map((v, i) => (
|
numbers and barre info the browser doesn't show. */}
|
||||||
<div key={i} className="flex flex-col items-center gap-1 p-3 rounded-xl bg-surface border border-border hover:border-accent/40 transition-colors">
|
{voicings.length > 0 && (
|
||||||
<ChordBox
|
<div>
|
||||||
frets={v.frets}
|
<p className="text-[11px] uppercase tracking-wider text-gray-600 mb-2">More grips — fingering reference</p>
|
||||||
fingers={v.fingers}
|
<p className="text-xs text-gray-500 mb-4">
|
||||||
barre={v.barre}
|
Click any voicing to learn it. Purple = chord tones. Finger numbers inside dots (1=index, 4=pinky).
|
||||||
baseFret={v.baseFret}
|
Barre chords show the fret number on the left.
|
||||||
/>
|
</p>
|
||||||
<p className="text-[11px] text-gray-400 text-center mt-1 max-w-[120px] leading-tight">{v.label}</p>
|
<div className="flex flex-wrap gap-6 justify-start">
|
||||||
|
{voicings.map((v, i) => (
|
||||||
|
<div key={i} className="flex flex-col items-center gap-1 p-3 rounded-xl bg-surface border border-border hover:border-accent/40 transition-colors">
|
||||||
|
<ChordBox
|
||||||
|
frets={v.frets}
|
||||||
|
fingers={v.fingers}
|
||||||
|
barre={v.barre}
|
||||||
|
baseFret={v.baseFret}
|
||||||
|
/>
|
||||||
|
<p className="text-[11px] text-gray-400 text-center mt-1 max-w-[120px] leading-tight">{v.label}</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
))}
|
<div className="mt-4 p-3 rounded-lg bg-surface border border-border">
|
||||||
</div>
|
<p className="text-xs text-gray-500">
|
||||||
<div className="mt-4 p-3 rounded-lg bg-surface border border-border">
|
<span className="text-accent font-semibold">Pro tip:</span> Learn the E-shape and A-shape barres first
|
||||||
<p className="text-xs text-gray-500">
|
— they cover all 12 roots. Then add open voicings for the keys you play in most.
|
||||||
<span className="text-accent font-semibold">Pro tip:</span> Learn the E-shape and A-shape barres first
|
High-fret voicings (above fret 7) work great as jazz comping shapes in a band mix.
|
||||||
— they cover all 12 roots. Then add open voicings for the keys you play in most.
|
</p>
|
||||||
High-fret voicings (above fret 7) work great as jazz comping shapes in a band mix.
|
</div>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -68,17 +83,28 @@ function PianoTab({ chordName }) {
|
|||||||
const techniques = getPianoTechniques(chordName)
|
const techniques = getPianoTechniques(chordName)
|
||||||
const rootPc = parsed?.rootPc ?? 0
|
const rootPc = parsed?.rootPc ?? 0
|
||||||
|
|
||||||
if (!techniques.length) {
|
if (!parsed && !techniques.length) {
|
||||||
return <p className="text-gray-500 text-sm text-center py-8">No piano techniques for {chordName}.</p>
|
return <p className="text-gray-500 text-sm text-center py-8">No piano techniques for {chordName}.</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
|
{/* Playable voicing browser (D-21) — parseChord's `type` maps 1:1 to the
|
||||||
|
browser's `quality` (CHORD_TYPES key). L-21. Piano-scoped via `show` (L-25). */}
|
||||||
|
{parsed && <VoicingBrowser rootPc={parsed.rootPc} quality={parsed.type} show="piano" />}
|
||||||
|
|
||||||
|
{/* Technique cards kept below — the name/desc/tip text and LH/RH note
|
||||||
|
breakdown are not covered by the browser. */}
|
||||||
|
{techniques.length > 0 && (
|
||||||
|
<p className="text-[11px] uppercase tracking-wider text-gray-600 mt-1">Techniques — how to use it at the keys</p>
|
||||||
|
)}
|
||||||
|
{techniques.length > 0 && (
|
||||||
<p className="text-xs text-gray-500">
|
<p className="text-xs text-gray-500">
|
||||||
<span className="text-blue-400 font-semibold">Blue = Left hand</span> ·
|
<span className="text-blue-400 font-semibold">Blue = Left hand</span> ·
|
||||||
<span className="text-accent font-semibold">Purple = Right hand</span> ·
|
<span className="text-accent font-semibold">Purple = Right hand</span> ·
|
||||||
R marks the root.
|
R marks the root.
|
||||||
</p>
|
</p>
|
||||||
|
)}
|
||||||
{techniques.map((t, i) => (
|
{techniques.map((t, i) => (
|
||||||
<div key={i} className="p-4 rounded-xl bg-surface border border-border hover:border-accent/30 transition-colors">
|
<div key={i} className="p-4 rounded-xl bg-surface border border-border hover:border-accent/30 transition-colors">
|
||||||
<div className="flex flex-col lg:flex-row gap-4 items-start">
|
<div className="flex flex-col lg:flex-row gap-4 items-start">
|
||||||
|
|||||||
@@ -0,0 +1,391 @@
|
|||||||
|
// CircleOfFifths — the Knowledge Center's live key map (task D-61).
|
||||||
|
//
|
||||||
|
// A read-only SVG circle of fifths for a jamming musician, not a textbook
|
||||||
|
// poster:
|
||||||
|
//
|
||||||
|
// · Outer ring: the 12 major keys, C at 12 o'clock, fifths clockwise.
|
||||||
|
// Each wedge carries its key-signature glyph (♮ / n♯ / n♭).
|
||||||
|
// · Inner ring: the relative minors, aligned with their majors.
|
||||||
|
// · LIVE: the detected/locked key (keyInfo = App's effectiveKey, flowing
|
||||||
|
// through KnowledgeDock → ExploreSection) lights its wedge in accent; its
|
||||||
|
// fifths neighbours (subdominant, dominant) and its relative get a soft
|
||||||
|
// accent tier — the "safe keys to wander to" story with zero interaction.
|
||||||
|
// Modal keys pick their ring by the mode's third (dorian/phrygian → the
|
||||||
|
// minor ring), derived from theory.js SCALES — never re-derived here.
|
||||||
|
// · The highlighted key's diatonic chords (theory.js getChordsInKey) are
|
||||||
|
// listed beside the circle inline — no hover, no click required.
|
||||||
|
// · OPTIONAL tap: any wedge previews that key's diatonics in the side panel
|
||||||
|
// (dashed outline marks the previewed wedge; the live highlight never
|
||||||
|
// moves). Tapping NEVER changes app key state — this surface is read-only.
|
||||||
|
// · No key detected → neutral circle with honest microcopy.
|
||||||
|
//
|
||||||
|
// Purely presentational: props in ({ keyInfo, onChordClick }), nothing out.
|
||||||
|
// Keyboard: every wedge is a focusable button (Enter/Space previews); focus
|
||||||
|
// draws an explicit accent-soft stroke (SVG-safe — no reliance on box-shadow).
|
||||||
|
//
|
||||||
|
// Design tokens (tailwind.config.js) — literal here because SVG paint
|
||||||
|
// attributes can't read Tailwind classes (MiniPiano/Fretboard precedent):
|
||||||
|
// accent #a855f7, surface #0f0f0f, panel #1a1a1a, border #2a2a2a. No new
|
||||||
|
// colours: #c084fc is MiniPiano's established soft accent; greys are the
|
||||||
|
// Tailwind gray-300/400 already used across the app's SVGs.
|
||||||
|
|
||||||
|
import { useMemo, useState } from 'react'
|
||||||
|
import { NOTES, SCALES, getChordsInKey, toRomanNumeral } from '../lib/theory'
|
||||||
|
import { parseChord } from '../lib/voicings'
|
||||||
|
|
||||||
|
// ─── Token literals (SVG paint attrs; see header) ─────────────────────────────
|
||||||
|
const ACCENT = '#a855f7' // bg-accent — the live key wedge
|
||||||
|
const ACCENT_SOFT = '#c084fc' // MiniPiano's soft accent — neighbour-tier text
|
||||||
|
const SURFACE = '#0f0f0f' // bg-surface — wedge gaps + text on accent (AA 4.84:1)
|
||||||
|
const PANEL = '#1a1a1a' // bg-panel — idle wedge fill
|
||||||
|
const BORDER = '#2a2a2a' // border-border — centre hub stroke
|
||||||
|
const TEXT_MAIN = '#d1d5db' // gray-300 — idle key names (11.4:1 on panel)
|
||||||
|
const TEXT_DIM = '#9ca3af' // gray-400 — signature glyphs, microcopy (6.4:1)
|
||||||
|
|
||||||
|
// ─── The circle, index 0 = 12 o'clock, fifths clockwise ───────────────────────
|
||||||
|
// Display spelling is the conventional poster mix (flats on the flat side);
|
||||||
|
// all LOGIC runs on pitch classes so detection's sharp spellings match fine.
|
||||||
|
const MAJOR_LABELS = ['C','G','D','A','E','B','F♯','D♭','A♭','E♭','B♭','F']
|
||||||
|
const MINOR_LABELS = ['Am','Em','Bm','F♯m','C♯m','G♯m','E♭m','B♭m','Fm','Cm','Gm','Dm']
|
||||||
|
const SIG_GLYPHS = ['♮','1♯','2♯','3♯','4♯','5♯','6♯','5♭','4♭','3♭','2♭','1♭']
|
||||||
|
|
||||||
|
const majorPcAt = (i) => (i * 7) % 12 // wedge index → major tonic pc
|
||||||
|
const minorPcAt = (i) => (i * 7 + 9) % 12 // wedge index → relative minor pc
|
||||||
|
const majorIdxOf = (pc) => (pc * 7) % 12 // 7·7 ≡ 1 (mod 12): self-inverse
|
||||||
|
const minorIdxOf = (pc) => majorIdxOf((pc + 3) % 12)
|
||||||
|
|
||||||
|
const sigWords = (i) =>
|
||||||
|
i === 0 ? 'no sharps or flats' : i <= 6 ? `${i} sharp${i > 1 ? 's' : ''}` : `${12 - i} flat${12 - i > 1 ? 's' : ''}`
|
||||||
|
|
||||||
|
// The MODE's parent major: the unique major scale whose pc-set equals the
|
||||||
|
// mode's pc-set — ITS signature is the mode's true signature (A dorian =
|
||||||
|
// G major's notes = 1♯, not A major's 3♯, and not the tonic wedge's glyph).
|
||||||
|
// Uniqueness proof: the diatonic pc-set has no transpositional symmetry, so
|
||||||
|
// its 12 transpositions are 12 DISTINCT 7-note sets — a given 7-note set can
|
||||||
|
// therefore equal AT MOST one of them. Every key-dropdown mode (major, minor,
|
||||||
|
// dorian, phrygian, lydian, mixolydian) is by definition a rotation of the
|
||||||
|
// diatonic set, so for all 6 modes × 12 roots exactly one parent major exists
|
||||||
|
// (existence: rotating the mode back to its parent). Non-heptatonic scales
|
||||||
|
// (pentatonics, blues) match none — we return null and the hub omits the
|
||||||
|
// signature line rather than guessing.
|
||||||
|
function parentMajorPc(tonicPc, scale) {
|
||||||
|
const pcs = new Set(scale.map((s) => (tonicPc + s) % 12))
|
||||||
|
if (pcs.size !== 7) return null
|
||||||
|
const hits = []
|
||||||
|
for (let p = 0; p < 12; p++) {
|
||||||
|
if (SCALES.major.every((s) => pcs.has((p + s) % 12))) hits.push(p)
|
||||||
|
}
|
||||||
|
return hits.length === 1 ? hits[0] : null
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Geometry (viewBox 0 0 300 300, centre 150) ───────────────────────────────
|
||||||
|
const CX = 150, CY = 150
|
||||||
|
const R_OUT = 142, R_MID = 96, R_IN = 58, R_HUB = 54
|
||||||
|
|
||||||
|
function pt(r, deg) {
|
||||||
|
const t = (deg * Math.PI) / 180 // 0° = 12 o'clock, clockwise
|
||||||
|
return `${(CX + r * Math.sin(t)).toFixed(2)},${(CY - r * Math.cos(t)).toFixed(2)}`
|
||||||
|
}
|
||||||
|
|
||||||
|
function wedgePath(i, r0, r1) {
|
||||||
|
const a0 = i * 30 - 15, a1 = i * 30 + 15
|
||||||
|
return `M ${pt(r1, a0)} A ${r1},${r1} 0 0 1 ${pt(r1, a1)} L ${pt(r0, a1)} A ${r0},${r0} 0 0 0 ${pt(r0, a0)} Z`
|
||||||
|
}
|
||||||
|
|
||||||
|
function labelXY(i, r) {
|
||||||
|
const t = (i * 30 * Math.PI) / 180
|
||||||
|
return { x: CX + r * Math.sin(t), y: CY - r * Math.cos(t) }
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Diatonic chord chips (inline — the core, zero-click payload) ─────────────
|
||||||
|
function ChordChips({ root, mode, onChordClick }) {
|
||||||
|
const chords = getChordsInKey(root, mode)
|
||||||
|
if (!chords.length) return null
|
||||||
|
return (
|
||||||
|
<div className="flex flex-wrap gap-1.5">
|
||||||
|
{chords.map((c) => {
|
||||||
|
const rn = toRomanNumeral(c, root, mode)
|
||||||
|
const inner = (
|
||||||
|
<>
|
||||||
|
<span>{c}</span>
|
||||||
|
{rn && rn !== '?' && (
|
||||||
|
<span className="text-[9px] font-normal opacity-60 leading-none mt-0.5">{rn}</span>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
return onChordClick ? (
|
||||||
|
<button
|
||||||
|
key={c} type="button" onClick={() => onChordClick(c)}
|
||||||
|
title={`Open ${c} voicings`}
|
||||||
|
className="flex flex-col items-center px-2.5 py-1 rounded-lg border text-xs font-bold bg-panel border-border text-gray-300 transition-all outline-none hover:border-accent/50 hover:text-accent focus-visible:ring-2 focus-visible:ring-accent"
|
||||||
|
>
|
||||||
|
{inner}
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<span key={c} className="flex flex-col items-center px-2.5 py-1 rounded-lg border text-xs font-bold bg-panel border-border text-gray-300">
|
||||||
|
{inner}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── The component ────────────────────────────────────────────────────────────
|
||||||
|
export default function CircleOfFifths({ keyInfo, onChordClick }) {
|
||||||
|
const [preview, setPreview] = useState(null) // { ring, idx } | null — local only
|
||||||
|
const [hot, setHot] = useState(null) // 'ring-idx' hovered/focused wedge
|
||||||
|
|
||||||
|
// Live key → ring + wedge index. Ring by the MODE'S THIRD (SCALES, theory.js):
|
||||||
|
// minor/dorian/phrygian sit on the minor ring at their tonic — A minor (or
|
||||||
|
// A dorian) lights the inner "Am" wedge, NOT outer C.
|
||||||
|
const live = useMemo(() => {
|
||||||
|
if (!keyInfo?.root) return null
|
||||||
|
const pc = parseChord(keyInfo.root)?.rootPc
|
||||||
|
if (pc == null) return null
|
||||||
|
const mode = keyInfo.mode ?? 'major'
|
||||||
|
const scale = SCALES[mode] ?? SCALES.major
|
||||||
|
// Minor third AND no major third — a bare scale[2] === 3 check would
|
||||||
|
// misfile the hexatonic blues scale [0,3,5,6,7,10] (carries both colours)
|
||||||
|
// if it ever reached the key dropdown.
|
||||||
|
const minorish = scale.includes(3) && !scale.includes(4)
|
||||||
|
const parentPc = parentMajorPc(pc, scale)
|
||||||
|
return {
|
||||||
|
pc, mode,
|
||||||
|
ring: minorish ? 'minor' : 'major',
|
||||||
|
idx: minorish ? minorIdxOf(pc) : majorIdxOf(pc),
|
||||||
|
// circle position of the mode's PARENT MAJOR → the true signature glyph
|
||||||
|
sigIdx: parentPc == null ? null : majorIdxOf(parentPc),
|
||||||
|
}
|
||||||
|
}, [keyInfo])
|
||||||
|
|
||||||
|
// Tier per wedge: 2 = the live key (accent), 1 = its safe neighbours
|
||||||
|
// (subdominant · dominant on the same ring, relative on the other), 0 = idle.
|
||||||
|
function tierOf(ring, idx) {
|
||||||
|
if (!live) return 0
|
||||||
|
if (live.ring === ring) {
|
||||||
|
if (idx === live.idx) return 2
|
||||||
|
if (idx === (live.idx + 1) % 12 || idx === (live.idx + 11) % 12) return 1
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return idx === live.idx ? 1 : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
const isLiveWedge = (ring, idx) => live && live.ring === ring && live.idx === idx
|
||||||
|
|
||||||
|
function tapWedge(ring, idx) {
|
||||||
|
if (isLiveWedge(ring, idx)) { setPreview(null); return } // tapping home = back to live
|
||||||
|
setPreview((p) => (p && p.ring === ring && p.idx === idx ? null : { ring, idx }))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build both rings' wedges; paint order = idle → neighbours → live → preview
|
||||||
|
// → hot, so highlight strokes always win the shared edges.
|
||||||
|
const wedges = []
|
||||||
|
for (const ring of ['major', 'minor']) {
|
||||||
|
const outer = ring === 'major'
|
||||||
|
for (let idx = 0; idx < 12; idx++) {
|
||||||
|
const tier = tierOf(ring, idx)
|
||||||
|
const previewed = preview && preview.ring === ring && preview.idx === idx
|
||||||
|
const id = `${ring}-${idx}`
|
||||||
|
const name = outer ? MAJOR_LABELS[idx] : MINOR_LABELS[idx]
|
||||||
|
const aria = outer
|
||||||
|
? `${name} major, ${sigWords(idx)}${tier === 2 ? ' — the live key' : ''}. Preview its chords.`
|
||||||
|
: `${MINOR_LABELS[idx].replace(/m$/, '')} minor, relative of ${MAJOR_LABELS[idx]} major${tier === 2 ? ' — the live key' : ''}. Preview its chords.`
|
||||||
|
wedges.push({
|
||||||
|
ring, idx, id, tier, previewed, outer, aria,
|
||||||
|
z: hot === id ? 5 : previewed ? 4 : tier + 1,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wedges.sort((a, b) => a.z - b.z)
|
||||||
|
|
||||||
|
// Side panel: the previewed key wins the panel; the LIVE view stays complete
|
||||||
|
// without any tap (live highlight + its chords render by default).
|
||||||
|
// Preview title is spelled SHARP-side from NOTES, matching its chips:
|
||||||
|
// getChordsInKey emits the app-wide sharp spelling (theory.js noteName), and
|
||||||
|
// those names flow into onChordClick → ChordDetailModal, so re-spelling the
|
||||||
|
// chips flat would add a divergent naming layer in front of the modal. One
|
||||||
|
// spelling authority (NOTES) for title + chips + modal; the WEDGE keeps its
|
||||||
|
// poster label (E♭) for at-a-glance reading.
|
||||||
|
let shown = null
|
||||||
|
if (preview) {
|
||||||
|
const root = NOTES[preview.ring === 'major' ? majorPcAt(preview.idx) : minorPcAt(preview.idx)]
|
||||||
|
const mode = preview.ring === 'major' ? 'major' : 'minor'
|
||||||
|
shown = { root, mode, title: `${root} ${mode}`, isPreview: true }
|
||||||
|
} else if (live) {
|
||||||
|
shown = { root: keyInfo.root, mode: live.mode, title: `${keyInfo.root} ${live.mode}`, isPreview: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Neighbour names for the live key (the tier-1 wedges, spelled out).
|
||||||
|
const neighbours = live && {
|
||||||
|
sub: (live.ring === 'major' ? MAJOR_LABELS : MINOR_LABELS)[(live.idx + 11) % 12],
|
||||||
|
dom: (live.ring === 'major' ? MAJOR_LABELS : MINOR_LABELS)[(live.idx + 1) % 12],
|
||||||
|
rel: (live.ring === 'major' ? MINOR_LABELS : MAJOR_LABELS)[live.idx],
|
||||||
|
relWord: live.ring === 'major' ? 'relative minor' : 'relative major',
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section
|
||||||
|
aria-label="Circle of fifths"
|
||||||
|
className="p-3 bg-surface border border-border rounded-xl flex flex-wrap gap-x-5 gap-y-3 items-start"
|
||||||
|
>
|
||||||
|
{/* ── The circle ── */}
|
||||||
|
<svg
|
||||||
|
viewBox="0 0 300 300"
|
||||||
|
role="group"
|
||||||
|
aria-label={live
|
||||||
|
? `Circle of fifths, live key ${keyInfo.root} ${live.mode}`
|
||||||
|
: 'Circle of fifths, no key detected yet'}
|
||||||
|
className="w-[248px] max-w-full h-auto shrink-0 mx-auto select-none"
|
||||||
|
>
|
||||||
|
{/* wedges (paint-ordered) */}
|
||||||
|
{wedges.map((w) => {
|
||||||
|
const [r0, r1] = w.outer ? [R_MID, R_OUT] : [R_IN, R_MID]
|
||||||
|
const stroke = hot === w.id ? ACCENT_SOFT : w.previewed ? ACCENT : SURFACE
|
||||||
|
return (
|
||||||
|
<path
|
||||||
|
key={w.id}
|
||||||
|
d={wedgePath(w.idx, r0, r1)}
|
||||||
|
fill={w.tier === 0 ? PANEL : ACCENT}
|
||||||
|
fillOpacity={w.tier === 1 ? 0.22 : 1}
|
||||||
|
stroke={stroke}
|
||||||
|
strokeWidth={hot === w.id || w.previewed ? 2 : 1.25}
|
||||||
|
strokeDasharray={w.previewed && hot !== w.id ? '4 3' : undefined}
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
|
aria-label={w.aria}
|
||||||
|
aria-pressed={!!w.previewed}
|
||||||
|
className="cursor-pointer outline-none"
|
||||||
|
onClick={() => tapWedge(w.ring, w.idx)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); tapWedge(w.ring, w.idx) }
|
||||||
|
}}
|
||||||
|
onPointerEnter={() => setHot(w.id)}
|
||||||
|
onPointerLeave={() => setHot((h) => (h === w.id ? null : h))}
|
||||||
|
onFocus={() => setHot(w.id)}
|
||||||
|
onBlur={() => setHot((h) => (h === w.id ? null : h))}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
|
{/* labels (own layer, never swallow clicks) */}
|
||||||
|
{Array.from({ length: 12 }, (_, i) => {
|
||||||
|
const tMaj = tierOf('major', i), tMin = tierOf('minor', i)
|
||||||
|
const name = labelXY(i, 123)
|
||||||
|
const glyph = labelXY(i, 106)
|
||||||
|
const minor = labelXY(i, 77)
|
||||||
|
return (
|
||||||
|
<g key={i} pointerEvents="none">
|
||||||
|
<text x={name.x} y={name.y} textAnchor="middle" dominantBaseline="middle"
|
||||||
|
fontSize="13" fontWeight="700"
|
||||||
|
fill={tMaj === 2 ? SURFACE : tMaj === 1 ? ACCENT_SOFT : TEXT_MAIN}>
|
||||||
|
{MAJOR_LABELS[i]}
|
||||||
|
</text>
|
||||||
|
<text x={glyph.x} y={glyph.y} textAnchor="middle" dominantBaseline="middle"
|
||||||
|
fontSize="8.5"
|
||||||
|
fill={tMaj === 2 ? SURFACE : tMaj === 1 ? ACCENT_SOFT : TEXT_DIM}>
|
||||||
|
{SIG_GLYPHS[i]}
|
||||||
|
</text>
|
||||||
|
<text x={minor.x} y={minor.y} textAnchor="middle" dominantBaseline="middle"
|
||||||
|
fontSize="11" fontWeight={tMin === 2 ? '700' : '600'}
|
||||||
|
fill={tMin === 2 ? SURFACE : tMin === 1 ? ACCENT_SOFT : TEXT_DIM}>
|
||||||
|
{MINOR_LABELS[i]}
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
|
{/* centre hub — always the LIVE state (the glance anchor) */}
|
||||||
|
<circle cx={CX} cy={CY} r={R_HUB} fill={SURFACE} stroke={BORDER} strokeWidth="1" />
|
||||||
|
{live ? (
|
||||||
|
<g pointerEvents="none">
|
||||||
|
<text x={CX} y={CY - 10} textAnchor="middle" fontSize="14" fontWeight="800" fill={ACCENT}>
|
||||||
|
{keyInfo.root} {live.mode}
|
||||||
|
</text>
|
||||||
|
{/* The MODE's signature (parent major), not the wedge's — A dorian
|
||||||
|
reads "1♯ · G major's notes", matching the F♯ in its chips. */}
|
||||||
|
{live.sigIdx != null && (
|
||||||
|
<text x={CX} y={CY + 6} textAnchor="middle" fontSize="8.5" fill={TEXT_DIM}>
|
||||||
|
{SIG_GLYPHS[live.sigIdx]} · {live.mode === 'major'
|
||||||
|
? sigWords(live.sigIdx)
|
||||||
|
: `${MAJOR_LABELS[live.sigIdx]} major's notes`}
|
||||||
|
</text>
|
||||||
|
)}
|
||||||
|
<text x={CX} y={CY + 21} textAnchor="middle" fontSize="8" fontWeight="700"
|
||||||
|
letterSpacing="1.5" fill={ACCENT_SOFT}>
|
||||||
|
LIVE
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
) : (
|
||||||
|
<g pointerEvents="none">
|
||||||
|
<text x={CX} y={CY - 8} textAnchor="middle" fontSize="11" fontWeight="700" fill={TEXT_MAIN}>
|
||||||
|
No key yet
|
||||||
|
</text>
|
||||||
|
<text x={CX} y={CY + 7} textAnchor="middle" fontSize="8.5" fill={TEXT_DIM}>
|
||||||
|
play a few chords —
|
||||||
|
</text>
|
||||||
|
<text x={CX} y={CY + 18} textAnchor="middle" fontSize="8.5" fill={TEXT_DIM}>
|
||||||
|
the circle lights up
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
)}
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
{/* ── Beside the circle: the highlighted key's diatonics, inline ── */}
|
||||||
|
<div className="flex-1 min-w-[220px] flex flex-col gap-2.5">
|
||||||
|
<h4 className="text-[10px] font-semibold uppercase tracking-widest text-gray-500">
|
||||||
|
Circle of fifths
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
{shown ? (
|
||||||
|
<>
|
||||||
|
<div className="flex items-center flex-wrap gap-2">
|
||||||
|
<span className="font-bold text-white text-sm">{shown.title}</span>
|
||||||
|
{shown.isPreview ? (
|
||||||
|
<>
|
||||||
|
<span className="text-[9px] uppercase tracking-wide font-semibold text-amber border border-amber/40 rounded px-1.5 py-px">
|
||||||
|
preview
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setPreview(null)}
|
||||||
|
className="text-[11px] text-accent underline underline-offset-2 outline-none hover:text-white focus-visible:ring-2 focus-visible:ring-accent rounded"
|
||||||
|
>
|
||||||
|
back to live
|
||||||
|
</button>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<span className="text-[9px] uppercase tracking-wide font-semibold text-accent border border-accent/40 rounded px-1.5 py-px">
|
||||||
|
live
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ChordChips root={shown.root} mode={shown.mode} onChordClick={onChordClick} />
|
||||||
|
|
||||||
|
{!shown.isPreview && neighbours && (
|
||||||
|
<p className="text-[11px] text-gray-400">
|
||||||
|
Safe keys to wander to:{' '}
|
||||||
|
<span className="text-accent font-semibold">{neighbours.sub}</span> (subdominant) ·{' '}
|
||||||
|
<span className="text-accent font-semibold">{neighbours.dom}</span> (dominant) ·{' '}
|
||||||
|
<span className="text-accent font-semibold">{neighbours.rel}</span> ({neighbours.relWord})
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<p className="text-sm text-gray-400">
|
||||||
|
When a key is detected (or locked), its wedge lights up here with the chords that
|
||||||
|
live in it. Tap any wedge to peek at another key meanwhile.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<p className="text-xs text-gray-400 leading-snug">
|
||||||
|
Keys next to each other on the circle share six of their seven notes, so sliding one
|
||||||
|
step — clockwise to the dominant, counter-clockwise to the subdominant — barely moves
|
||||||
|
the ground under the band. The inner ring is each key's relative minor: the same
|
||||||
|
notes with a darker home base. The further apart two keys sit, the bolder the jump sounds.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
+291
-76
@@ -1,6 +1,25 @@
|
|||||||
import { useState } from 'react'
|
// ExplorePanel — refactored into Knowledge Center parts (task L-22, per
|
||||||
|
// docs/design/knowledge-center.md §7 step 1).
|
||||||
|
//
|
||||||
|
// This file now exports the named building blocks the Knowledge Center shell
|
||||||
|
// (JamGuide.jsx) composes:
|
||||||
|
//
|
||||||
|
// <LevelChips levels onToggle/> — the shared foundation/intermediate filter
|
||||||
|
// <ChordPickerToolbar …/> — controlled root × quality picker row
|
||||||
|
// <ExploreSection …/> — KB progression browser + famous progressions
|
||||||
|
// <VoicingsSection …/> — picker (follows the live chord) → VoicingBrowser
|
||||||
|
//
|
||||||
|
// The default export remains a thin standalone composition of the parts (the
|
||||||
|
// panel is verified-orphaned — no importer — so it exists only so the file
|
||||||
|
// stays a complete, mountable component). GuitarGrid/PianoGrid are kept as
|
||||||
|
// exported no-audio fallbacks per the D-20 IA map (§2).
|
||||||
|
|
||||||
|
import { useEffect, useMemo, useState } from 'react'
|
||||||
import ChordBox from './ChordBox'
|
import ChordBox from './ChordBox'
|
||||||
|
import CircleOfFifths from './CircleOfFifths'
|
||||||
import MiniPiano from './MiniPiano'
|
import MiniPiano from './MiniPiano'
|
||||||
|
import VoicingBrowser from './VoicingBrowser'
|
||||||
|
import kb from '../data/kb/index.js'
|
||||||
import { getGuitarVoicings, getPianoTechniques, parseChord } from '../lib/voicings'
|
import { getGuitarVoicings, getPianoTechniques, parseChord } from '../lib/voicings'
|
||||||
import { CHORD_TYPES, NOTES, getChordsInKey, toRomanNumeral } from '../lib/theory'
|
import { CHORD_TYPES, NOTES, getChordsInKey, toRomanNumeral } from '../lib/theory'
|
||||||
import { FAMOUS_PROGRESSIONS, progressionInKey } from '../lib/education'
|
import { FAMOUS_PROGRESSIONS, progressionInKey } from '../lib/education'
|
||||||
@@ -24,6 +43,66 @@ const CHORD_TYPE_OPTIONS = [
|
|||||||
|
|
||||||
const MAJOR_TYPES = new Set(['maj','maj7','maj6','add9','sus4','sus2','aug','dom7'])
|
const MAJOR_TYPES = new Set(['maj','maj7','maj6','add9','sus4','sus2','aug','dom7'])
|
||||||
|
|
||||||
|
// Progressions/licks without a `level` count as foundation (D-20 §4).
|
||||||
|
const levelOf = (item) => (item?.level === 'intermediate' ? 'intermediate' : 'foundation')
|
||||||
|
|
||||||
|
// ─── Level filter chips (shared by Explore + Licks toolbars) ──────────────────
|
||||||
|
// Two toggle chips, both on by default. The SHELL owns the `levels` state
|
||||||
|
// ({foundation, intermediate}) and enforces "both can't be off"; the chip for
|
||||||
|
// the last active level advertises the no-op via its title.
|
||||||
|
export function LevelChips({ levels = {}, onToggle }) {
|
||||||
|
const defs = [
|
||||||
|
{ key: 'foundation', label: 'Foundation' },
|
||||||
|
{ key: 'intermediate', label: 'Intermediate' },
|
||||||
|
]
|
||||||
|
return (
|
||||||
|
<div className="flex items-center gap-1" role="group" aria-label="Level filter">
|
||||||
|
{defs.map(d => {
|
||||||
|
const active = !!levels[d.key]
|
||||||
|
const lastActive = active && !defs.some(o => o.key !== d.key && levels[o.key])
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={d.key}
|
||||||
|
type="button"
|
||||||
|
aria-pressed={active}
|
||||||
|
onClick={() => onToggle?.(d.key)}
|
||||||
|
title={lastActive
|
||||||
|
? 'At least one level stays on'
|
||||||
|
: `${active ? 'Hide' : 'Show'} ${d.label.toLowerCase()} material`}
|
||||||
|
className={`min-h-[32px] px-2.5 py-1 rounded-lg border text-xs transition-colors outline-none focus-visible:ring-2 focus-visible:ring-accent ${
|
||||||
|
active
|
||||||
|
? 'bg-accent/20 border-accent text-accent font-semibold'
|
||||||
|
: 'bg-surface border-border text-gray-400 hover:text-gray-200 hover:border-gray-500'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{d.label}
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Level badge on cards — mirrors LickCard's badge treatment (amber = the
|
||||||
|
// existing secondary-tone token; foundation stays quiet).
|
||||||
|
function LevelBadge({ level }) {
|
||||||
|
if (level === 'intermediate') {
|
||||||
|
return (
|
||||||
|
<span className="shrink-0 text-[9px] uppercase tracking-wide font-semibold text-amber border border-amber/40 rounded px-1.5 py-px">
|
||||||
|
intermediate
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (level === 'foundation') {
|
||||||
|
return (
|
||||||
|
<span className="shrink-0 text-[9px] uppercase tracking-wide font-semibold text-gray-400 border border-border rounded px-1.5 py-px">
|
||||||
|
foundation
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
// ─── Quick-pick chip row ──────────────────────────────────────────────────────
|
// ─── Quick-pick chip row ──────────────────────────────────────────────────────
|
||||||
function ChipRow({ label, chords, active, keyInfo, onSelect }) {
|
function ChipRow({ label, chords, active, keyInfo, onSelect }) {
|
||||||
if (!chords?.length) return null
|
if (!chords?.length) return null
|
||||||
@@ -35,7 +114,7 @@ function ChipRow({ label, chords, active, keyInfo, onSelect }) {
|
|||||||
const rn = keyInfo?.root ? toRomanNumeral(chord, keyInfo.root, keyInfo.mode) : ''
|
const rn = keyInfo?.root ? toRomanNumeral(chord, keyInfo.root, keyInfo.mode) : ''
|
||||||
return (
|
return (
|
||||||
<button key={chord} onClick={() => onSelect(chord)}
|
<button key={chord} onClick={() => onSelect(chord)}
|
||||||
className={`flex flex-col items-center px-2.5 py-1 rounded-lg border text-xs font-bold transition-all ${
|
className={`flex flex-col items-center px-2.5 py-1 rounded-lg border text-xs font-bold transition-all outline-none focus-visible:ring-2 focus-visible:ring-accent ${
|
||||||
active === chord
|
active === chord
|
||||||
? 'bg-accent border-accent text-white'
|
? 'bg-accent border-accent text-white'
|
||||||
: 'bg-surface border-border text-gray-300 hover:border-accent/50 hover:text-accent'
|
: 'bg-surface border-border text-gray-300 hover:border-accent/50 hover:text-accent'
|
||||||
@@ -50,8 +129,38 @@ function ChipRow({ label, chords, active, keyInfo, onSelect }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Guitar voicings grid ─────────────────────────────────────────────────────
|
// ─── Chord picker toolbar (controlled: root × quality) ───────────────────────
|
||||||
function GuitarGrid({ chordName }) {
|
export function ChordPickerToolbar({ root, typeKey, onRootChange, onTypeChange }) {
|
||||||
|
const chordName = root + (CHORD_TYPES[typeKey]?.suffix ?? '')
|
||||||
|
return (
|
||||||
|
<div className="flex flex-wrap gap-2 items-center p-3 bg-surface border border-border rounded-xl">
|
||||||
|
<div className="flex flex-wrap gap-1">
|
||||||
|
{NOTES.map(n => (
|
||||||
|
<button key={n} type="button" onClick={() => onRootChange?.(n)}
|
||||||
|
aria-pressed={root === n}
|
||||||
|
className={`px-2 py-0.5 rounded text-xs font-bold transition-all outline-none focus-visible:ring-2 focus-visible:ring-accent ${
|
||||||
|
root === n ? 'bg-accent text-white' : 'bg-border text-gray-400 hover:text-white'
|
||||||
|
}`}>
|
||||||
|
{n}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className="w-px h-5 bg-border shrink-0" />
|
||||||
|
<div className="relative">
|
||||||
|
<select value={typeKey} onChange={e => onTypeChange?.(e.target.value)}
|
||||||
|
aria-label="Chord quality"
|
||||||
|
className="appearance-none bg-panel border border-border rounded-lg pl-2 pr-6 py-1 text-xs text-gray-200 cursor-pointer focus:outline-none focus:border-accent">
|
||||||
|
{CHORD_TYPE_OPTIONS.map(o => <option key={o.key} value={o.key}>{o.label}</option>)}
|
||||||
|
</select>
|
||||||
|
<span className="pointer-events-none absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-500 text-xs">▾</span>
|
||||||
|
</div>
|
||||||
|
<div className="text-2xl font-black text-accent ml-2">{chordName}</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Guitar voicings grid (no-audio fallback; superseded by VoicingBrowser) ──
|
||||||
|
export function GuitarGrid({ chordName }) {
|
||||||
const voicings = getGuitarVoicings(chordName)
|
const voicings = getGuitarVoicings(chordName)
|
||||||
if (!voicings.length) return <p className="text-gray-600 text-sm py-4">No voicings for {chordName}.</p>
|
if (!voicings.length) return <p className="text-gray-600 text-sm py-4">No voicings for {chordName}.</p>
|
||||||
return (
|
return (
|
||||||
@@ -71,8 +180,8 @@ function GuitarGrid({ chordName }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Piano techniques grid ────────────────────────────────────────────────────
|
// ─── Piano techniques grid (no-audio fallback; superseded by VoicingBrowser) ─
|
||||||
function PianoGrid({ chordName }) {
|
export function PianoGrid({ chordName }) {
|
||||||
const parsed = parseChord(chordName)
|
const parsed = parseChord(chordName)
|
||||||
const techniques = getPianoTechniques(chordName)
|
const techniques = getPianoTechniques(chordName)
|
||||||
const rootPc = parsed?.rootPc ?? 0
|
const rootPc = parsed?.rootPc ?? 0
|
||||||
@@ -98,6 +207,8 @@ function PianoGrid({ chordName }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ─── Famous progressions using this chord as tonic ───────────────────────────
|
// ─── Famous progressions using this chord as tonic ───────────────────────────
|
||||||
|
// NOTE (D-20 §4, recorded Maestro call): FAMOUS_PROGRESSIONS carries no `level`
|
||||||
|
// field — these cards show no badge and are EXEMPT from the level filter.
|
||||||
function ProgressionCards({ chordName, onChordClick }) {
|
function ProgressionCards({ chordName, onChordClick }) {
|
||||||
const parsed = parseChord(chordName)
|
const parsed = parseChord(chordName)
|
||||||
if (!parsed) return null
|
if (!parsed) return null
|
||||||
@@ -131,7 +242,7 @@ function ProgressionCards({ chordName, onChordClick }) {
|
|||||||
{chordsHere.map((c, i) => (
|
{chordsHere.map((c, i) => (
|
||||||
<span key={i} className="flex items-center gap-1">
|
<span key={i} className="flex items-center gap-1">
|
||||||
<button onClick={() => onChordClick?.(c)}
|
<button onClick={() => onChordClick?.(c)}
|
||||||
className={`px-2.5 py-1 rounded-lg font-bold text-sm border transition-all ${
|
className={`px-2.5 py-1 rounded-lg font-bold text-sm border transition-all outline-none focus-visible:ring-2 focus-visible:ring-accent ${
|
||||||
i === 0
|
i === 0
|
||||||
? 'bg-accent border-accent text-white'
|
? 'bg-accent border-accent text-white'
|
||||||
: 'bg-panel border-border text-gray-200 hover:border-accent/50 hover:text-accent'
|
: 'bg-panel border-border text-gray-200 hover:border-accent/50 hover:text-accent'
|
||||||
@@ -153,15 +264,140 @@ function ProgressionCards({ chordName, onChordClick }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Main panel ───────────────────────────────────────────────────────────────
|
// ─── One KB progression card (the Explore browser hero) ──────────────────────
|
||||||
export default function ExplorePanel({ keyInfo, chordHistory, onChordClick }) {
|
function KbProgressionCard({ prog, keyRootPc, onChordClick }) {
|
||||||
const [open, setOpen] = useState(false)
|
const degrees = prog?.degrees ?? []
|
||||||
|
const qualities = prog?.qualities ?? []
|
||||||
|
const chords = degrees.map((deg, i) => {
|
||||||
|
const pc = (((keyRootPc + deg) % 12) + 12) % 12
|
||||||
|
return `${NOTES[pc]}${CHORD_TYPES[qualities[i]]?.suffix ?? ''}`
|
||||||
|
})
|
||||||
|
const songs = Array.isArray(prog?.songs) ? prog.songs : []
|
||||||
|
return (
|
||||||
|
<div className="p-3 bg-surface border border-border rounded-xl">
|
||||||
|
<div className="flex items-center flex-wrap gap-2 mb-2">
|
||||||
|
<span className="font-bold text-white text-sm">{prog?.name ?? prog?.id ?? 'Untitled'}</span>
|
||||||
|
{Array.isArray(prog?.rn) && prog.rn.length > 0 && (
|
||||||
|
<span className="text-[10px] font-mono text-gray-600">{prog.rn.join(' – ')}</span>
|
||||||
|
)}
|
||||||
|
<LevelBadge level={levelOf(prog)} />
|
||||||
|
</div>
|
||||||
|
{chords.length > 0 && (
|
||||||
|
<div className="flex flex-wrap gap-1.5 items-center mb-2">
|
||||||
|
{chords.map((c, i) => (
|
||||||
|
<span key={i} className="flex items-center gap-1">
|
||||||
|
<button type="button" onClick={() => onChordClick?.(c)}
|
||||||
|
title={`Open ${c} details`}
|
||||||
|
className="px-2.5 py-1 rounded-lg font-bold text-sm border bg-panel border-border text-gray-200 transition-all outline-none hover:border-accent/50 hover:text-accent focus-visible:ring-2 focus-visible:ring-accent">
|
||||||
|
{c}
|
||||||
|
</button>
|
||||||
|
{i < chords.length - 1 && <span className="text-gray-700 text-xs">→</span>}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{prog?.tip && <p className="text-xs text-gray-400 leading-snug">{prog.tip}</p>}
|
||||||
|
{songs.length > 0 && (
|
||||||
|
<p className="text-[11px] text-gray-500 mt-1">{songs.slice(0, 3).join(' · ')}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Explore section — KB progression browser + famous progressions ──────────
|
||||||
|
// Props: keyInfo (chords render in the detected key; C until one is known),
|
||||||
|
// levels + onToggleLevel (shell-owned shared filter), onChordClick (chord name
|
||||||
|
// string → ChordDetailModal).
|
||||||
|
export function ExploreSection({ keyInfo, levels, onToggleLevel, onChordClick }) {
|
||||||
|
const styles = useMemo(
|
||||||
|
() => Object.entries(kb ?? {}).map(([id, s]) => ({ id, label: s?.meta?.label ?? id })),
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
const [styleOverride, setStyleOverride] = useState(null)
|
||||||
|
const activeStyle = styleOverride ?? styles[0]?.id
|
||||||
|
|
||||||
|
const keyRootPc = parseChord(keyInfo?.root ?? '')?.rootPc ?? 0
|
||||||
|
const keyMode = keyInfo?.mode === 'minor' ? 'minor' : 'major'
|
||||||
|
const tonicName = `${NOTES[keyRootPc]}${keyMode === 'minor' ? 'm' : ''}`
|
||||||
|
|
||||||
|
const progressions = kb?.[activeStyle]?.progressions ?? []
|
||||||
|
const visible = progressions.filter(p => levels?.[levelOf(p)])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col gap-4">
|
||||||
|
{/* Toolbar: style chips + shared level filter */}
|
||||||
|
<div className="flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||||
|
<div className="flex items-center gap-1 flex-wrap">
|
||||||
|
{styles.map(s => {
|
||||||
|
const active = s.id === activeStyle
|
||||||
|
return (
|
||||||
|
<button key={s.id} type="button" aria-pressed={active}
|
||||||
|
onClick={() => setStyleOverride(s.id)}
|
||||||
|
className={`px-2.5 py-1 min-h-[32px] rounded-lg text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-accent ${
|
||||||
|
active
|
||||||
|
? 'bg-accent/20 border border-accent text-accent font-semibold'
|
||||||
|
: 'border border-transparent text-gray-400 hover:text-gray-200 hover:border-border'
|
||||||
|
}`}>
|
||||||
|
{s.label}
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
<div className="w-px h-5 bg-border shrink-0" />
|
||||||
|
<LevelChips levels={levels} onToggle={onToggleLevel} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Circle of fifths — live key map with inline diatonics (task D-61).
|
||||||
|
keyInfo here IS App's effectiveKey (App → KnowledgeDock → this section);
|
||||||
|
the circle is read-only — tapping wedges never touches key state. */}
|
||||||
|
<CircleOfFifths keyInfo={keyInfo} onChordClick={onChordClick} />
|
||||||
|
|
||||||
|
<p className="text-[11px] text-gray-500">
|
||||||
|
Chords shown in {NOTES[keyRootPc]} {keyMode}{keyInfo?.root ? '' : ' (no key detected yet)'} · tap any chord for voicings
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{/* KB progression cards */}
|
||||||
|
{visible.length > 0 ? (
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
{visible.map((p, i) => (
|
||||||
|
<KbProgressionCard key={p?.id ?? i} prog={p} keyRootPc={keyRootPc} onChordClick={onChordClick} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<p className="text-sm text-gray-400 py-2">
|
||||||
|
{progressions.length === 0
|
||||||
|
? 'No progressions authored for this style yet.'
|
||||||
|
: 'Nothing at the selected level for this style — flip the level filter back on.'}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Famous progressions (exempt from the level filter — untagged corpus) */}
|
||||||
|
<div className="flex flex-col gap-2 border-t border-border pt-3">
|
||||||
|
<h4 className="text-[10px] font-semibold uppercase tracking-widest text-gray-500">
|
||||||
|
Famous progressions <span className="normal-case tracking-normal font-normal">· not affected by the level filter</span>
|
||||||
|
</h4>
|
||||||
|
<ProgressionCards chordName={tonicName} onChordClick={onChordClick} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Voicings section — picker (follows the live chord) → VoicingBrowser ─────
|
||||||
|
// Props: keyInfo + chordHistory feed the quick-pick chips; currentChord re-aims
|
||||||
|
// the picker whenever a new chord commits (manual picks hold until then).
|
||||||
|
// `instrument` (L-40, D-40 §3) scopes the browser to App's global selector —
|
||||||
|
// omitted (the orphaned standalone panel below) it falls back to 'both' via
|
||||||
|
// VoicingBrowser's own `show` default.
|
||||||
|
export function VoicingsSection({ keyInfo, chordHistory, currentChord, instrument }) {
|
||||||
const [root, setRoot] = useState('C')
|
const [root, setRoot] = useState('C')
|
||||||
const [typeKey, setTypeKey] = useState('maj')
|
const [typeKey, setTypeKey] = useState('maj')
|
||||||
const [view, setView] = useState('guitar') // guitar | piano | progressions
|
|
||||||
const [active, setActive] = useState('')
|
const [active, setActive] = useState('')
|
||||||
|
|
||||||
const chordName = root + (CHORD_TYPES[typeKey]?.suffix ?? '')
|
useEffect(() => {
|
||||||
|
if (!currentChord) return
|
||||||
|
const p = parseChord(currentChord)
|
||||||
|
if (p) { setRoot(NOTES[p.rootPc]); setTypeKey(p.type); setActive(currentChord) }
|
||||||
|
}, [currentChord])
|
||||||
|
|
||||||
function selectChord(chord) {
|
function selectChord(chord) {
|
||||||
setActive(chord)
|
setActive(chord)
|
||||||
@@ -169,79 +405,58 @@ export default function ExplorePanel({ keyInfo, chordHistory, onChordClick }) {
|
|||||||
if (p) { setRoot(NOTES[p.rootPc]); setTypeKey(p.type) }
|
if (p) { setRoot(NOTES[p.rootPc]); setTypeKey(p.type) }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Context-aware quick-picks
|
const recentChords = [...new Set([...(chordHistory ?? [])].reverse())].slice(0, 12)
|
||||||
const recentChords = [...new Set([...(chordHistory ?? [])].reverse())].slice(0, 12)
|
const keyChords = keyInfo?.root ? getChordsInKey(keyInfo.root, keyInfo.mode ?? 'major') : []
|
||||||
const keyChords = keyInfo?.root ? getChordsInKey(keyInfo.root, keyInfo.mode ?? 'major') : []
|
const rootPc = parseChord(root)?.rootPc ?? 0
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col gap-4">
|
||||||
|
{(recentChords.length > 0 || keyChords.length > 0) && (
|
||||||
|
<div className="flex flex-col gap-2.5 p-3 bg-surface border border-border rounded-xl">
|
||||||
|
<ChipRow label="History" chords={recentChords} active={active} keyInfo={keyInfo} onSelect={selectChord} />
|
||||||
|
{keyChords.length > 0 && recentChords.length > 0 && <div className="h-px bg-border" />}
|
||||||
|
{keyChords.length > 0 && (
|
||||||
|
<ChipRow
|
||||||
|
label={keyInfo.root + ' ' + (keyInfo.mode ?? '')}
|
||||||
|
chords={keyChords} active={active} keyInfo={keyInfo} onSelect={selectChord}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<ChordPickerToolbar
|
||||||
|
root={root}
|
||||||
|
typeKey={typeKey}
|
||||||
|
onRootChange={n => { setRoot(n); setActive('') }}
|
||||||
|
onTypeChange={k => { setTypeKey(k); setActive('') }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<VoicingBrowser rootPc={rootPc} quality={typeKey} show={instrument} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Standalone panel (thin composition; orphaned — kept mountable) ──────────
|
||||||
|
export default function ExplorePanel({ keyInfo, chordHistory, currentChord, onChordClick }) {
|
||||||
|
const [open, setOpen] = useState(false)
|
||||||
|
const [levels, setLevels] = useState({ foundation: true, intermediate: true })
|
||||||
|
const toggleLevel = (key) => setLevels(prev => {
|
||||||
|
const next = { ...prev, [key]: !prev[key] }
|
||||||
|
return (next.foundation || next.intermediate) ? next : prev // both can't be off
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-3 bg-panel border border-border rounded-xl overflow-hidden">
|
<div className="mb-3 bg-panel border border-border rounded-xl overflow-hidden">
|
||||||
<button onClick={() => setOpen(v => !v)}
|
<button onClick={() => setOpen(v => !v)} aria-expanded={open}
|
||||||
className="w-full flex items-center justify-between px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-all">
|
className="w-full flex items-center justify-between px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-all">
|
||||||
<span>EXPLORE ANY CHORD</span>
|
<span>EXPLORE ANY CHORD</span>
|
||||||
<span>{open ? '▲' : '▼'}</span>
|
<span>{open ? '▲' : '▼'}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{open && (
|
{open && (
|
||||||
<div className="border-t border-border p-4 flex flex-col gap-4">
|
<div className="border-t border-border p-4 flex flex-col gap-6">
|
||||||
|
<ExploreSection keyInfo={keyInfo} levels={levels} onToggleLevel={toggleLevel} onChordClick={onChordClick} />
|
||||||
{/* ── Context quick-picks ── */}
|
<VoicingsSection keyInfo={keyInfo} chordHistory={chordHistory} currentChord={currentChord} />
|
||||||
{(recentChords.length > 0 || keyChords.length > 0) && (
|
|
||||||
<div className="flex flex-col gap-2.5 p-3 bg-surface border border-border rounded-xl">
|
|
||||||
<ChipRow label="History" chords={recentChords} active={active} keyInfo={keyInfo} onSelect={selectChord} />
|
|
||||||
{keyChords.length > 0 && recentChords.length > 0 && <div className="h-px bg-border" />}
|
|
||||||
{keyChords.length > 0 && (
|
|
||||||
<ChipRow
|
|
||||||
label={keyInfo.root + ' ' + (keyInfo.mode ?? '')}
|
|
||||||
chords={keyChords} active={active} keyInfo={keyInfo} onSelect={selectChord}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* ── Manual chord picker ── */}
|
|
||||||
<div className="flex flex-wrap gap-2 items-center p-3 bg-surface border border-border rounded-xl">
|
|
||||||
<div className="flex flex-wrap gap-1">
|
|
||||||
{NOTES.map(n => (
|
|
||||||
<button key={n} onClick={() => { setRoot(n); setActive('') }}
|
|
||||||
className={`px-2 py-0.5 rounded text-xs font-bold transition-all ${
|
|
||||||
root === n ? 'bg-accent text-white' : 'bg-border text-gray-400 hover:text-white'
|
|
||||||
}`}>
|
|
||||||
{n}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="w-px h-5 bg-border shrink-0" />
|
|
||||||
<div className="relative">
|
|
||||||
<select value={typeKey} onChange={e => { setTypeKey(e.target.value); setActive('') }}
|
|
||||||
className="appearance-none bg-panel border border-border rounded-lg pl-2 pr-6 py-1 text-xs text-gray-200 cursor-pointer focus:outline-none focus:border-accent">
|
|
||||||
{CHORD_TYPE_OPTIONS.map(o => <option key={o.key} value={o.key}>{o.label}</option>)}
|
|
||||||
</select>
|
|
||||||
<span className="pointer-events-none absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-500 text-xs">▾</span>
|
|
||||||
</div>
|
|
||||||
<div className="text-2xl font-black text-accent ml-2">{chordName}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ── View tabs ── */}
|
|
||||||
<div className="flex gap-1 bg-surface border border-border rounded-xl p-1 w-fit">
|
|
||||||
{[
|
|
||||||
{ key: 'guitar', label: '🎸 Guitar Voicings' },
|
|
||||||
{ key: 'piano', label: '🎹 Piano Techniques' },
|
|
||||||
{ key: 'progressions', label: '🎵 Progressions' },
|
|
||||||
].map(t => (
|
|
||||||
<button key={t.key} onClick={() => setView(t.key)}
|
|
||||||
className={`px-3 py-1.5 rounded-lg text-xs font-semibold transition-all whitespace-nowrap ${
|
|
||||||
view === t.key ? 'bg-accent text-white' : 'text-gray-400 hover:text-white'
|
|
||||||
}`}>
|
|
||||||
{t.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ── Content ── */}
|
|
||||||
{view === 'guitar' && <GuitarGrid chordName={chordName} />}
|
|
||||||
{view === 'piano' && <PianoGrid chordName={chordName} />}
|
|
||||||
{view === 'progressions' && <ProgressionCards chordName={chordName} onChordClick={c => { selectChord(c); onChordClick?.(c) }} />}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,279 @@
|
|||||||
|
// GlanceRail — ALL loop stations expanded, always (task D-41, per
|
||||||
|
// docs/design/integrated-glance.md §4; supersedes the L-33 playhead accordion).
|
||||||
|
//
|
||||||
|
// One VERTICAL ROW per loop station, canonical KB order (the same order the
|
||||||
|
// banner's loop shows after rotation). Every row renders its full voicing
|
||||||
|
// gallery PERMANENTLY — the playhead HIGHLIGHTS the active row (accent ring +
|
||||||
|
// "now" badge + aria-current) and never hides, collapses, or reveals content.
|
||||||
|
// User directive 2026-07-10: "i'd like to see all the chords and their
|
||||||
|
// voicings … so you can follow and potentially learn new ways to play it while
|
||||||
|
// you are playing the loop. scrolling is easier then clicking."
|
||||||
|
//
|
||||||
|
// Row anatomy (D-40 §4):
|
||||||
|
// header — chord label + rn (the focus toggle) · "now" badge / "next" tag ·
|
||||||
|
// solo-scale label · aim dots (3rd filled accent, 7th hollow —
|
||||||
|
// RoadmapTrack's GuideDot language, honest "5th" fallback kept) ·
|
||||||
|
// transition chip ("next F→E · ½ step down"; the last row wraps:
|
||||||
|
// "loop"). This is where the retired RoadmapTrack's education
|
||||||
|
// folds in (D-40 §2) — theory.js `guideTones` / `voiceLeadingPairs`
|
||||||
|
// / `soloScale`, read-only imports.
|
||||||
|
// gallery — first cell = the station's OWN voicing (guitar: the KB play's
|
||||||
|
// recommended shape badged "play", when present; piano: the
|
||||||
|
// threaded/authored voicing labeled honestly, e.g. "LH 3-5-7-9" —
|
||||||
|
// the accordion's collapsed-thumb value survives here) + the full
|
||||||
|
// VoicingBrowser gallery (show={instrument}, dense). Cells
|
||||||
|
// FLEX-WRAP — rows never scroll horizontally; the piano worst case
|
||||||
|
// (~1,470px of cells) wraps to a second cell line instead (§4).
|
||||||
|
//
|
||||||
|
// Focus semantics (D-40 §4 — the pin, simplified): with everything always
|
||||||
|
// expanded there is nothing left to hold open, so tapping a row header TOGGLES
|
||||||
|
// that station as focused. The PARENT owns the state and the onFocusChord
|
||||||
|
// emission (the D-03 fretboard guide-tone contract, byte-compatible); a focused
|
||||||
|
// row shows an "aim on fretboard" chip; tap again (or the loop changes) to
|
||||||
|
// clear. This component never emits focus-chord itself and NEVER triggers
|
||||||
|
// audio on its own — every ▶ lives inside the gallery, behind a user gesture.
|
||||||
|
//
|
||||||
|
// NO auto-scroll (D-40 §4/§6.2 step 1): the band lives in page flow, where
|
||||||
|
// scrollIntoView's nearest scroller is the DOCUMENT — it would yank the whole
|
||||||
|
// page mid-jam. The L-33 auto-centre effect was deleted in L-40 and must never
|
||||||
|
// return; the highlight travels, the user owns the scrollbar.
|
||||||
|
//
|
||||||
|
// Pure presentational. Props:
|
||||||
|
// stations — [{ shape, voicing, rootPc, quality, label, rn }] canonical order
|
||||||
|
// activeIndex — playhead station (canonicalPos); -1 = loop known, playhead
|
||||||
|
// not — no row is marked "now" (content never changes either way)
|
||||||
|
// focusedIndex — the focused station index, or null (nothing focused)
|
||||||
|
// onFocus — fn(index|null): toggle a station's focus
|
||||||
|
// instrument — 'guitar' | 'piano' (VoicingBrowser `show`; bass never mounts
|
||||||
|
// this rail — JamGuide renders BassGuideRows instead, D-40 §3)
|
||||||
|
// keyRoot — key tonic pitch class 0–11 (ChordDiagram fret placement)
|
||||||
|
// keyMode — key mode name (soloScale's minor-key dominant nudge)
|
||||||
|
|
||||||
|
import { NOTES, guideTones, voiceLeadingPairs, soloScale } from '../lib/theory'
|
||||||
|
import ChordDiagram from './ChordDiagram'
|
||||||
|
import MiniPiano from './MiniPiano'
|
||||||
|
import VoicingBrowser from './VoicingBrowser'
|
||||||
|
|
||||||
|
const pcName = (pc) => NOTES[((pc % 12) + 12) % 12]
|
||||||
|
|
||||||
|
// ─── Header atoms (exported — BassGuideRows in JamGuide.jsx composes the same
|
||||||
|
// anatomy for visual parity across instruments, D-40 §3) ──────────────────
|
||||||
|
|
||||||
|
// Solo-scale label: "solo · G mixolydian" (theory.js snake_case → spaces).
|
||||||
|
export function SoloLabel({ rootPc, quality, keyMode }) {
|
||||||
|
const { name } = soloScale(quality, keyMode)
|
||||||
|
return (
|
||||||
|
<span className="text-xs leading-none text-gray-400">
|
||||||
|
<span className="text-[9px] uppercase tracking-widest text-gray-500">solo · </span>
|
||||||
|
{pcName(rootPc)} {name.replace(/_/g, ' ')}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// One guide-tone dot: note name in a small circle + its honest kind label.
|
||||||
|
// Filled accent = the 3rd; hollow = the 7th (or the "5th" fallback — never
|
||||||
|
// badge a 5th as a 7th). Filled text is BLACK on accent (#a855f7 vs black
|
||||||
|
// ≈5.3:1 — AA; white would be ~4.0), matching VoicingBrowser's ▶ hover.
|
||||||
|
function GuideDot({ pc, kind, filled }) {
|
||||||
|
return (
|
||||||
|
<span className="flex items-center gap-1">
|
||||||
|
<span
|
||||||
|
className={
|
||||||
|
'flex h-5 w-5 items-center justify-center rounded-full text-[9px] font-bold leading-none ' +
|
||||||
|
(filled ? 'bg-accent text-black' : 'border-2 border-accent text-purple-300')
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{pcName(pc)}
|
||||||
|
</span>
|
||||||
|
<span className="text-[9px] font-medium uppercase tracking-wide text-gray-400">{kind}</span>
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The "aim" pair — the RoadmapTrack TARGET lane, folded to one header line.
|
||||||
|
export function AimDots({ rootPc, quality }) {
|
||||||
|
const g = guideTones(rootPc, quality)
|
||||||
|
const seventhKind = g.hasSeventh ? '7th' : '5th'
|
||||||
|
return (
|
||||||
|
<span className="flex items-center gap-2">
|
||||||
|
<span className="text-[9px] uppercase tracking-widest text-gray-500">aim</span>
|
||||||
|
<GuideDot pc={g.third} kind="3rd" filled />
|
||||||
|
<GuideDot pc={g.seventh} kind={seventhKind} filled={false} />
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The voice-leading rail, folded to a compact chip: "next F→E · ½ step down";
|
||||||
|
// a held common tone reads "B holds · common tone"; the last row's chip is the
|
||||||
|
// wrap-around and says "loop" (D-40 §2). No smooth rail (≤2 semitones) → the
|
||||||
|
// caller passes null and no chip renders.
|
||||||
|
function TransitionChip({ pair, wraps }) {
|
||||||
|
if (!pair) return null
|
||||||
|
const held = pair.semitones === 0
|
||||||
|
const label = held ? `${pcName(pair.from)} holds` : `${pcName(pair.from)}→${pcName(pair.to)}`
|
||||||
|
const motion = held
|
||||||
|
? 'common tone'
|
||||||
|
: `${Math.abs(pair.semitones) === 1 ? '½' : Math.abs(pair.semitones)} step ${pair.semitones < 0 ? 'down' : 'up'}`
|
||||||
|
return (
|
||||||
|
<span className="flex items-center gap-1 rounded border border-border bg-surface px-1.5 py-1 text-[10px] leading-none">
|
||||||
|
<span className="font-medium uppercase tracking-wide text-gray-500">{wraps ? 'loop' : 'next'}</span>
|
||||||
|
<span className="font-semibold text-accent">{label}</span>
|
||||||
|
<span className="text-gray-400">· {motion}</span>
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── One always-expanded station row ─────────────────────────────────────────
|
||||||
|
|
||||||
|
function StationRow({
|
||||||
|
st, isNow, isNext, isFocused, onToggleFocus, instrument, keyRoot, keyMode, rail, wraps,
|
||||||
|
}) {
|
||||||
|
// The station's own voicing — the first gallery cell (D-40 §4).
|
||||||
|
const ownGuitar = instrument === 'guitar' && st.shape ? st.shape : null
|
||||||
|
const ownPiano = instrument === 'piano' && st.voicing ? st.voicing : null
|
||||||
|
|
||||||
|
// Active row: unmistakable (accent ring + tint). Focused-but-not-now rows get
|
||||||
|
// the softer accent border; everything else recedes to the 0.85 opacity floor
|
||||||
|
// (never below AA legibility).
|
||||||
|
const stateClass = isNow
|
||||||
|
? 'border-accent bg-accent/10 ring-2 ring-accent'
|
||||||
|
: isFocused
|
||||||
|
? 'border-accent/60 bg-accent/5'
|
||||||
|
: 'border-border bg-surface'
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
role="listitem"
|
||||||
|
aria-current={isNow ? 'true' : undefined}
|
||||||
|
aria-label={
|
||||||
|
`${st.label}${st.rn ? ` (${st.rn})` : ''} — every ${instrument} voicing` +
|
||||||
|
`${isNow ? ', now playing' : ''}${isNext ? ', up next' : ''}`
|
||||||
|
}
|
||||||
|
className={`rounded-lg border p-2 ${stateClass}`}
|
||||||
|
style={{ opacity: isNow || isFocused ? 1 : 0.85 }}
|
||||||
|
>
|
||||||
|
{/* ── Header line: identity + the folded roadmap education ── */}
|
||||||
|
<div className="mb-1.5 flex flex-wrap items-center gap-x-3 gap-y-1">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
aria-pressed={isFocused}
|
||||||
|
onClick={onToggleFocus}
|
||||||
|
title={isFocused
|
||||||
|
? `Unfocus ${st.label} — clear its guide tones from the fretboard`
|
||||||
|
: `Focus ${st.label} — light its guide tones on the fretboard`}
|
||||||
|
className="flex min-h-[32px] items-center gap-2 rounded px-1 outline-none focus-visible:ring-2 focus-visible:ring-accent"
|
||||||
|
>
|
||||||
|
<span className="text-sm font-bold leading-none text-gray-100">{st.label}</span>
|
||||||
|
{st.rn && (
|
||||||
|
<span className="text-[9px] font-medium uppercase tracking-wide text-gray-400">
|
||||||
|
{st.rn}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
{isNow && (
|
||||||
|
<span className="text-[9px] font-semibold uppercase tracking-widest text-accent">
|
||||||
|
now
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{isNext && (
|
||||||
|
<span className="rounded border border-accent/60 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider text-accent">
|
||||||
|
next
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{isFocused && (
|
||||||
|
<span className="rounded border border-accent bg-accent/10 px-1.5 py-0.5 text-[10px] font-medium leading-none text-accent">
|
||||||
|
aim on fretboard
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
<SoloLabel rootPc={st.rootPc} quality={st.quality} keyMode={keyMode} />
|
||||||
|
<AimDots rootPc={st.rootPc} quality={st.quality} />
|
||||||
|
<TransitionChip pair={rail} wraps={wraps} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* ── Gallery: own-voicing cell + the full dense browser; cells WRAP,
|
||||||
|
never scroll horizontally (D-40 §4). ── */}
|
||||||
|
<div className="flex flex-wrap items-start gap-2">
|
||||||
|
{(ownGuitar || ownPiano) && (
|
||||||
|
<figure className="flex shrink-0 flex-col items-center gap-1.5 rounded-md border border-accent/60 bg-surface p-2">
|
||||||
|
<figcaption className="flex max-w-full items-center gap-1.5 text-[11px] font-medium leading-tight text-gray-300">
|
||||||
|
{ownGuitar && (
|
||||||
|
<span className="rounded bg-accent px-1 py-0.5 text-[9px] font-bold uppercase tracking-wider text-black">
|
||||||
|
play
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
<span className="break-words">{ownGuitar ? ownGuitar.label : ownPiano.label}</span>
|
||||||
|
</figcaption>
|
||||||
|
{ownGuitar ? (
|
||||||
|
<ChordDiagram shape={ownGuitar} keyRoot={keyRoot} rootPc={st.rootPc} size="thumb" />
|
||||||
|
) : (
|
||||||
|
<MiniPiano voicing={ownPiano} size="thumb" />
|
||||||
|
)}
|
||||||
|
</figure>
|
||||||
|
)}
|
||||||
|
<div className="min-w-0 flex-1 basis-[300px]">
|
||||||
|
{/* dense: the rail shows the mic-feedback microcopy once, below. */}
|
||||||
|
<VoicingBrowser rootPc={st.rootPc} quality={st.quality} show={instrument} dense />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── The rail ─────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
export default function GlanceRail({
|
||||||
|
stations = [], activeIndex = -1, focusedIndex = null, onFocus, instrument, keyRoot, keyMode,
|
||||||
|
}) {
|
||||||
|
const n = stations.length
|
||||||
|
if (n === 0) return null
|
||||||
|
const nextIndex = activeIndex >= 0 && n > 1 ? (activeIndex + 1) % n : -1
|
||||||
|
|
||||||
|
// Voice-leading rails: rail i leaves station i for station (i+1) mod n — the
|
||||||
|
// last rail wraps back to station 0 (the loop is a wheel). The headline rail
|
||||||
|
// is the 7→3 (voiceLeadingPairs lists the 7th first); a one-chord loop has
|
||||||
|
// no transition to speak of.
|
||||||
|
const rails = stations.map((st, i) => {
|
||||||
|
if (n < 2) return null
|
||||||
|
const next = stations[(i + 1) % n]
|
||||||
|
return voiceLeadingPairs(
|
||||||
|
{ root: st.rootPc, quality: st.quality },
|
||||||
|
{ root: next.rootPc, quality: next.quality },
|
||||||
|
)[0] ?? null
|
||||||
|
})
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section
|
||||||
|
className="rounded-2xl border border-border bg-panel p-3"
|
||||||
|
aria-label="Voicing variations — every chord of the loop, all expanded"
|
||||||
|
>
|
||||||
|
<h4 className="mb-2 text-[10px] font-semibold uppercase tracking-widest text-gray-500">
|
||||||
|
Variations · every chord, every voicing — the playhead highlights
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-2" role="list">
|
||||||
|
{stations.map((st, i) => (
|
||||||
|
<StationRow
|
||||||
|
key={i}
|
||||||
|
st={st}
|
||||||
|
isNow={i === activeIndex}
|
||||||
|
isNext={i === nextIndex}
|
||||||
|
isFocused={focusedIndex === i}
|
||||||
|
onToggleFocus={() => onFocus?.(focusedIndex === i ? null : i)}
|
||||||
|
instrument={instrument}
|
||||||
|
keyRoot={keyRoot}
|
||||||
|
keyMode={keyMode}
|
||||||
|
rail={rails[i]}
|
||||||
|
wraps={i === n - 1}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Mic-feedback microcopy — ONCE for the whole rail (D-31 §2.5); the
|
||||||
|
gallery mounts run `dense` and suppress their per-mount copy. */}
|
||||||
|
<p className="mt-2 text-[11px] text-gray-500">
|
||||||
|
▶ previews play through your speakers — while the mic is live, detection may
|
||||||
|
hear them. Nothing plays automatically.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
+734
-256
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,475 @@
|
|||||||
|
// LickCard — tab-style SVG lick renderer (task D-22).
|
||||||
|
//
|
||||||
|
// Renders one structured lick from the KB `licks` schema (src/data/kb/SCHEMA.md):
|
||||||
|
// { id, name, level, chordContext, techniques[], source?,
|
||||||
|
// tab: [{ string: 1–6, fret: 0–15, technique? }] } // ordered, first → last
|
||||||
|
//
|
||||||
|
// Tab convention (per SCHEMA.md): string 1 = high e rendered on TOP,
|
||||||
|
// string 6 = low E on the bottom — standard guitar tab. NOTE: this is the
|
||||||
|
// REVERSE of RiffDiagram.jsx's row order (that diagram puts low E on top).
|
||||||
|
//
|
||||||
|
// There is no rhythm information in the schema, so notes are simply evenly
|
||||||
|
// spaced columns in `tab` order — no bars, beams or durations are invented.
|
||||||
|
//
|
||||||
|
// Column rule: each note takes the next column, EXCEPT a note tagged
|
||||||
|
// `double-stop`, which stacks into the PREVIOUS note's column — unless ANY note
|
||||||
|
// already placed in that column is on the same string (stacking would overlap
|
||||||
|
// exactly), in which case it takes a new column.
|
||||||
|
//
|
||||||
|
// Technique glyphs (amber, the established secondary-tone colour):
|
||||||
|
// hammer-on → slur arc from the previous note + italic "h" above
|
||||||
|
// pull-off → slur arc from the previous note + italic "p" above
|
||||||
|
// slide → short diagonal segment into the note (rises toward higher frets)
|
||||||
|
// bend → curved arrow rising from the note
|
||||||
|
// vibrato → small ~ wave above the note
|
||||||
|
// ghost-note → fret number in parentheses, dimmed
|
||||||
|
// double-stop→ no glyph; renders as a stacked column (see above)
|
||||||
|
// chromatic-approach → no glyph (melodic content — the tag chip covers it)
|
||||||
|
// unknown strings → no glyph, note still renders (graceful)
|
||||||
|
//
|
||||||
|
// Exports:
|
||||||
|
// default <LickCard lick={…} size="thumb"|"full" /> (production API)
|
||||||
|
// <TechniqueLegend /> — the glyph key, rendered ONCE per grid (per D-20 §3)
|
||||||
|
// layoutTab(tab) — pure layout helper (returns null on empty/invalid)
|
||||||
|
// DEMO_LICK — SCHEMA.md's worked B.B.-box example, dev fixture only
|
||||||
|
//
|
||||||
|
// Design tokens (tailwind.config.js) — SVG fills can't read Tailwind classes,
|
||||||
|
// so the constants below mirror the tokens (same convention as MiniPiano /
|
||||||
|
// ChordDiagram): accent #a855f7, amber #f59e0b, surface #0f0f0f.
|
||||||
|
|
||||||
|
const AMBER = '#f59e0b' // token `amber` — technique glyphs
|
||||||
|
const FRET_TEXT = '#e5e7eb' // gray-200 — fret numbers (≈15:1 on surface)
|
||||||
|
const GHOST_TEXT = '#9ca3af' // gray-400 — ghost notes, quieter but AA (≈7:1)
|
||||||
|
const STRING_LINE = '#3a3a3a' // string lines (decorative, RiffDiagram idiom)
|
||||||
|
const STRING_LABEL = '#6b7280' // gray-500 — string-name microcopy (decorative)
|
||||||
|
const CARD_BG = '#0f0f0f' // token `surface` — backing pill behind fret numbers
|
||||||
|
|
||||||
|
// Fixed technique vocabulary (C-20 schema) — anything else gets no glyph.
|
||||||
|
export const TECHNIQUE_VOCAB = [
|
||||||
|
'hammer-on', 'pull-off', 'slide', 'bend',
|
||||||
|
'double-stop', 'ghost-note', 'chromatic-approach', 'vibrato',
|
||||||
|
]
|
||||||
|
|
||||||
|
// Chip symbol per technique (shown in the technique-tag chips).
|
||||||
|
const TECH_SYMBOL = {
|
||||||
|
'hammer-on': 'h',
|
||||||
|
'pull-off': 'p',
|
||||||
|
slide: '⟋',
|
||||||
|
bend: '↑',
|
||||||
|
vibrato: '~',
|
||||||
|
'ghost-note': '( )',
|
||||||
|
'double-stop': '⋮',
|
||||||
|
'chromatic-approach': null, // tag only — no mark on the tab
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Geometry (SVG user units; the svg scales to card width via viewBox) ──────
|
||||||
|
const STR_GAP = 14 // vertical gap between string lines
|
||||||
|
const PAD_T = 17 // headroom for bend arrows / vibrato above string 1
|
||||||
|
const PAD_B = 9
|
||||||
|
const PAD_L = 20 // room for string-name labels
|
||||||
|
const PAD_R = 12
|
||||||
|
const COL_W = 26 // horizontal pitch per note column
|
||||||
|
|
||||||
|
const STRING_NAMES = ['e', 'B', 'G', 'D', 'A', 'E'] // index = string − 1 (top → bottom)
|
||||||
|
|
||||||
|
function isValidNote(n) {
|
||||||
|
return (
|
||||||
|
n && typeof n === 'object' &&
|
||||||
|
Number.isInteger(n.string) && n.string >= 1 && n.string <= 6 &&
|
||||||
|
Number.isInteger(n.fret) && n.fret >= 0 && n.fret <= 15
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pure layout: tab array → positioned notes.
|
||||||
|
* Returns null when there is nothing renderable (not an array / no valid note).
|
||||||
|
* Otherwise: { notes: [{string,fret,technique?,col,x,y,label,ghost}], nCols, width, height }
|
||||||
|
* Columns are monotonically non-decreasing; y grows with string number
|
||||||
|
* (string 1 = smallest y = top line).
|
||||||
|
*/
|
||||||
|
export function layoutTab(tab) {
|
||||||
|
if (!Array.isArray(tab)) return null
|
||||||
|
const clean = tab.filter(isValidNote)
|
||||||
|
if (clean.length === 0) return null
|
||||||
|
|
||||||
|
const notes = []
|
||||||
|
let col = -1
|
||||||
|
for (let i = 0; i < clean.length; i++) {
|
||||||
|
const n = clean[i]
|
||||||
|
// double-stop stacks into the previous column — unless ANY note already
|
||||||
|
// placed there shares this string (a ≥3-note stack can repeat the string of
|
||||||
|
// a non-adjacent same-column note, which would overlap exactly — D-23).
|
||||||
|
const stacks =
|
||||||
|
i > 0 &&
|
||||||
|
n.technique === 'double-stop' &&
|
||||||
|
!notes.some((m) => m.col === col && m.string === n.string)
|
||||||
|
if (!stacks) col++
|
||||||
|
const ghost = n.technique === 'ghost-note'
|
||||||
|
notes.push({
|
||||||
|
string: n.string,
|
||||||
|
fret: n.fret,
|
||||||
|
technique: typeof n.technique === 'string' ? n.technique : undefined,
|
||||||
|
col,
|
||||||
|
x: PAD_L + col * COL_W + COL_W / 2,
|
||||||
|
y: PAD_T + (n.string - 1) * STR_GAP,
|
||||||
|
label: ghost ? `(${n.fret})` : String(n.fret),
|
||||||
|
ghost,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const nCols = col + 1
|
||||||
|
return {
|
||||||
|
notes,
|
||||||
|
nCols,
|
||||||
|
width: PAD_L + nCols * COL_W + PAD_R,
|
||||||
|
height: PAD_T + 5 * STR_GAP + PAD_B,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Glyph fragments (pure SVG, all in user units so they scale with the tab) ─
|
||||||
|
|
||||||
|
function SlurGlyph({ note, prev, letter }) {
|
||||||
|
const fs = 8
|
||||||
|
if (!prev || prev.col === note.col) {
|
||||||
|
// No source note to slur from — letter alone, just before the note.
|
||||||
|
return (
|
||||||
|
<text x={note.x - 10} y={note.y - 7} textAnchor="middle" fontSize={fs}
|
||||||
|
fontStyle="italic" fill={AMBER}>{letter}</text>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const midX = (prev.x + note.x) / 2
|
||||||
|
const topY = Math.min(prev.y, note.y)
|
||||||
|
return (
|
||||||
|
<g>
|
||||||
|
<path
|
||||||
|
d={`M ${prev.x + 5} ${prev.y - 4} Q ${midX} ${topY - 13} ${note.x - 5} ${note.y - 4}`}
|
||||||
|
fill="none" stroke={AMBER} strokeWidth={1}
|
||||||
|
/>
|
||||||
|
<text x={midX} y={topY - 11} textAnchor="middle" fontSize={fs}
|
||||||
|
fontStyle="italic" fill={AMBER}>{letter}</text>
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function SlideGlyph({ note, prev }) {
|
||||||
|
// Rises toward the higher fret (up-slide ⟋), falls for a down-slide (⟍).
|
||||||
|
if (prev && prev.col !== note.col) {
|
||||||
|
const up = note.fret >= prev.fret
|
||||||
|
const midY = (prev.y + note.y) / 2
|
||||||
|
return (
|
||||||
|
<line
|
||||||
|
x1={prev.x + 7} y1={up ? midY + 3 : midY - 3}
|
||||||
|
x2={note.x - 7} y2={up ? midY - 3 : midY + 3}
|
||||||
|
stroke={AMBER} strokeWidth={1.2} strokeLinecap="round"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// Slide-in from nowhere: short lead-in segment.
|
||||||
|
return (
|
||||||
|
<line x1={note.x - 14} y1={note.y + 4} x2={note.x - 7} y2={note.y - 1}
|
||||||
|
stroke={AMBER} strokeWidth={1.2} strokeLinecap="round" />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function BendGlyph({ note }) {
|
||||||
|
const { x, y } = note
|
||||||
|
return (
|
||||||
|
<g>
|
||||||
|
<path d={`M ${x + 4} ${y - 4} Q ${x + 10} ${y - 6} ${x + 10} ${y - 11}`}
|
||||||
|
fill="none" stroke={AMBER} strokeWidth={1.2} />
|
||||||
|
<polygon
|
||||||
|
points={`${x + 7.8},${y - 10} ${x + 12.2},${y - 10} ${x + 10},${y - 14.5}`}
|
||||||
|
fill={AMBER}
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function VibratoGlyph({ note }) {
|
||||||
|
const { x, y } = note
|
||||||
|
return (
|
||||||
|
<path
|
||||||
|
d={`M ${x - 7} ${y - 9} q 2.3 -3.5 4.6 0 t 4.6 0 t 4.6 0`}
|
||||||
|
fill="none" stroke={AMBER} strokeWidth={1.1} strokeLinecap="round"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function NoteGlyph({ note, prev }) {
|
||||||
|
switch (note.technique) {
|
||||||
|
case 'hammer-on': return <SlurGlyph note={note} prev={prev} letter="h" />
|
||||||
|
case 'pull-off': return <SlurGlyph note={note} prev={prev} letter="p" />
|
||||||
|
case 'slide': return <SlideGlyph note={note} prev={prev} />
|
||||||
|
case 'bend': return <BendGlyph note={note} />
|
||||||
|
case 'vibrato': return <VibratoGlyph note={note} />
|
||||||
|
// ghost-note is handled by the parenthesised label; double-stop by the
|
||||||
|
// column stacking; chromatic-approach and unknown strings get no mark.
|
||||||
|
default: return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── The tab SVG ───────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
function TabSvg({ layout, name, size }) {
|
||||||
|
const { notes, width, height } = layout
|
||||||
|
const full = size === 'full'
|
||||||
|
return (
|
||||||
|
<div className="w-full" style={{ maxWidth: width * (full ? 2 : 1.3) }}>
|
||||||
|
<svg
|
||||||
|
viewBox={`0 0 ${width} ${height}`}
|
||||||
|
width="100%"
|
||||||
|
style={{ display: 'block', height: 'auto' }}
|
||||||
|
role="img"
|
||||||
|
aria-label={`Tab for ${name}: ${notes.length} note${notes.length === 1 ? '' : 's'}`}
|
||||||
|
>
|
||||||
|
{/* String lines — string 1 (high e) on top, string 6 (low E) at bottom */}
|
||||||
|
{STRING_NAMES.map((label, i) => {
|
||||||
|
const y = PAD_T + i * STR_GAP
|
||||||
|
return (
|
||||||
|
<g key={label + i}>
|
||||||
|
<line x1={PAD_L - 6} y1={y} x2={width - PAD_R + 6} y2={y}
|
||||||
|
stroke={STRING_LINE} strokeWidth={i === 5 ? 1.4 : 1} />
|
||||||
|
<text x={7} y={y + 3} textAnchor="middle" fontSize={7}
|
||||||
|
fill={STRING_LABEL}>{label}</text>
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
|
{/* Technique glyphs (under the numbers so pills stay readable) */}
|
||||||
|
{notes.map((n, i) => (
|
||||||
|
<NoteGlyph key={`g${i}`} note={n} prev={notes[i - 1]} />
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Fret numbers on their strings, backed by a surface pill so the
|
||||||
|
number interrupts the string line like printed tab */}
|
||||||
|
{notes.map((n, i) => {
|
||||||
|
const w = n.label.length * 5.2 + 3
|
||||||
|
return (
|
||||||
|
<g key={`n${i}`}>
|
||||||
|
<rect x={n.x - w / 2} y={n.y - 5.5} width={w} height={11}
|
||||||
|
rx={2} fill={CARD_BG} />
|
||||||
|
<text x={n.x} y={n.y + 3.2} textAnchor="middle" fontSize={9.5}
|
||||||
|
fontWeight="600" fill={n.ghost ? GHOST_TEXT : FRET_TEXT}>
|
||||||
|
{n.label}
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Card chrome ───────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
function LevelBadge({ level }) {
|
||||||
|
if (level === 'intermediate') {
|
||||||
|
return (
|
||||||
|
<span className="shrink-0 text-[9px] uppercase tracking-wide font-semibold text-amber border border-amber/40 rounded px-1.5 py-px">
|
||||||
|
intermediate
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (level === 'foundation') {
|
||||||
|
return (
|
||||||
|
<span className="shrink-0 text-[9px] uppercase tracking-wide font-semibold text-gray-400 border border-border rounded px-1.5 py-px">
|
||||||
|
foundation
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return null // unknown/missing level → no badge, never a wrong claim
|
||||||
|
}
|
||||||
|
|
||||||
|
function TechniqueChip({ tech }) {
|
||||||
|
const symbol = TECH_SYMBOL[tech]
|
||||||
|
return (
|
||||||
|
<span className="inline-flex items-center gap-1 text-[10px] text-gray-400 border border-border rounded-full px-1.5 py-px">
|
||||||
|
{symbol && <span className="text-amber font-semibold" aria-hidden="true">{symbol}</span>}
|
||||||
|
{tech}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function PlaceholderCard({ name, size }) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`bg-surface border border-border rounded-lg flex flex-col items-center justify-center text-gray-500 ${size === 'thumb' ? 'p-2 min-h-[72px]' : 'p-4 min-h-[110px]'}`}
|
||||||
|
role="group"
|
||||||
|
aria-label={name ? `${name}: lick unavailable` : 'lick unavailable'}
|
||||||
|
>
|
||||||
|
<span className="text-lg leading-none" aria-hidden="true">—</span>
|
||||||
|
<span className="text-[10px] mt-1">
|
||||||
|
{name ? `${name} — tab unavailable` : 'lick unavailable'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <LickCard lick={…} size="thumb"|"full" />
|
||||||
|
* Pure/presentational — renders one KB lick object; never crashes on bad data.
|
||||||
|
*/
|
||||||
|
export default function LickCard({ lick, size = 'full' }) {
|
||||||
|
const layout = layoutTab(lick?.tab)
|
||||||
|
const name = typeof lick?.name === 'string' && lick.name.trim() ? lick.name : 'Untitled lick'
|
||||||
|
|
||||||
|
if (!lick || !layout) {
|
||||||
|
return <PlaceholderCard name={lick ? name : null} size={size} />
|
||||||
|
}
|
||||||
|
|
||||||
|
const full = size === 'full'
|
||||||
|
const chordContext =
|
||||||
|
typeof lick.chordContext === 'string' && lick.chordContext.trim()
|
||||||
|
? lick.chordContext
|
||||||
|
: null
|
||||||
|
const techniques = Array.isArray(lick.techniques)
|
||||||
|
? lick.techniques.filter(t => typeof t === 'string' && t.trim())
|
||||||
|
: []
|
||||||
|
const source = typeof lick.source === 'string' && lick.source.trim() ? lick.source : null
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`bg-surface border border-border rounded-lg flex flex-col ${full ? 'p-3 gap-2' : 'p-2 gap-1.5'}`}
|
||||||
|
role="group"
|
||||||
|
aria-label={chordContext ? `${name} — ${chordContext}` : name}
|
||||||
|
>
|
||||||
|
{/* Header: name + level badge */}
|
||||||
|
<div className="flex items-start justify-between gap-2">
|
||||||
|
<span className={`text-gray-200 font-semibold leading-tight ${full ? 'text-sm' : 'text-[11px]'}`}>
|
||||||
|
{name}
|
||||||
|
</span>
|
||||||
|
<LevelBadge level={lick.level} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Where it lands */}
|
||||||
|
{full && chordContext && (
|
||||||
|
<div>
|
||||||
|
<span className="inline-block text-[10px] font-medium text-accent bg-accent/10 border border-accent/40 rounded-full px-2 py-px">
|
||||||
|
{chordContext}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* The tab */}
|
||||||
|
<TabSvg layout={layout} name={name} size={size} />
|
||||||
|
|
||||||
|
{/* Technique tags */}
|
||||||
|
{full && techniques.length > 0 && (
|
||||||
|
<div className="flex flex-wrap gap-1">
|
||||||
|
{techniques.map(t => <TechniqueChip key={t} tech={t} />)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Attribution */}
|
||||||
|
{full && source && (
|
||||||
|
<span className="text-[10px] text-gray-500 italic leading-snug">{source}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Glyph legend — render ONCE per lick grid (D-20 §3), not per card ─────────
|
||||||
|
|
||||||
|
function LegendSample({ children, w = 22 }) {
|
||||||
|
return (
|
||||||
|
<svg viewBox={`0 0 ${w} 18`} width={w} height={18} aria-hidden="true"
|
||||||
|
style={{ display: 'inline-block', verticalAlign: 'middle' }}>
|
||||||
|
{children}
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TechniqueLegend() {
|
||||||
|
const items = [
|
||||||
|
{
|
||||||
|
key: 'hammer-on', label: 'hammer-on',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<path d="M 3 14 Q 11 4 19 14" fill="none" stroke={AMBER} strokeWidth={1} />
|
||||||
|
<text x={11} y={9} textAnchor="middle" fontSize={8} fontStyle="italic" fill={AMBER}>h</text>
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'pull-off', label: 'pull-off',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<path d="M 3 14 Q 11 4 19 14" fill="none" stroke={AMBER} strokeWidth={1} />
|
||||||
|
<text x={11} y={9} textAnchor="middle" fontSize={8} fontStyle="italic" fill={AMBER}>p</text>
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'slide', label: 'slide',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<line x1={4} y1={13} x2={18} y2={5} stroke={AMBER} strokeWidth={1.2} strokeLinecap="round" />
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'bend', label: 'bend',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<path d="M 5 14 Q 12 12 12 7" fill="none" stroke={AMBER} strokeWidth={1.2} />
|
||||||
|
<polygon points="9.8,8 14.2,8 12,3.5" fill={AMBER} />
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'vibrato', label: 'vibrato',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<path d="M 3 10 q 2.3 -3.5 4.6 0 t 4.6 0 t 4.6 0" fill="none" stroke={AMBER} strokeWidth={1.1} strokeLinecap="round" />
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'ghost-note', label: 'ghost note',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<text x={11} y={12} textAnchor="middle" fontSize={9} fontWeight="600" fill={GHOST_TEXT}>(5)</text>
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'double-stop', label: 'double-stop (stacked)',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<text x={11} y={8} textAnchor="middle" fontSize={8} fontWeight="600" fill={FRET_TEXT}>5</text>
|
||||||
|
<text x={11} y={17} textAnchor="middle" fontSize={8} fontWeight="600" fill={FRET_TEXT}>7</text>
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[11px] text-gray-400">
|
||||||
|
{items.map(it => (
|
||||||
|
<span key={it.key} className="inline-flex items-center gap-1.5">
|
||||||
|
{it.sample}
|
||||||
|
{it.label}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
<span className="text-gray-500">chromatic-approach: tag only, no mark</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Dev fixture — SCHEMA.md's worked example (P-21 real data replaces this in
|
||||||
|
// the app; this export exists so the card can be exercised before P-21) ────
|
||||||
|
|
||||||
|
export const DEMO_LICK = {
|
||||||
|
id: 'blues-box1-bb-answer',
|
||||||
|
name: 'B.B. box answer phrase',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the I7',
|
||||||
|
techniques: ['bend', 'vibrato'],
|
||||||
|
source: 'the B.B. King box, e.g. "The Thrill Is Gone" fills',
|
||||||
|
tab: [
|
||||||
|
{ string: 2, fret: 8 },
|
||||||
|
{ string: 1, fret: 8, technique: 'bend' },
|
||||||
|
{ string: 1, fret: 10, technique: 'vibrato' },
|
||||||
|
{ string: 2, fret: 8 },
|
||||||
|
],
|
||||||
|
}
|
||||||
+212
-20
@@ -1,10 +1,36 @@
|
|||||||
// 2-octave mini piano keyboard showing technique notes
|
// Mini piano keyboard.
|
||||||
// Props:
|
//
|
||||||
// rootPc — root pitch class 0-11
|
// TWO render modes, chosen by props (additive — legacy path is the default):
|
||||||
// lh — array of semitone intervals above root (left hand, shown in blue)
|
//
|
||||||
// rh — array of semitone intervals above root (right hand, shown in purple)
|
// 1. LEGACY <MiniPiano rootPc={..} lh={[..]} rh={[..]} />
|
||||||
|
// Used by ChordDetailModal + ExplorePanel. `lh`/`rh` are semitone intervals
|
||||||
|
// ABOVE the root (left hand shown blue, right hand shown purple), spanning a
|
||||||
|
// 2-octave keyboard. Behaviour here is UNCHANGED — byte-for-byte the same
|
||||||
|
// output the existing consumers have always rendered.
|
||||||
|
//
|
||||||
|
// 2. VOICING <MiniPiano voicing={pianoVoicing(...)} size="thumb|full" />
|
||||||
|
// Renders the output of src/lib/piano.js `pianoVoicing({rootPc,quality},opts)`:
|
||||||
|
// voicing.notes — ABSOLUTE semitone key positions, 0 = C of the low octave,
|
||||||
|
// range [0,36]. A note value `n` maps to the key `n`
|
||||||
|
// semitones above the low C (octave = ⌊n/12⌋, pc = n%12).
|
||||||
|
// voicing.pcs — pitch classes sounding.
|
||||||
|
// voicing.bass — lowest absolute note (the LH anchor) — marked distinctly.
|
||||||
|
// voicing.style / voicing.label — captions (shown in `full` size).
|
||||||
|
// The root pitch class lights in accent purple; the bass key is ringed as the
|
||||||
|
// LH anchor; the other voicing tones light in a lighter purple.
|
||||||
|
//
|
||||||
|
// Keyboard window (D-24): `size="thumb"` crops to the voicing's whole-octave
|
||||||
|
// span — from the octave-start at-or-below the lowest sounded key to the
|
||||||
|
// octave-end at-or-above the highest (plus the closing high C) — so a
|
||||||
|
// ≤1-octave shell renders ONE octave (~140px) instead of 2–3 (~266–390px)
|
||||||
|
// and Jam Guide station thumbs sit level with guitar ChordDiagram thumbs.
|
||||||
|
// `size="full"` keeps the wide C-anchored 2–3-octave window: the enlarged
|
||||||
|
// view benefits from register context, and its output stays byte-identical
|
||||||
|
// to the D-10 behaviour.
|
||||||
|
//
|
||||||
|
// Design tokens (tailwind.config.js): accent #a855f7. The SVG also uses the
|
||||||
|
// established Piano/Fretboard note language (accent purple for the focal tone).
|
||||||
|
|
||||||
const OCTAVES = 2
|
|
||||||
const WW = 22 // white key width
|
const WW = 22 // white key width
|
||||||
const WH = 60 // white key height
|
const WH = 60 // white key height
|
||||||
const BW = 14 // black key width
|
const BW = 14 // black key width
|
||||||
@@ -22,20 +48,33 @@ const BLACK_OFFSETS = [
|
|||||||
{ pc: 10, afterWhite: 5 }, // A#
|
{ pc: 10, afterWhite: 5 }, // A#
|
||||||
]
|
]
|
||||||
|
|
||||||
const TOTAL_WHITES = WHITE_PCS.length * OCTAVES // 14
|
// ─── Design tokens (literal — SVG fills can't read Tailwind classes) ───────────
|
||||||
const SVG_W = WW * TOTAL_WHITES + 2
|
const ACCENT = '#a855f7' // text-accent — root pitch class (focal tone)
|
||||||
const SVG_H = WH + 24
|
const ACCENT_SOFT = '#c084fc' // lighter accent — non-root voicing tones
|
||||||
|
const LH_BLUE = '#3b82f6' // legacy left-hand colour (unchanged)
|
||||||
|
const WHITE_FILL = '#f5f5f5'
|
||||||
|
const BLACK_FILL = '#1f2937'
|
||||||
|
const WHITE_STROKE = '#374151'
|
||||||
|
const BLACK_STROKE = '#111827'
|
||||||
|
const BASS_RING = '#fbbf24' // amber ring marking the LH bass anchor (AA on keys)
|
||||||
|
|
||||||
function noteColor(interval) {
|
function legacyNoteColor(hand) {
|
||||||
// interval < 12 → first octave (root region), ≥12 → second octave
|
return hand === 'L' ? LH_BLUE : ACCENT
|
||||||
return interval < 12 ? '#a855f7' : '#c084fc'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handLabel(hand) {
|
function handLabel(hand) {
|
||||||
return hand === 'L' ? 'LH' : 'RH'
|
return hand === 'L' ? 'LH' : 'RH'
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function MiniPiano({ rootPc, lh = [], rh = [] }) {
|
// ════════════════════════════════════════════════════════════════════════════
|
||||||
|
// LEGACY render path — {rootPc, lh, rh}. UNCHANGED from the original component.
|
||||||
|
// ════════════════════════════════════════════════════════════════════════════
|
||||||
|
function LegacyPiano({ rootPc, lh = [], rh = [] }) {
|
||||||
|
const OCTAVES = 2
|
||||||
|
const TOTAL_WHITES = WHITE_PCS.length * OCTAVES // 14
|
||||||
|
const SVG_W = WW * TOTAL_WHITES + 2
|
||||||
|
const SVG_H = WH + 24
|
||||||
|
|
||||||
// Build a set of highlighted notes: pc → { hand, interval }
|
// Build a set of highlighted notes: pc → { hand, interval }
|
||||||
// We span 2 octaves (semitones 0…23 above root), mapped to absolute pitch classes
|
// We span 2 octaves (semitones 0…23 above root), mapped to absolute pitch classes
|
||||||
const highlights = new Map() // absIdx → { color, label }
|
const highlights = new Map() // absIdx → { color, label }
|
||||||
@@ -44,8 +83,7 @@ export default function MiniPiano({ rootPc, lh = [], rh = [] }) {
|
|||||||
for (const iv of intervals) {
|
for (const iv of intervals) {
|
||||||
const octave = Math.floor(iv / 12)
|
const octave = Math.floor(iv / 12)
|
||||||
const pc = (rootPc + iv) % 12
|
const pc = (rootPc + iv) % 12
|
||||||
const absIdx = octave * 12 + pc // unique index per octave slot
|
highlights.set(`${octave}-${pc}`, { color: legacyNoteColor(hand), label: handLabel(hand) })
|
||||||
highlights.set(`${octave}-${pc}`, { color: hand === 'L' ? '#3b82f6' : '#a855f7', label: handLabel(hand) })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addNotes(lh, 'L')
|
addNotes(lh, 'L')
|
||||||
@@ -86,8 +124,8 @@ export default function MiniPiano({ rootPc, lh = [], rh = [] }) {
|
|||||||
<rect
|
<rect
|
||||||
x={x} y={1} width={WW - 1} height={WH}
|
x={x} y={1} width={WW - 1} height={WH}
|
||||||
rx={2}
|
rx={2}
|
||||||
fill={hl ? hl.color : '#f5f5f5'}
|
fill={hl ? hl.color : WHITE_FILL}
|
||||||
stroke="#374151"
|
stroke={WHITE_STROKE}
|
||||||
strokeWidth={0.5}
|
strokeWidth={0.5}
|
||||||
/>
|
/>
|
||||||
{hl && (
|
{hl && (
|
||||||
@@ -105,8 +143,8 @@ export default function MiniPiano({ rootPc, lh = [], rh = [] }) {
|
|||||||
<rect
|
<rect
|
||||||
x={x} y={1} width={BW} height={BH}
|
x={x} y={1} width={BW} height={BH}
|
||||||
rx={2}
|
rx={2}
|
||||||
fill={hl ? hl.color : '#1f2937'}
|
fill={hl ? hl.color : BLACK_FILL}
|
||||||
stroke="#111827"
|
stroke={BLACK_STROKE}
|
||||||
strokeWidth={0.5}
|
strokeWidth={0.5}
|
||||||
/>
|
/>
|
||||||
{hl && (
|
{hl && (
|
||||||
@@ -124,7 +162,7 @@ export default function MiniPiano({ rootPc, lh = [], rh = [] }) {
|
|||||||
if (!isRoot) return null
|
if (!isRoot) return null
|
||||||
return (
|
return (
|
||||||
<text key={`lbl${absWi}`} x={x + (WW - 1) / 2} y={WH + 14}
|
<text key={`lbl${absWi}`} x={x + (WW - 1) / 2} y={WH + 14}
|
||||||
textAnchor="middle" fill="#a855f7" fontSize={8} fontWeight="bold">
|
textAnchor="middle" fill={ACCENT} fontSize={8} fontWeight="bold">
|
||||||
R
|
R
|
||||||
</text>
|
</text>
|
||||||
)
|
)
|
||||||
@@ -132,3 +170,157 @@ export default function MiniPiano({ rootPc, lh = [], rh = [] }) {
|
|||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ════════════════════════════════════════════════════════════════════════════
|
||||||
|
// VOICING render path — renders a pianoVoicing({notes,pcs,bass,style,label}).
|
||||||
|
// `notes` are absolute semitone positions, 0 = C of the low octave, range [0,36].
|
||||||
|
// ════════════════════════════════════════════════════════════════════════════
|
||||||
|
function VoicingPiano({ voicing, size }) {
|
||||||
|
const isFull = size === 'full'
|
||||||
|
const notes = Array.isArray(voicing?.notes) ? voicing.notes : []
|
||||||
|
const rootPc = ((voicing?.rootPc ?? (notes.length ? notes[0] : 0)) % 12 + 12) % 12
|
||||||
|
const bass = typeof voicing?.bass === 'number' ? voicing.bass : (notes.length ? Math.min(...notes) : null)
|
||||||
|
|
||||||
|
// ── Keyboard window (D-24) ──────────────────────────────────────────────────
|
||||||
|
// `full`: the original wide window — C-anchored, 2–3 octaves, enough to contain
|
||||||
|
// the highest note (byte-identical to the pre-D-24 output).
|
||||||
|
// `thumb`: crop to the voicing's whole-octave span. The window starts at the
|
||||||
|
// octave C at-or-below the lowest sounded key (octStart) and runs whole
|
||||||
|
// octaves until the closing C at-or-above the highest key, so white-key
|
||||||
|
// geometry stays simple and a ≤1-octave voicing renders ONE octave.
|
||||||
|
// The trailing high C is always drawn (window note octStart*12 +
|
||||||
|
// OCTAVES*12), so a top note landing exactly on the octave boundary
|
||||||
|
// still shows without adding a whole extra octave.
|
||||||
|
const maxNote = notes.length ? Math.max(...notes) : 0
|
||||||
|
const minNote = notes.length ? Math.min(...notes) : 0
|
||||||
|
const octStart = isFull ? 0 : Math.floor(minNote / 12)
|
||||||
|
const OCTAVES = isFull
|
||||||
|
? Math.min(3, Math.max(2, Math.ceil((maxNote + 1) / 12)))
|
||||||
|
: Math.max(1, Math.ceil((maxNote - octStart * 12) / 12))
|
||||||
|
// White keys: OCTAVES full octaves + 1 trailing C closing the top octave.
|
||||||
|
const TOTAL_WHITES = WHITE_PCS.length * OCTAVES + 1
|
||||||
|
const scale = isFull ? 1 : 0.8
|
||||||
|
const baseW = WW * TOTAL_WHITES + 2
|
||||||
|
const SVG_W = baseW * scale
|
||||||
|
const SVG_H = (WH + (isFull ? 26 : 4)) * scale
|
||||||
|
|
||||||
|
// A highlighted absolute note → its render style. Keyed by absolute note value.
|
||||||
|
const noteSet = new Set(notes)
|
||||||
|
function styleFor(absNote) {
|
||||||
|
if (!noteSet.has(absNote)) return null
|
||||||
|
const pc = ((absNote % 12) + 12) % 12
|
||||||
|
return {
|
||||||
|
isRoot: pc === rootPc,
|
||||||
|
isBass: absNote === bass,
|
||||||
|
color: pc === rootPc ? ACCENT : ACCENT_SOFT,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// White keys across OCTAVES octaves + trailing C. `oct` is window-relative
|
||||||
|
// (drives x geometry); absNote adds octStart so highlights land on the right
|
||||||
|
// keys inside a cropped window.
|
||||||
|
const whites = []
|
||||||
|
for (let oct = 0; oct < OCTAVES; oct++) {
|
||||||
|
for (let wi = 0; wi < WHITE_PCS.length; wi++) {
|
||||||
|
const pc = WHITE_PCS[wi]
|
||||||
|
const absWi = oct * WHITE_PCS.length + wi
|
||||||
|
const absNote = (octStart + oct) * 12 + pc // absolute semitone of this white key
|
||||||
|
const x = absWi * WW + 1
|
||||||
|
whites.push({ x, absWi, absNote, hl: styleFor(absNote) })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Trailing high C (top of the renderable window, e.g. note 36 when OCTAVES=3).
|
||||||
|
{
|
||||||
|
const absWi = OCTAVES * WHITE_PCS.length
|
||||||
|
const absNote = (octStart + OCTAVES) * 12
|
||||||
|
whites.push({ x: absWi * WW + 1, absWi, absNote, hl: styleFor(absNote) })
|
||||||
|
}
|
||||||
|
|
||||||
|
// Black keys across OCTAVES octaves.
|
||||||
|
const blacks = []
|
||||||
|
for (let oct = 0; oct < OCTAVES; oct++) {
|
||||||
|
for (const { pc, afterWhite } of BLACK_OFFSETS) {
|
||||||
|
const absWi = oct * WHITE_PCS.length + afterWhite
|
||||||
|
const absNote = (octStart + oct) * 12 + pc
|
||||||
|
const x = absWi * WW + WW - BW / 2
|
||||||
|
blacks.push({ x, pc, oct, absNote, hl: styleFor(absNote) })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const ariaLabel = `Piano voicing${voicing?.label ? `: ${voicing.label}` : ''}`
|
||||||
|
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
width={SVG_W} height={SVG_H} viewBox={`0 0 ${baseW} ${WH + (isFull ? 26 : 4)}`}
|
||||||
|
className="overflow-visible" role="img" aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
{/* White keys */}
|
||||||
|
{whites.map(({ x, hl, absWi }) => (
|
||||||
|
<g key={`w${absWi}`}>
|
||||||
|
<rect
|
||||||
|
x={x} y={1} width={WW - 1} height={WH}
|
||||||
|
rx={2}
|
||||||
|
fill={hl ? hl.color : WHITE_FILL}
|
||||||
|
stroke={WHITE_STROKE}
|
||||||
|
strokeWidth={0.5}
|
||||||
|
/>
|
||||||
|
{hl?.isBass && (
|
||||||
|
<rect
|
||||||
|
x={x + 1} y={2} width={WW - 3} height={WH - 2}
|
||||||
|
rx={2} fill="none" stroke={BASS_RING} strokeWidth={2}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{hl?.isRoot && (
|
||||||
|
<text x={x + (WW - 1) / 2} y={WH - 8}
|
||||||
|
textAnchor="middle" fill="white" fontSize={8} fontWeight="bold">
|
||||||
|
R
|
||||||
|
</text>
|
||||||
|
)}
|
||||||
|
</g>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Black keys */}
|
||||||
|
{blacks.map(({ x, pc, oct, hl }) => (
|
||||||
|
<g key={`b${oct}-${pc}`}>
|
||||||
|
<rect
|
||||||
|
x={x} y={1} width={BW} height={BH}
|
||||||
|
rx={2}
|
||||||
|
fill={hl ? hl.color : BLACK_FILL}
|
||||||
|
stroke={BLACK_STROKE}
|
||||||
|
strokeWidth={0.5}
|
||||||
|
/>
|
||||||
|
{hl?.isBass && (
|
||||||
|
<rect
|
||||||
|
x={x + 1} y={2} width={BW - 2} height={BH - 2}
|
||||||
|
rx={2} fill="none" stroke={BASS_RING} strokeWidth={2}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{hl?.isRoot && (
|
||||||
|
<text x={x + BW / 2} y={BH - 5}
|
||||||
|
textAnchor="middle" fill="white" fontSize={6} fontWeight="bold">
|
||||||
|
R
|
||||||
|
</text>
|
||||||
|
)}
|
||||||
|
</g>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Caption (full size only): label + style */}
|
||||||
|
{isFull && voicing?.label && (
|
||||||
|
<text x={baseW / 2} y={WH + 20}
|
||||||
|
textAnchor="middle" fill={ACCENT} fontSize={9} fontWeight="bold">
|
||||||
|
{voicing.label}
|
||||||
|
</text>
|
||||||
|
)}
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ════════════════════════════════════════════════════════════════════════════
|
||||||
|
// Public component — dispatches on whether `voicing` is supplied (additive).
|
||||||
|
// ════════════════════════════════════════════════════════════════════════════
|
||||||
|
export default function MiniPiano({ rootPc, lh = [], rh = [], voicing, size = 'thumb' }) {
|
||||||
|
if (voicing) {
|
||||||
|
return <VoicingPiano voicing={voicing} size={size} />
|
||||||
|
}
|
||||||
|
return <LegacyPiano rootPc={rootPc} lh={lh} rh={rh} />
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,694 @@
|
|||||||
|
// PianoLickCard — degree-based piano lick renderer (task D-60).
|
||||||
|
//
|
||||||
|
// Renders one structured piano lick from the KB `licks` schema for piano packs
|
||||||
|
// (src/data/kb/SCHEMA.md "Piano licks"): degree-language notes realized over a
|
||||||
|
// LIVE root — the same reasoning as BassPatternCard: the data transposes, the
|
||||||
|
// card shows the actual keys under your hands right now.
|
||||||
|
//
|
||||||
|
// { id, name, level, chordContext, quality, techniques[], source?, tips?,
|
||||||
|
// notes: [{ deg|approach, octave?, beat?, technique? }] } // ordered
|
||||||
|
//
|
||||||
|
// ── Realization (SCHEMA.md rules) ─────────────────────────────────────────────
|
||||||
|
// Pitch space: MiniPiano's absolute-note window, 0 = C3, range [0, 36] — which
|
||||||
|
// is ALSO chordAudio's playVoicing space (its doc: "0 = the C of the low
|
||||||
|
// displayed octave = C3"), so realized notes drop straight into playback.
|
||||||
|
// · The ROOT sits at its pitch class in the bottom octave: rootAbs = rootPc
|
||||||
|
// (0–11). The schema caps every resolved offset at 25 semitones, so the
|
||||||
|
// highest legal note is 11 + 25 = 36 — every lick fits in all 12 keys.
|
||||||
|
// · A `deg` note: abs = rootAbs + resolveDegree(deg, lick.quality) + 12·octave.
|
||||||
|
// `quality` is the lick's own machine truth (NOT the live chord's quality —
|
||||||
|
// the lick states what it resolves through; the caller picks licks that fit).
|
||||||
|
// · An `approach` note derives from the NEXT `deg` note in `notes[]` order
|
||||||
|
// (scanning past intervening approaches): chrom-below = target − 1,
|
||||||
|
// chrom-above = target + 1. Approaches are non-terminal by schema; a lick
|
||||||
|
// ending on an approach (or any unresolvable note) nulls the realization and
|
||||||
|
// the card renders an honest placeholder instead of lying.
|
||||||
|
//
|
||||||
|
// ── Visual design (thumb): pitch-timeline ─────────────────────────────────────
|
||||||
|
// x = beat (proportional columns when every note carries a beat, LickCard-style
|
||||||
|
// even columns otherwise), y = pitch — a piano-roll miniature. Chosen over
|
||||||
|
// order-numbered keyboard dots for the thumb because a lick IS contour + rhythm:
|
||||||
|
// the line shape reads at strip size without decoding numbers. Note markers are
|
||||||
|
// LickCard's surface-pill idiom carrying NOTE NAMES (the actionable info for a
|
||||||
|
// keyboard player), connected by a faint contour line; dashed accent lines mark
|
||||||
|
// the root pitch ("R" gutter label) so "home" is visible at a glance.
|
||||||
|
//
|
||||||
|
// Colour tiers (established language, Fretboard/Piano/BassPatternCard):
|
||||||
|
// chord tone → purple (ACCENT_SOFT text; root itself full ACCENT)
|
||||||
|
// other scale degrees/extensions → gray-200
|
||||||
|
// approaches (borrowed chromatics) → amber, like BassPatternCard
|
||||||
|
// ghost-note → parenthesised, dimmed (LickCard idiom)
|
||||||
|
//
|
||||||
|
// Technique glyphs (amber): grace-note = slashed mini-note crushed before its
|
||||||
|
// target · slide = thicker amber glissando segment replacing that contour hop ·
|
||||||
|
// double-stop = stacked pills at one x (equal beats; or LickCard's column rule
|
||||||
|
// beatless) · ghost-note = the parenthesised dim label. <PianoTechniqueLegend/>
|
||||||
|
// renders the key ONCE per grid (LickCard's TechniqueLegend contract).
|
||||||
|
//
|
||||||
|
// `size="full"` adds: chordContext chip, an order-numbered keyboard view
|
||||||
|
// (MiniPiano's cropped-window geometry), technique chips, tips, source —
|
||||||
|
// mirroring LickCard's full-size behaviour.
|
||||||
|
//
|
||||||
|
// ── Playback (▶) ──────────────────────────────────────────────────────────────
|
||||||
|
// BassPatternCard's exact pattern: sequential single-note playVoicing calls
|
||||||
|
// (order lives in setTimeout scheduling — playVoicing sorts/dedupes, wrong for
|
||||||
|
// a melody), beats at a fixed preview tempo (even eighths beatless), ONE
|
||||||
|
// sequence module-wide + stopAll() so it never layers over other previews,
|
||||||
|
// unmount silences. Techniques are visual-only in playback (same precedent).
|
||||||
|
//
|
||||||
|
// ── Wiring contract (future LicksStrip integration — Luthier) ─────────────────
|
||||||
|
// <PianoLickCard lick={…} rootPc={0–11} chordLabel="Dm7" size="thumb|full" />
|
||||||
|
// lick — one entry of a piano pack's top-level `licks` array
|
||||||
|
// rootPc — the LIVE chord root pitch class (from the loop station)
|
||||||
|
// chordLabel — optional display name for aria/captions (falls back to
|
||||||
|
// NOTES[rootPc] + quality)
|
||||||
|
// Pure/presentational; never crashes on bad data (placeholder instead).
|
||||||
|
//
|
||||||
|
// Design tokens (tailwind.config.js) — SVG fills can't read Tailwind classes,
|
||||||
|
// so the constants below mirror the tokens (LickCard/MiniPiano convention).
|
||||||
|
|
||||||
|
import { useEffect } from 'react'
|
||||||
|
import { NOTES, CHORD_TYPES } from '../lib/theory'
|
||||||
|
import { resolveDegree } from './JamGuide'
|
||||||
|
import { playVoicing, stopAll } from '../lib/chordAudio'
|
||||||
|
|
||||||
|
// ─── Vocabulary (hand-synced with validate-kb.mjs PIANO_LICK_TECHNIQUES; the
|
||||||
|
// smoke §7b-piano guard enforces set-equality — add to BOTH or neither) ────
|
||||||
|
export const PIANO_TECHNIQUE_VOCAB = ['slide', 'double-stop', 'ghost-note', 'grace-note']
|
||||||
|
|
||||||
|
// Chip symbol per technique (technique-tag chips, full size).
|
||||||
|
const TECH_SYMBOL = {
|
||||||
|
slide: '⟋',
|
||||||
|
'double-stop': '⋮',
|
||||||
|
'ghost-note': '( )',
|
||||||
|
'grace-note': '♪',
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Palette (mirrors tailwind.config.js tokens + MiniPiano's key colours) ────
|
||||||
|
const ACCENT = '#a855f7' // token `accent` — the root (focal tone)
|
||||||
|
const ACCENT_SOFT = '#c084fc' // lighter accent — chord tones (MiniPiano tier)
|
||||||
|
const AMBER = '#f59e0b' // token `amber` — approaches + technique glyphs
|
||||||
|
const NOTE_TEXT = '#e5e7eb' // gray-200 — non-chord-tone degrees
|
||||||
|
const GHOST_TEXT = '#9ca3af' // gray-400 — ghost notes (dim but AA)
|
||||||
|
const CONTOUR = '#3a3a3a' // contour line (decorative, LickCard string idiom)
|
||||||
|
const LABEL = '#6b7280' // gray-500 — beat numbers / gutter microcopy
|
||||||
|
const CARD_BG = '#0f0f0f' // token `surface` — backing pills
|
||||||
|
const WHITE_FILL = '#f5f5f5' // MiniPiano key colours (keyboard view)
|
||||||
|
const BLACK_FILL = '#1f2937'
|
||||||
|
const WHITE_STROKE = '#374151'
|
||||||
|
const BLACK_STROKE = '#111827'
|
||||||
|
|
||||||
|
const APPROACH_DELTA = { 'chrom-below': -1, 'chrom-above': 1 }
|
||||||
|
const ABS_MAX = 36 // MiniPiano window top key
|
||||||
|
|
||||||
|
const mod12 = (n) => ((n % 12) + 12) % 12
|
||||||
|
|
||||||
|
// abs (0 = C3) → "A3"/"F4"… scientific spelling, for aria pitch lists.
|
||||||
|
const absName = (abs) => `${NOTES[mod12(abs)]}${Math.floor(abs / 12) + 3}`
|
||||||
|
|
||||||
|
/**
|
||||||
|
* realizePianoLick(lick, rootPc)
|
||||||
|
* → [{ abs, name, beat?, technique?, approach, chordTone, isRoot }] | null
|
||||||
|
*
|
||||||
|
* Pure realization per the header rules. Returns null on ANY malformed or
|
||||||
|
* out-of-window note so the caller renders a placeholder — authored data is
|
||||||
|
* validator-guaranteed, but a renderer must never crash on bad input.
|
||||||
|
*/
|
||||||
|
export function realizePianoLick(lick, rootPc) {
|
||||||
|
if (!lick || typeof lick !== 'object' || !Number.isFinite(rootPc)) return null
|
||||||
|
const notes = lick.notes
|
||||||
|
if (!Array.isArray(notes) || notes.length === 0) return null
|
||||||
|
const quality = lick.quality
|
||||||
|
const intervals = CHORD_TYPES[quality]?.intervals
|
||||||
|
if (!intervals) return null // quality is required machine truth (schema)
|
||||||
|
const root = mod12(rootPc)
|
||||||
|
const chordPcs = new Set(intervals.map(mod12))
|
||||||
|
|
||||||
|
// Pass 1: resolve every deg note's absolute pitch.
|
||||||
|
const abs = new Array(notes.length).fill(null)
|
||||||
|
for (let i = 0; i < notes.length; i++) {
|
||||||
|
const n = notes[i]
|
||||||
|
if (!n || typeof n !== 'object') return null
|
||||||
|
const isDeg = n.deg !== undefined
|
||||||
|
const isApp = n.approach !== undefined
|
||||||
|
if (isDeg === isApp) return null // exactly one of deg | approach (schema)
|
||||||
|
if (isDeg) {
|
||||||
|
const off = resolveDegree(String(n.deg), quality)
|
||||||
|
if (off === null || off === undefined) return null
|
||||||
|
const oct = n.octave === undefined ? 0 : n.octave
|
||||||
|
if (![0, 1, 2].includes(oct)) return null
|
||||||
|
abs[i] = root + off + 12 * oct
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Pass 2: approaches derive from the NEXT deg note (schema: never terminal).
|
||||||
|
for (let i = 0; i < notes.length; i++) {
|
||||||
|
if (abs[i] !== null) continue
|
||||||
|
const delta = APPROACH_DELTA[notes[i].approach]
|
||||||
|
if (delta === undefined) return null
|
||||||
|
const target = abs.slice(i + 1).find((a) => a !== null)
|
||||||
|
if (target === undefined) return null // approach with nothing to target
|
||||||
|
abs[i] = target + delta
|
||||||
|
}
|
||||||
|
if (abs.some((a) => a < 0 || a > ABS_MAX)) return null // outside the window
|
||||||
|
|
||||||
|
return notes.map((n, i) => ({
|
||||||
|
abs: abs[i],
|
||||||
|
name: NOTES[mod12(abs[i])],
|
||||||
|
beat: Number.isFinite(n.beat) ? n.beat : undefined,
|
||||||
|
technique: typeof n.technique === 'string' ? n.technique : undefined,
|
||||||
|
approach: n.approach !== undefined,
|
||||||
|
chordTone: !(n.approach !== undefined) && chordPcs.has(mod12(abs[i] - root)),
|
||||||
|
isRoot: !(n.approach !== undefined) && mod12(abs[i] - root) === 0,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Sequential playback (module-level: one lick at a time, app-wide) ─────────
|
||||||
|
|
||||||
|
const PREVIEW_BPM = 96 // BassPatternCard's relaxed preview tempo
|
||||||
|
|
||||||
|
let currentSeq = null // { timeouts: number[], handles: {stop}[] }
|
||||||
|
|
||||||
|
function stopLick() {
|
||||||
|
if (!currentSeq) return
|
||||||
|
for (const t of currentSeq.timeouts) clearTimeout(t)
|
||||||
|
for (const h of currentSeq.handles) h.stop()
|
||||||
|
currentSeq = null
|
||||||
|
}
|
||||||
|
|
||||||
|
function playLick(realized) {
|
||||||
|
stopLick()
|
||||||
|
stopAll() // never layer over a VoicingBrowser (or any other) preview
|
||||||
|
const beatMs = 60000 / PREVIEW_BPM
|
||||||
|
const hasBeats = realized.every((n) => Number.isFinite(n.beat))
|
||||||
|
const times = realized.map((n, i) => (hasBeats ? (n.beat - 1) * beatMs : (i * beatMs) / 2))
|
||||||
|
const seq = { timeouts: [], handles: [] }
|
||||||
|
realized.forEach((n, i) => {
|
||||||
|
// Ring until the next distinct onset (equal beats = a dyad, same onset);
|
||||||
|
// the last note gets one beat. Small floor so tight ornaments still sound.
|
||||||
|
const nextT = times.slice(i + 1).find((t) => t > times[i])
|
||||||
|
const durMs = Math.max(160, (nextT !== undefined ? nextT - times[i] : beatMs) + 120)
|
||||||
|
seq.timeouts.push(
|
||||||
|
setTimeout(() => {
|
||||||
|
// abs is already in chordAudio's note space (0 = C3) — no offset.
|
||||||
|
seq.handles.push(playVoicing([n.abs], { strumMs: 0, durMs, gain: 0.5 }))
|
||||||
|
}, times[i]),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
currentSeq = seq
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Timeline layout (x = beat/column, y = pitch) ─────────────────────────────
|
||||||
|
|
||||||
|
const PAD_T = 14 // headroom for grace glyphs above the top pill
|
||||||
|
const PAD_B = 8
|
||||||
|
const PAD_L = 16 // gutter for the "R" root-line label
|
||||||
|
const PAD_R = 12
|
||||||
|
const COL_W = 26 // beatless column pitch (LickCard's)
|
||||||
|
const BEAT_ROW = 10
|
||||||
|
const SEMI_MIN = 3 // px per semitone bounds — wide licks compress,
|
||||||
|
const SEMI_MAX = 7 // narrow licks stretch, so contour stays legible
|
||||||
|
|
||||||
|
function layoutLick(realized, rootPc) {
|
||||||
|
const hasBeats =
|
||||||
|
realized.every((n) => Number.isFinite(n.beat)) &&
|
||||||
|
realized.every((n, i) => i === 0 || n.beat >= realized[i - 1].beat)
|
||||||
|
|
||||||
|
// x: proportional to beat when authored (BassPatternCard), else LickCard
|
||||||
|
// columns — where a double-stop stacks into the previous column.
|
||||||
|
let xs, width, maxBeat = null, unit = null
|
||||||
|
if (hasBeats) {
|
||||||
|
const gaps = realized
|
||||||
|
.map((n, i) => (i > 0 ? n.beat - realized[i - 1].beat : 0))
|
||||||
|
.filter((g) => g > 0)
|
||||||
|
const minGap = gaps.length ? Math.min(...gaps) : 1
|
||||||
|
unit = Math.min(COL_W / minGap, COL_W * 4)
|
||||||
|
xs = realized.map((n) => PAD_L + (n.beat - 1) * unit + 10)
|
||||||
|
maxBeat = realized[realized.length - 1].beat
|
||||||
|
width = PAD_L + (maxBeat - 1) * unit + 20 + PAD_R
|
||||||
|
} else {
|
||||||
|
let col = -1
|
||||||
|
xs = realized.map((n, i) => {
|
||||||
|
const stacks = i > 0 && n.technique === 'double-stop'
|
||||||
|
if (!stacks) col++
|
||||||
|
return PAD_L + col * COL_W + COL_W / 2
|
||||||
|
})
|
||||||
|
width = PAD_L + (col + 1) * COL_W + PAD_R
|
||||||
|
}
|
||||||
|
|
||||||
|
// y: linear pitch axis over the lick's own range.
|
||||||
|
const lo = Math.min(...realized.map((n) => n.abs))
|
||||||
|
const hi = Math.max(...realized.map((n) => n.abs))
|
||||||
|
const range = Math.max(1, hi - lo)
|
||||||
|
const semi = Math.min(SEMI_MAX, Math.max(SEMI_MIN, 66 / range))
|
||||||
|
const plotH = Math.max(26, range * semi)
|
||||||
|
const yFor = (a) => PAD_T + plotH - (a - lo) * semi
|
||||||
|
|
||||||
|
return {
|
||||||
|
hasBeats,
|
||||||
|
maxBeat,
|
||||||
|
unit,
|
||||||
|
width,
|
||||||
|
height: PAD_T + plotH + PAD_B + (hasBeats ? BEAT_ROW : 0),
|
||||||
|
plotBottom: PAD_T + plotH,
|
||||||
|
// Root reference lines: every root-pc pitch inside the plotted range.
|
||||||
|
rootYs: Array.from({ length: hi - lo + 1 }, (_, k) => lo + k)
|
||||||
|
.filter((a) => mod12(a) === mod12(rootPc))
|
||||||
|
.map(yFor),
|
||||||
|
notes: realized.map((n, i) => ({
|
||||||
|
...n,
|
||||||
|
x: xs[i],
|
||||||
|
y: yFor(n.abs),
|
||||||
|
label: n.technique === 'ghost-note' ? `(${n.name})` : n.name,
|
||||||
|
ghost: n.technique === 'ghost-note',
|
||||||
|
})),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function pillColor(n) {
|
||||||
|
if (n.approach) return AMBER
|
||||||
|
if (n.ghost) return GHOST_TEXT
|
||||||
|
if (n.isRoot) return ACCENT
|
||||||
|
if (n.chordTone) return ACCENT_SOFT
|
||||||
|
return NOTE_TEXT
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grace ornament: slashed mini-note crushed just before its target pill.
|
||||||
|
function GraceGlyph({ note }) {
|
||||||
|
const cx = note.x - 12
|
||||||
|
const cy = note.y - 8
|
||||||
|
return (
|
||||||
|
<g>
|
||||||
|
<circle cx={cx} cy={cy} r={2} fill={AMBER} />
|
||||||
|
<line x1={cx - 3} y1={cy + 3} x2={cx + 3} y2={cy - 3}
|
||||||
|
stroke={AMBER} strokeWidth={1} strokeLinecap="round" />
|
||||||
|
<path d={`M ${cx + 2.5} ${cy} Q ${(cx + note.x) / 2} ${cy - 4} ${note.x - 6} ${note.y - 4}`}
|
||||||
|
fill="none" stroke={AMBER} strokeWidth={0.9} />
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function TimelineSvg({ layout, ariaLabel }) {
|
||||||
|
const { notes, width, height, hasBeats, maxBeat, unit, plotBottom, rootYs } = layout
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
viewBox={`0 0 ${width} ${height}`}
|
||||||
|
width="100%"
|
||||||
|
style={{ display: 'block', height: 'auto', maxWidth: width * 1.4 }}
|
||||||
|
role="img"
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
{/* Root ("home") reference lines + gutter label */}
|
||||||
|
{rootYs.map((y, i) => (
|
||||||
|
<g key={`r${i}`}>
|
||||||
|
<line x1={PAD_L - 4} y1={y} x2={width - PAD_R + 4} y2={y}
|
||||||
|
stroke={ACCENT} strokeOpacity={0.3} strokeWidth={1} strokeDasharray="3 3" />
|
||||||
|
<text x={6} y={y + 2.5} textAnchor="middle" fontSize={6.5} fill={ACCENT} fillOpacity={0.75}>
|
||||||
|
R
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Beat numbers (only when beats are authored; x mirrors note columns) */}
|
||||||
|
{hasBeats &&
|
||||||
|
Array.from({ length: Math.floor(maxBeat + 1e-6) }, (_, b) => (
|
||||||
|
<text key={`b${b}`} x={PAD_L + b * unit + 10} y={plotBottom + BEAT_ROW}
|
||||||
|
textAnchor="middle" fontSize={6.5} fill={LABEL}>
|
||||||
|
{b + 1}
|
||||||
|
</text>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Contour: connect consecutive notes when x advances (dyad partners
|
||||||
|
float stacked); a slide hop redraws its segment as a thicker amber
|
||||||
|
glissando line. */}
|
||||||
|
{notes.map((n, i) => {
|
||||||
|
const prev = notes[i - 1]
|
||||||
|
if (!prev || n.x <= prev.x) return null
|
||||||
|
const slide = n.technique === 'slide'
|
||||||
|
return (
|
||||||
|
<line key={`c${i}`}
|
||||||
|
x1={prev.x} y1={prev.y} x2={n.x} y2={n.y}
|
||||||
|
stroke={slide ? AMBER : CONTOUR}
|
||||||
|
strokeWidth={slide ? 1.6 : 1}
|
||||||
|
strokeLinecap="round"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
|
{/* Grace ornaments (above the pills) */}
|
||||||
|
{notes.map((n, i) => (n.technique === 'grace-note' ? <GraceGlyph key={`g${i}`} note={n} /> : null))}
|
||||||
|
|
||||||
|
{/* Note-name pills at pitch height — LickCard's fret-pill idiom */}
|
||||||
|
{notes.map((n, i) => {
|
||||||
|
const w = n.label.length * 5.2 + 4
|
||||||
|
return (
|
||||||
|
<g key={`n${i}`}>
|
||||||
|
<rect x={n.x - w / 2} y={n.y - 5.5} width={w} height={11} rx={2} fill={CARD_BG} />
|
||||||
|
<text x={n.x} y={n.y + 3.2} textAnchor="middle" fontSize={9}
|
||||||
|
fontWeight="600" fill={pillColor(n)}>
|
||||||
|
{n.label}
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Keyboard view (full size): which keys, in what order ────────────────────
|
||||||
|
// MiniPiano's cropped-window geometry (whole-octave span + trailing high C),
|
||||||
|
// replicated here because order badges aren't part of MiniPiano's contract.
|
||||||
|
|
||||||
|
const WW = 22
|
||||||
|
const WH = 60
|
||||||
|
const BW = 14
|
||||||
|
const BH = 38
|
||||||
|
const WHITE_PCS = [0, 2, 4, 5, 7, 9, 11]
|
||||||
|
const BLACK_OFFSETS = [
|
||||||
|
{ pc: 1, afterWhite: 0 }, { pc: 3, afterWhite: 1 }, { pc: 6, afterWhite: 3 },
|
||||||
|
{ pc: 8, afterWhite: 4 }, { pc: 10, afterWhite: 5 },
|
||||||
|
]
|
||||||
|
|
||||||
|
function LickKeyboard({ realized, ariaLabel }) {
|
||||||
|
// abs → { orders: [1-based strike order…], tier }
|
||||||
|
const hits = new Map()
|
||||||
|
realized.forEach((n, i) => {
|
||||||
|
const h = hits.get(n.abs) ?? { orders: [], isRoot: false, deg: false, approach: false }
|
||||||
|
h.orders.push(i + 1)
|
||||||
|
h.isRoot ||= n.isRoot
|
||||||
|
h.deg ||= !n.approach
|
||||||
|
h.approach ||= n.approach
|
||||||
|
hits.set(n.abs, h)
|
||||||
|
})
|
||||||
|
const lo = Math.min(...realized.map((n) => n.abs))
|
||||||
|
const hi = Math.max(...realized.map((n) => n.abs))
|
||||||
|
const octStart = Math.floor(lo / 12)
|
||||||
|
const OCTAVES = Math.max(1, Math.ceil((hi - octStart * 12) / 12))
|
||||||
|
const TOTAL_WHITES = WHITE_PCS.length * OCTAVES + 1
|
||||||
|
const baseW = WW * TOTAL_WHITES + 2
|
||||||
|
const scale = 0.85
|
||||||
|
|
||||||
|
const fillFor = (h) => (h.deg ? (h.isRoot ? ACCENT : ACCENT_SOFT) : AMBER)
|
||||||
|
|
||||||
|
const whites = []
|
||||||
|
for (let oct = 0; oct < OCTAVES; oct++) {
|
||||||
|
for (let wi = 0; wi < WHITE_PCS.length; wi++) {
|
||||||
|
const absWi = oct * WHITE_PCS.length + wi
|
||||||
|
whites.push({ x: absWi * WW + 1, absWi, absNote: (octStart + oct) * 12 + WHITE_PCS[wi] })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
whites.push({
|
||||||
|
x: OCTAVES * WHITE_PCS.length * WW + 1,
|
||||||
|
absWi: OCTAVES * WHITE_PCS.length,
|
||||||
|
absNote: (octStart + OCTAVES) * 12,
|
||||||
|
})
|
||||||
|
const blacks = []
|
||||||
|
for (let oct = 0; oct < OCTAVES; oct++) {
|
||||||
|
for (const { pc, afterWhite } of BLACK_OFFSETS) {
|
||||||
|
blacks.push({
|
||||||
|
x: (oct * WHITE_PCS.length + afterWhite) * WW + WW - BW / 2,
|
||||||
|
key: `${oct}-${pc}`,
|
||||||
|
absNote: (octStart + oct) * 12 + pc,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<svg width={baseW * scale} height={(WH + 4) * scale} viewBox={`0 0 ${baseW} ${WH + 4}`}
|
||||||
|
className="overflow-visible" role="img" aria-label={ariaLabel}>
|
||||||
|
{whites.map(({ x, absWi, absNote }) => {
|
||||||
|
const h = hits.get(absNote)
|
||||||
|
return (
|
||||||
|
<g key={`w${absWi}`}>
|
||||||
|
<rect x={x} y={1} width={WW - 1} height={WH} rx={2}
|
||||||
|
fill={h ? fillFor(h) : WHITE_FILL} stroke={WHITE_STROKE} strokeWidth={0.5} />
|
||||||
|
{h && (
|
||||||
|
<text x={x + (WW - 1) / 2} y={WH - 6} textAnchor="middle"
|
||||||
|
fontSize={7} fontWeight="bold" fill={h.deg ? 'white' : 'black'}>
|
||||||
|
{h.orders.join('·')}
|
||||||
|
</text>
|
||||||
|
)}
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
{blacks.map(({ x, key, absNote }) => {
|
||||||
|
const h = hits.get(absNote)
|
||||||
|
return (
|
||||||
|
<g key={`b${key}`}>
|
||||||
|
<rect x={x} y={1} width={BW} height={BH} rx={2}
|
||||||
|
fill={h ? fillFor(h) : BLACK_FILL} stroke={BLACK_STROKE} strokeWidth={0.5} />
|
||||||
|
{h && (
|
||||||
|
<text x={x + BW / 2} y={BH - 5} textAnchor="middle"
|
||||||
|
fontSize={6} fontWeight="bold" fill={h.deg ? 'white' : 'black'}>
|
||||||
|
{h.orders.join('·')}
|
||||||
|
</text>
|
||||||
|
)}
|
||||||
|
</g>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Card chrome (LickCard's idiom) ───────────────────────────────────────────
|
||||||
|
|
||||||
|
function LevelBadge({ level }) {
|
||||||
|
if (level === 'intermediate') {
|
||||||
|
return (
|
||||||
|
<span className="shrink-0 text-[9px] uppercase tracking-wide font-semibold text-amber border border-amber/40 rounded px-1.5 py-px">
|
||||||
|
intermediate
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (level === 'foundation') {
|
||||||
|
return (
|
||||||
|
<span className="shrink-0 text-[9px] uppercase tracking-wide font-semibold text-gray-400 border border-border rounded px-1.5 py-px">
|
||||||
|
foundation
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
function TechniqueChip({ tech }) {
|
||||||
|
const symbol = TECH_SYMBOL[tech]
|
||||||
|
return (
|
||||||
|
<span className="inline-flex items-center gap-1 text-[10px] text-gray-400 border border-border rounded-full px-1.5 py-px">
|
||||||
|
{symbol && <span className="text-amber font-semibold" aria-hidden="true">{symbol}</span>}
|
||||||
|
{tech}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Same ▶ pill as BassPatternCard / VoicingBrowser (classes mirrored so every
|
||||||
|
// gallery reads identically).
|
||||||
|
function PlayButton({ ariaLabel, onClick }) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
onClick={onClick}
|
||||||
|
className={
|
||||||
|
'inline-flex h-7 shrink-0 items-center gap-1.5 rounded-full border border-accent ' +
|
||||||
|
'bg-surface px-2.5 text-xs font-semibold text-accent outline-none transition ' +
|
||||||
|
'hover:bg-accent hover:text-black focus-visible:ring-2 focus-visible:ring-accent'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 12 12" className="h-3 w-3 fill-current">
|
||||||
|
<path d="M2.5 1.5v9l8-4.5z" />
|
||||||
|
</svg>
|
||||||
|
Play
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function PlaceholderCard({ name, size }) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`bg-surface border border-border rounded-lg flex flex-col items-center justify-center text-gray-500 ${size === 'thumb' ? 'p-2 min-h-[72px]' : 'p-4 min-h-[110px]'}`}
|
||||||
|
role="group"
|
||||||
|
aria-label={name ? `${name}: lick unavailable` : 'lick unavailable'}
|
||||||
|
>
|
||||||
|
<span className="text-lg leading-none" aria-hidden="true">—</span>
|
||||||
|
<span className="text-[10px] mt-1">
|
||||||
|
{name ? `${name} — lick unavailable` : 'lick unavailable'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <PianoLickCard lick={…} rootPc={0–11} chordLabel? size="thumb"|"full" />
|
||||||
|
* Pure/presentational — realizes one KB piano lick over the live chord root;
|
||||||
|
* never crashes on bad data. See the header for the full wiring contract.
|
||||||
|
*/
|
||||||
|
export default function PianoLickCard({ lick, rootPc, chordLabel, size = 'full' }) {
|
||||||
|
const realized = realizePianoLick(lick, rootPc)
|
||||||
|
const name = typeof lick?.name === 'string' && lick.name.trim() ? lick.name : 'Untitled lick'
|
||||||
|
|
||||||
|
// Unmount (loop/style/instrument change) silences any running sequence —
|
||||||
|
// module-level state, so this is idempotent across sibling cards.
|
||||||
|
useEffect(() => () => stopLick(), [])
|
||||||
|
|
||||||
|
if (!realized) {
|
||||||
|
return <PlaceholderCard name={lick ? name : null} size={size} />
|
||||||
|
}
|
||||||
|
|
||||||
|
const full = size === 'full'
|
||||||
|
const chordName =
|
||||||
|
typeof chordLabel === 'string' && chordLabel.trim()
|
||||||
|
? chordLabel
|
||||||
|
: `${NOTES[mod12(rootPc)]}${CHORD_TYPES[lick.quality]?.suffix ?? lick.quality}`
|
||||||
|
const chordContext =
|
||||||
|
typeof lick.chordContext === 'string' && lick.chordContext.trim() ? lick.chordContext : null
|
||||||
|
const techniques = Array.isArray(lick.techniques)
|
||||||
|
? lick.techniques.filter((t) => typeof t === 'string' && t.trim())
|
||||||
|
: []
|
||||||
|
const source = typeof lick.source === 'string' && lick.source.trim() ? lick.source : null
|
||||||
|
const tips = typeof lick.tips === 'string' && lick.tips.trim() ? lick.tips : null
|
||||||
|
|
||||||
|
const layout = layoutLick(realized, rootPc)
|
||||||
|
const pitchNames = realized.map((n) => absName(n.abs)).join(', ')
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`bg-surface border border-border rounded-lg flex flex-col ${full ? 'p-3 gap-2' : 'p-2 gap-1.5'}`}
|
||||||
|
role="group"
|
||||||
|
aria-label={`${name} — over ${chordName}${chordContext ? ` (${chordContext})` : ''}`}
|
||||||
|
>
|
||||||
|
{/* Header: name + level badge */}
|
||||||
|
<div className="flex items-start justify-between gap-2">
|
||||||
|
<span className={`text-gray-200 font-semibold leading-tight ${full ? 'text-sm' : 'text-[11px]'}`}>
|
||||||
|
{name}
|
||||||
|
</span>
|
||||||
|
<LevelBadge level={lick.level} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Where it lands */}
|
||||||
|
{full && chordContext && (
|
||||||
|
<div>
|
||||||
|
<span className="inline-block text-[10px] font-medium text-accent bg-accent/10 border border-accent/40 rounded-full px-2 py-px">
|
||||||
|
{chordContext} · here: {chordName}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* The pitch timeline */}
|
||||||
|
<div className="max-w-full overflow-x-auto">
|
||||||
|
<TimelineSvg
|
||||||
|
layout={layout}
|
||||||
|
ariaLabel={`Melody for ${name} over ${chordName}: ${pitchNames}`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Keyboard view (full): the actual keys, numbered in strike order */}
|
||||||
|
{full && (
|
||||||
|
<div className="max-w-full overflow-x-auto">
|
||||||
|
<LickKeyboard
|
||||||
|
realized={realized}
|
||||||
|
ariaLabel={`Keys for ${name} over ${chordName}, numbered in playing order`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Technique tags */}
|
||||||
|
{full && techniques.length > 0 && (
|
||||||
|
<div className="flex flex-wrap gap-1">
|
||||||
|
{techniques.map((t) => <TechniqueChip key={t} tech={t} />)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Transferable idea + attribution */}
|
||||||
|
{full && tips && <p className="text-[10px] leading-snug text-gray-500">{tips}</p>}
|
||||||
|
{full && source && (
|
||||||
|
<span className="text-[10px] text-gray-500 italic leading-snug">{source}</span>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<PlayButton
|
||||||
|
ariaLabel={`Play ${name} over ${chordName}`}
|
||||||
|
onClick={() => playLick(realized)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Glyph legend — render ONCE per lick grid (LickCard contract) ─────────────
|
||||||
|
|
||||||
|
function LegendSample({ children, w = 22 }) {
|
||||||
|
return (
|
||||||
|
<svg viewBox={`0 0 ${w} 18`} width={w} height={18} aria-hidden="true"
|
||||||
|
style={{ display: 'inline-block', verticalAlign: 'middle' }}>
|
||||||
|
{children}
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PianoTechniqueLegend() {
|
||||||
|
const items = [
|
||||||
|
{
|
||||||
|
key: 'grace-note', label: 'grace note',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<circle cx={5} cy={7} r={2} fill={AMBER} />
|
||||||
|
<line x1={2} y1={10} x2={8} y2={4} stroke={AMBER} strokeWidth={1} strokeLinecap="round" />
|
||||||
|
<path d="M 7 8 Q 12 5 16 10" fill="none" stroke={AMBER} strokeWidth={0.9} />
|
||||||
|
<circle cx={17} cy={12} r={3} fill={NOTE_TEXT} />
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'slide', label: 'slide (key-slip)',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<line x1={4} y1={13} x2={18} y2={5} stroke={AMBER} strokeWidth={1.6} strokeLinecap="round" />
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'double-stop', label: 'double-stop (stacked)',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<text x={11} y={8} textAnchor="middle" fontSize={8} fontWeight="600" fill={NOTE_TEXT}>G</text>
|
||||||
|
<text x={11} y={17} textAnchor="middle" fontSize={8} fontWeight="600" fill={NOTE_TEXT}>D</text>
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'ghost-note', label: 'ghost note',
|
||||||
|
sample: (
|
||||||
|
<LegendSample>
|
||||||
|
<text x={11} y={12} textAnchor="middle" fontSize={9} fontWeight="600" fill={GHOST_TEXT}>(E)</text>
|
||||||
|
</LegendSample>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
return (
|
||||||
|
<div className="flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[11px] text-gray-400">
|
||||||
|
{items.map((it) => (
|
||||||
|
<span key={it.key} className="inline-flex items-center gap-1.5">
|
||||||
|
{it.sample}
|
||||||
|
{it.label}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
<span className="text-gray-500">amber = chromatic approach · purple = chord tone · R line = the root</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Dev fixture — SCHEMA.md's worked enclosure (P-60 real data replaces this
|
||||||
|
// in the app; exported so the card can be exercised before P-60 lands) ─────
|
||||||
|
|
||||||
|
export const DEMO_PIANO_LICK = {
|
||||||
|
id: 'jazz-enclosure-into-3',
|
||||||
|
name: 'Bebop enclosure into the 3rd',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the ii7',
|
||||||
|
quality: 'min7',
|
||||||
|
techniques: ['grace-note'],
|
||||||
|
source: 'Barry Harris workshop vocabulary',
|
||||||
|
notes: [
|
||||||
|
{ deg: '5', octave: 1, beat: 1 },
|
||||||
|
{ approach: 'chrom-above', beat: 2 },
|
||||||
|
{ approach: 'chrom-below', beat: 2.5 },
|
||||||
|
{ deg: '3', octave: 1, beat: 3, technique: 'grace-note' },
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -0,0 +1,303 @@
|
|||||||
|
// VoicingBrowser — a playable voicing GALLERY for ONE chord (task D-30; was the
|
||||||
|
// chip-switched browser of D-21/D-23).
|
||||||
|
//
|
||||||
|
// For a given { rootPc, quality } it shows every way the KB knows to voice that
|
||||||
|
// chord — ALL AT ONCE, no chips, no selection state (user directive 2026-07-10:
|
||||||
|
// "see all the variations G shape, C shape, etc in one view without having to
|
||||||
|
// push a button. so they all line up next to each other"):
|
||||||
|
//
|
||||||
|
// Guitar section — every placeable `GUITAR_SHAPES[quality]` entry from
|
||||||
|
// src/lib/voicings.js (open shapes only in their native key, movable shapes
|
||||||
|
// only when the whole grip fits under fret 15), each cell = shape label +
|
||||||
|
// <ChordDiagram size="thumb"/> + its own ▶.
|
||||||
|
// Piano section — all four src/lib/piano.js `pianoVoicing` styles
|
||||||
|
// (root / shell / rootlessA / rootlessB), each cell = the voicing's honest
|
||||||
|
// label (e.g. "rootless A (3-5-7-9)") + <MiniPiano voicing size="thumb"/> +
|
||||||
|
// its own ▶.
|
||||||
|
//
|
||||||
|
// Playback: src/lib/chordAudio.js (L-20). ONE live {stop} handle for the whole
|
||||||
|
// gallery — any ▶ stops the previous sound before starting (chord change and
|
||||||
|
// unmount also stop it), so previews never layer. First ▶ click is the user
|
||||||
|
// gesture that lazily creates the AudioContext.
|
||||||
|
//
|
||||||
|
// Mount points (wired by L-21/L-22, NOT here): Knowledge Center Voicings
|
||||||
|
// section, ChordDetailModal Guitar/Piano tabs (show="guitar"/"piano", L-25),
|
||||||
|
// and the Jam Guide station-enlarge view. This component stays pure & prop-driven.
|
||||||
|
//
|
||||||
|
// Layout: each instrument section is a flex-wrap gallery of fixed-content-width
|
||||||
|
// cells, so it reflows to fewer columns (down to one cell per row) inside a
|
||||||
|
// narrow modal or the Jam Guide dock — no horizontal scroll needed except the
|
||||||
|
// per-cell guard around the widest MiniPiano thumbs (~266px for 2-octave
|
||||||
|
// rootless voicings).
|
||||||
|
//
|
||||||
|
// Props:
|
||||||
|
// rootPc — chord root pitch class 0–11 (default 0 = C)
|
||||||
|
// quality — CHORD_TYPES key; unknown values fall back to 'maj'
|
||||||
|
// (matching voicings.js / piano.js behaviour)
|
||||||
|
// show — 'guitar' | 'piano' | 'both' (default 'both', task D-23): which
|
||||||
|
// instrument section(s) to render. 'bass' (task D-41, D-40 §3)
|
||||||
|
// renders NEITHER gallery — guitar shapes are not bass patterns and
|
||||||
|
// pianoVoicing is piano, so showing either under the global BASS
|
||||||
|
// selector would lie; an honest one-liner renders instead. Any
|
||||||
|
// OTHER value still falls back to both, so every pre-existing
|
||||||
|
// mount renders identically with no prop.
|
||||||
|
// dense — boolean (default false, task L-33 — additive per D-31 §5; D-41
|
||||||
|
// restyled it for the all-expanded GlanceRail rows): drops the
|
||||||
|
// section chrome (border/panel background/heading — the row header
|
||||||
|
// already names the chord) and suppresses the per-mount
|
||||||
|
// mic-feedback microcopy (the rail shows it ONCE for the whole
|
||||||
|
// rail, D-31 §2.5). Every pre-existing mount renders identically
|
||||||
|
// with no prop.
|
||||||
|
|
||||||
|
import { useEffect, useMemo, useRef } from 'react'
|
||||||
|
import ChordDiagram from './ChordDiagram'
|
||||||
|
import MiniPiano from './MiniPiano'
|
||||||
|
import { GUITAR_SHAPES } from '../lib/voicings'
|
||||||
|
import { pianoVoicing } from '../lib/piano'
|
||||||
|
import { playVoicing, guitarShapeToNotes } from '../lib/chordAudio'
|
||||||
|
import { NOTES, CHORD_TYPES } from '../lib/theory'
|
||||||
|
|
||||||
|
// Standard-tuning open-string pitch classes, low-E first (mirrors ChordDiagram).
|
||||||
|
const OPEN_PCS = [4, 9, 2, 7, 11, 4]
|
||||||
|
const PIANO_STYLES = ['root', 'shell', 'rootlessA', 'rootlessB']
|
||||||
|
|
||||||
|
const mod12 = (n) => ((n % 12) + 12) % 12
|
||||||
|
|
||||||
|
// The shapes of `quality` that can actually be shown for this root:
|
||||||
|
// - open shapes only when their native root matches (onlyRoot === rootPc);
|
||||||
|
// - movable shapes only when every fretted string lands in 0–15 under
|
||||||
|
// ChordDiagram's placement convention (root-at-open-string → fret-12 barre).
|
||||||
|
// Unknown quality falls back to maj (same fallback voicings.js itself uses).
|
||||||
|
function matchingShapes(quality, rootPc) {
|
||||||
|
const shapes = GUITAR_SHAPES[quality] ?? GUITAR_SHAPES.maj
|
||||||
|
return shapes.filter((shape) => {
|
||||||
|
if (Array.isArray(shape.frets)) {
|
||||||
|
// Open shape: fixed grip, valid only in its native key.
|
||||||
|
return shape.onlyRoot === undefined || shape.onlyRoot === rootPc
|
||||||
|
}
|
||||||
|
if (!Array.isArray(shape.offsets) || !Number.isFinite(shape.rootStr)) return false
|
||||||
|
const idx = 6 - shape.rootStr // rootStr 6 = low E → low-E-first index 0
|
||||||
|
let baseFret = mod12(rootPc - (OPEN_PCS[idx] ?? 4))
|
||||||
|
if (baseFret === 0) baseFret = 12 // ChordDiagram's octave-barre placement
|
||||||
|
const abs = shape.offsets.filter((o) => typeof o === 'number').map((o) => baseFret + o)
|
||||||
|
if (abs.length === 0) return false
|
||||||
|
return Math.min(...abs) >= 0 && Math.max(...abs) <= 15
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// "C", "Cm7", "Cmaj7"… — display name from the app's canonical chord model.
|
||||||
|
function chordName(rootPc, quality) {
|
||||||
|
const q = CHORD_TYPES[quality] ? quality : 'maj'
|
||||||
|
return `${NOTES[mod12(rootPc)]}${CHORD_TYPES[q].suffix}`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Small presentational atoms ───────────────────────────────────────────────
|
||||||
|
|
||||||
|
// Per-cell ▶. Small accent text sits on bg-surface (#0f0f0f), where accent
|
||||||
|
// #a855f7 measures ≈4.8:1 — AA for small text (surface-background rule).
|
||||||
|
function PlayButton({ ariaLabel, onClick }) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
onClick={onClick}
|
||||||
|
className={
|
||||||
|
'inline-flex h-7 shrink-0 items-center gap-1.5 rounded-full border border-accent ' +
|
||||||
|
'bg-surface px-2.5 text-xs font-semibold text-accent outline-none transition ' +
|
||||||
|
'hover:bg-accent hover:text-black focus-visible:ring-2 focus-visible:ring-accent'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 12 12" className="h-3 w-3 fill-current">
|
||||||
|
<path d="M2.5 1.5v9l8-4.5z" />
|
||||||
|
</svg>
|
||||||
|
Play
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function SectionHeading({ children }) {
|
||||||
|
return (
|
||||||
|
<h4 className="text-[11px] font-semibold uppercase tracking-wider text-gray-400">
|
||||||
|
{children}
|
||||||
|
</h4>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// One gallery cell: label on top, diagram thumb, its own ▶ underneath.
|
||||||
|
// bg-surface inside the bg-panel section gives the cells a quiet inlay border;
|
||||||
|
// label is gray-300 on surface (AA comfortable at 11px semibold).
|
||||||
|
function GalleryCell({ label, playLabel, onPlay, children }) {
|
||||||
|
return (
|
||||||
|
<figure className="flex min-w-0 flex-col items-center gap-1.5 rounded-md border border-border bg-surface p-2">
|
||||||
|
<figcaption
|
||||||
|
className="max-w-full break-words text-center text-[11px] font-medium leading-tight text-gray-300"
|
||||||
|
title={label}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</figcaption>
|
||||||
|
{/* Scroll guard: MiniPiano's SVG has a fixed pixel width (up to ~266px
|
||||||
|
for a 2-octave thumb window); scroll inside the cell on very narrow
|
||||||
|
viewports rather than letting it break the wrap layout. */}
|
||||||
|
<div className="max-w-full overflow-x-auto">{children}</div>
|
||||||
|
<PlayButton ariaLabel={playLabel} onClick={onPlay} />
|
||||||
|
</figure>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── The gallery ──────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
export default function VoicingBrowser({ rootPc = 0, quality = 'maj', show = 'both', dense = false }) {
|
||||||
|
const pc = mod12(Number.isFinite(rootPc) ? rootPc : 0)
|
||||||
|
const name = chordName(pc, quality)
|
||||||
|
const chordKey = `${pc}:${quality}`
|
||||||
|
|
||||||
|
// Section gating (D-23; 'bass' added by D-41 per D-40 §3). 'guitar' hides
|
||||||
|
// the piano section, 'piano' hides the guitar section, 'bass' hides BOTH
|
||||||
|
// (neither gallery is honest for a bassist — the one-liner below renders
|
||||||
|
// instead, so the dock's VoicingsSection under the global BASS selector
|
||||||
|
// stops showing guitar+piano). Anything else (incl. the 'both' default)
|
||||||
|
// shows both. Hooks stay unconditional; the shared stop-handle discipline
|
||||||
|
// (stop on chord change / unmount) is untouched by hiding a section.
|
||||||
|
const showGuitar = show !== 'piano' && show !== 'bass'
|
||||||
|
const showPiano = show !== 'guitar' && show !== 'bass'
|
||||||
|
|
||||||
|
const guitarShapes = useMemo(() => matchingShapes(quality, pc), [quality, pc])
|
||||||
|
const pianoOptions = useMemo(
|
||||||
|
() =>
|
||||||
|
PIANO_STYLES.map((style) => ({
|
||||||
|
style,
|
||||||
|
voicing: pianoVoicing({ rootPc: pc, quality }, { style }),
|
||||||
|
})),
|
||||||
|
[pc, quality],
|
||||||
|
)
|
||||||
|
|
||||||
|
// One live playback handle for the whole gallery: any new play (or chord
|
||||||
|
// change, or unmount) stops the previous sound first — the L-20 {stop}
|
||||||
|
// contract, so previews never layer or leak.
|
||||||
|
const handleRef = useRef(null)
|
||||||
|
const stopCurrent = () => {
|
||||||
|
handleRef.current?.stop()
|
||||||
|
handleRef.current = null
|
||||||
|
}
|
||||||
|
|
||||||
|
// Chord change → cleanup silences the old preview; same cleanup covers unmount.
|
||||||
|
useEffect(() => stopCurrent, [chordKey])
|
||||||
|
|
||||||
|
// Known advisory (L-20 gate): when a movable shape's root lands on an open
|
||||||
|
// string (base fret 0), ChordDiagram draws the fret-12 octave barre while
|
||||||
|
// guitarShapeToNotes places the grip at the open position — the SAME chord,
|
||||||
|
// one octave lower than drawn. Deliberately left as-is on both sides.
|
||||||
|
function playGuitar(shape) {
|
||||||
|
stopCurrent()
|
||||||
|
handleRef.current = playVoicing(guitarShapeToNotes(shape, { rootPc: pc }), {
|
||||||
|
strumMs: 45, // a light strum reads "guitar"
|
||||||
|
durMs: 1800,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function playPiano(voicing) {
|
||||||
|
stopCurrent()
|
||||||
|
handleRef.current = playVoicing(voicing?.notes ?? [], {
|
||||||
|
strumMs: 15, // near-block chord reads "piano"
|
||||||
|
durMs: 1800,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex w-full min-w-0 flex-wrap gap-2">
|
||||||
|
{/* ── Guitar section: every placeable shape, side by side ── */}
|
||||||
|
{showGuitar && (
|
||||||
|
<section
|
||||||
|
aria-label={`Guitar voicings for ${name}`}
|
||||||
|
className={`min-w-[240px] flex-1 basis-[300px] ${dense ? '' : 'rounded-lg border border-border bg-panel p-3'}`}
|
||||||
|
>
|
||||||
|
{/* dense (a GlanceRail row): the row header already names the chord and
|
||||||
|
the global selector names the instrument — no repeated heading. */}
|
||||||
|
{!dense && (
|
||||||
|
<div className="mb-2">
|
||||||
|
<SectionHeading>Guitar · {name}</SectionHeading>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{guitarShapes.length === 0 ? (
|
||||||
|
// Graceful: nothing placeable for this root/quality — say so, no crash.
|
||||||
|
<p className="text-xs text-gray-400">
|
||||||
|
No guitar shape sits comfortably for {name} — try the piano voicings.
|
||||||
|
</p>
|
||||||
|
) : (
|
||||||
|
<div
|
||||||
|
role="group"
|
||||||
|
aria-label={`${name} guitar shapes — every shape shown, each playable`}
|
||||||
|
className="flex flex-wrap items-stretch gap-2"
|
||||||
|
>
|
||||||
|
{guitarShapes.map((shape, i) => (
|
||||||
|
<GalleryCell
|
||||||
|
key={`${shape.label}-${i}`}
|
||||||
|
label={shape.label}
|
||||||
|
playLabel={`Play ${name} — ${shape.label} guitar voicing`}
|
||||||
|
onPlay={() => playGuitar(shape)}
|
||||||
|
>
|
||||||
|
<ChordDiagram shape={shape} rootPc={pc} size="thumb" />
|
||||||
|
</GalleryCell>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* ── Piano section: all four voicing styles, side by side ── */}
|
||||||
|
{showPiano && (
|
||||||
|
<section
|
||||||
|
aria-label={`Piano voicings for ${name}`}
|
||||||
|
className={`min-w-[240px] flex-1 basis-[300px] ${dense ? '' : 'rounded-lg border border-border bg-panel p-3'}`}
|
||||||
|
>
|
||||||
|
{!dense && (
|
||||||
|
<div className="mb-2">
|
||||||
|
<SectionHeading>Piano · {name}</SectionHeading>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div
|
||||||
|
role="group"
|
||||||
|
aria-label={`${name} piano voicings — every style shown, each playable`}
|
||||||
|
className="flex flex-wrap items-stretch gap-2"
|
||||||
|
>
|
||||||
|
{/* pianoVoicing() output carries no rootPc, and without it VoicingPiano
|
||||||
|
falls back to the LOWEST voice for its "R" badge — wrong for rootless
|
||||||
|
voicings, whose bass is the 3rd (A) or 7th (B). Supply the chord root. */}
|
||||||
|
{pianoOptions.map(({ style, voicing }) => (
|
||||||
|
<GalleryCell
|
||||||
|
key={style}
|
||||||
|
label={voicing.label}
|
||||||
|
playLabel={`Play ${name} — ${voicing.label} piano voicing`}
|
||||||
|
onPlay={() => playPiano(voicing)}
|
||||||
|
>
|
||||||
|
<MiniPiano voicing={{ ...voicing, rootPc: pc }} size="thumb" />
|
||||||
|
</GalleryCell>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* ── show='bass' (D-41, D-40 §3): no gallery would be honest — say so
|
||||||
|
in one line instead of rendering guitar+piano under BASS. ── */}
|
||||||
|
{!showGuitar && !showPiano && (
|
||||||
|
<p className="text-xs text-gray-400">
|
||||||
|
No bass voicings for {name} yet — authored bass patterns are on the way
|
||||||
|
(blues first). Guitar and piano voicings live under those instruments.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Mic-feedback caveat, per the L-20 header + D-20 §3 (microcopy tier).
|
||||||
|
Skipped under `dense`, where the GlanceRail shows the SAME microcopy
|
||||||
|
once for the whole rail (D-31 §2.5) instead of per gallery — and under
|
||||||
|
'bass', where there is no ▶ to caveat. */}
|
||||||
|
{!dense && (showGuitar || showPiano) && (
|
||||||
|
<p className="w-full basis-full text-[11px] text-gray-500">
|
||||||
|
Previews play through your speakers — while the mic is live, detection may
|
||||||
|
hear them.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
+225
-7
@@ -46,12 +46,20 @@ export default [
|
|||||||
mode: 'major', // major | minor | dorian | mixolydian | …
|
mode: 'major', // major | minor | dorian | mixolydian | …
|
||||||
songs: ['Autumn Leaves'],
|
songs: ['Autumn Leaves'],
|
||||||
tip: 'One transferable idea.',
|
tip: 'One transferable idea.',
|
||||||
|
level: 'intermediate', // OPTIONAL: 'foundation' | 'intermediate'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
4–8 progressions per style. Cross-check `docs/progression-repertoire.md` §1.
|
4–8 progressions per style. Cross-check `docs/progression-repertoire.md` §1.
|
||||||
|
|
||||||
|
**`level` (optional).** Tags the progression's difficulty for the in-app level
|
||||||
|
filter. Allowed values: `'foundation'` (the style's bread-and-butter loops) or
|
||||||
|
`'intermediate'` (secondary dominants, chained ii–Vs, backdoor, borrowed
|
||||||
|
chords…). **Omitting the field is fine and means `'foundation'`** — consumers
|
||||||
|
treat an absent `level` as foundation, so existing styles need no edits. The
|
||||||
|
validator only checks the value when the field is present.
|
||||||
|
|
||||||
## Instrument packs
|
## Instrument packs
|
||||||
|
|
||||||
Common envelope:
|
Common envelope:
|
||||||
@@ -60,7 +68,7 @@ Common envelope:
|
|||||||
export default {
|
export default {
|
||||||
styleIntro: '2-3 sentences on this instrument's role in the style.',
|
styleIntro: '2-3 sentences on this instrument's role in the style.',
|
||||||
comping: [{ label, rhythm, description }], // ≥1 named rhythm
|
comping: [{ label, rhythm, description }], // ≥1 named rhythm
|
||||||
plays: { '<progression-id>': [ <play>, <play> ] }, // ≥2 plays per progression
|
plays: { '<progression-id>': [ <play>, <play> ] }, // ≥2 plays per progression (bass: ≥1 — see Bass play)
|
||||||
improv: { // guitar/piano; optional for bass
|
improv: { // guitar/piano; optional for bass
|
||||||
scales: [{ over: 'ii7', scale: 'dorian', why }],
|
scales: [{ over: 'ii7', scale: 'dorian', why }],
|
||||||
targetNotes: '…',
|
targetNotes: '…',
|
||||||
@@ -100,6 +108,14 @@ export default {
|
|||||||
|
|
||||||
Voicings are degree recipes resolved through the chord quality. Degrees: `'1' '3' '5' '7'` resolve per quality (e.g. `'3'` → ♭3 for min7); altered/extended degrees are explicit: `'b9' '9' '#9' '11' '#11' 'b13' '13' '6'`.
|
Voicings are degree recipes resolved through the chord quality. Degrees: `'1' '3' '5' '7'` resolve per quality (e.g. `'3'` → ♭3 for min7); altered/extended degrees are explicit: `'b9' '9' '#9' '11' '#11' 'b13' '13' '6'`.
|
||||||
|
|
||||||
|
> **Resolver quirk (both hand-synced `resolveDegree` copies —
|
||||||
|
> `scripts/validate-kb.mjs` and `src/components/JamGuide.jsx`):** on
|
||||||
|
> `maj6`/`min6` the degree `'7'` resolves to **9 semitones, i.e. the 6th**
|
||||||
|
> (those qualities have no 7th in their interval set, and the resolver takes
|
||||||
|
> the top stack tone as the "7 slot"). It never misspells the chord, but when
|
||||||
|
> you mean the 6th, write `'6'` explicitly — don't lean on `'7'`. This applies
|
||||||
|
> equally to bass patterns below, which share the same resolver.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
label: 'Rootless A/B alternation',
|
label: 'Rootless A/B alternation',
|
||||||
@@ -115,17 +131,216 @@ Voicings are degree recipes resolved through the chord quality. Degrees: `'1' '3
|
|||||||
|
|
||||||
### Bass play
|
### Bass play
|
||||||
|
|
||||||
|
A bass play is per-station patterns: `chords` has **one entry per progression
|
||||||
|
step** (like guitar/piano plays), each carrying the ordered notes the bassist
|
||||||
|
plays over that chord.
|
||||||
|
|
||||||
|
Patterns are **degree-based** — the piano-recipe language — not string/fret
|
||||||
|
tab. Why: hard rule 1. A bass play renders over every station of a *detected*
|
||||||
|
loop in the *detected* key, so the data must transpose automatically; and a
|
||||||
|
degree either resolves through the chord quality or it doesn't — you cannot
|
||||||
|
misspell a pitch class, only mislabel your intent. Fret tab was considered and
|
||||||
|
rejected: absolute frets are key-specific (licks are the one documented
|
||||||
|
exception, and they say so), and a movable-fret variant breaks at the nut —
|
||||||
|
exactly where bass lives, on open strings. The open-string/position idiom
|
||||||
|
belongs in authoring prose: the optional `position` hint.
|
||||||
|
|
||||||
|
Rendering convention (for the per-station pattern card): standard 4-string
|
||||||
|
tuning **E–A–D–G**, strings numbered **1 = G (highest) … 4 = E (lowest)** —
|
||||||
|
the same "1 = highest string" convention as lick tab and `rootStr`, so no
|
||||||
|
third counting scheme exists in this codebase. The renderer places each
|
||||||
|
pattern in the lowest playable position within frets 0–15; the data itself
|
||||||
|
never encodes strings or frets.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
label: 'Walking, chromatic approach',
|
label: 'Boogie cell',
|
||||||
level: 'intermediate',
|
level: 'foundation',
|
||||||
bars: [{ beats: ['R', '3', '5', 'chrom>'] }], // per bar of the progression
|
feel: 'swung 8ths, locked with the kick', // REQUIRED — the groove in one line
|
||||||
// beat tokens: R 3 5 7 (chord degrees) · 'chrom>' / 'chrom<' (chromatic into next root
|
chords: [ // one per progression step
|
||||||
// from below/above) · '5>' (dominant approach) · 'x' (ghost) · '-' (hold)
|
{
|
||||||
tips: '…',
|
pattern: [ // the ORDERED notes (played first → last)
|
||||||
|
{ deg: '1', beat: 1 }, // chord/color tone, resolved through the quality
|
||||||
|
{ deg: '3', beat: 2 },
|
||||||
|
{ deg: '5', beat: 3, technique: 'ghost-note' }, // technique optional (lick vocabulary)
|
||||||
|
{ approach: 'chrom-below', beat: 4 }, // leads into the NEXT station's root
|
||||||
|
],
|
||||||
|
note: 'walk up into the IV', // optional, as in guitar/piano plays
|
||||||
|
},
|
||||||
|
// …
|
||||||
|
],
|
||||||
|
position: 'first five frets; open E and A when the key allows', // OPTIONAL prose hint
|
||||||
|
tips: 'Transferable idea.',
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Field rules (all enforced by `node scripts/validate-kb.mjs` when a `bass.js`
|
||||||
|
pack exists — a style without one is complete and valid):
|
||||||
|
|
||||||
|
| Field | Rule |
|
||||||
|
|---|---|
|
||||||
|
| `feel` | required non-empty string — bass is a rhythm role; the pattern alone doesn't say swung vs straight |
|
||||||
|
| `chords` | array, exactly one entry per progression step |
|
||||||
|
| `pattern` | non-empty ordered array; ≤ 8 notes per bar of its step (straight-8ths density cap — rule 3) |
|
||||||
|
| note shape | exactly one of `deg` \| `approach` per note |
|
||||||
|
| `deg` | a degree **string** from the piano-recipe language above, resolved through the step's quality (`'1' '3' '5' '7'` quality-resolved; `'b3' '6' 'b7' 'b9' '9' '#9' '11' '#11' 'b5' 'b13' '13'` explicit). The maj6/min6 `'7'` quirk above applies — write `'6'` |
|
||||||
|
| root rule | every pattern states `'1'` at least once — a bassline grounds the chord (a deliberately rootless play needs a schema change, not silence) |
|
||||||
|
| `octave` | optional on `deg` notes, `0` (default) or `1`; the resolved offset `deg + 12·octave` must stay **≤ 19 semitones** (an octave + a fifth) so every pattern sits on E–A–D–G within frets 0–15 in one position |
|
||||||
|
| `approach` | `'chrom-below'` (next root − 1 semitone) · `'chrom-above'` (next root + 1) · `'fifth-of-next'` (next root + 7). The pitch is **derived from the next station's root** (last step wraps to the first), never authored — that's why the validator can allow a non-chord tone here while untyped chromatics stay illegal. Approach notes must be the **final note(s)** of the pattern — they lead into the next chord |
|
||||||
|
| `beat` | optional number, `1 ≤ beat < 4·bars + 1` for that step (patterns are notated in 4 — a 12/8 shuffle is `feel`, not extra beats); non-decreasing in pattern order (equal beats = a dyad) |
|
||||||
|
| `technique` | optional per note, from the fixed lick technique vocabulary (see Licks) |
|
||||||
|
|
||||||
|
**Coverage: every progression of the style needs ≥ 1 bass play** — deliberately
|
||||||
|
1, not the guitar/piano 2. The band wants ONE bassline at a time, and rule 4's
|
||||||
|
"idiomatically different" bar is hard to clear twice per progression without
|
||||||
|
filler. A second play is welcome where a genuinely different lane exists
|
||||||
|
(two-feel vs walking, say) — the validator sets a floor, not a ceiling.
|
||||||
|
|
||||||
|
## Licks (optional)
|
||||||
|
|
||||||
|
A style's instrument pack may also teach short, named licks — the ordered-note
|
||||||
|
phrases the Licks & Techniques cards render. **The whole section is optional**:
|
||||||
|
a pack without licks is complete and valid. Guitar licks are tab-based (this
|
||||||
|
section); piano licks are degree-based (next section).
|
||||||
|
|
||||||
|
**How to register licks:** add a `licks` array as one more top-level key on the
|
||||||
|
instrument pack's default export (next to `styleIntro`/`comping`/`plays`/`improv`
|
||||||
|
in e.g. `src/data/kb/blues/guitar.js`). No change to `src/data/kb/index.js` is
|
||||||
|
needed — the registry already exposes the whole pack, and the UI reads
|
||||||
|
`kb[style].instruments.guitar.licks ?? []`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
export default {
|
||||||
|
styleIntro: '…',
|
||||||
|
comping: [ /* … */ ],
|
||||||
|
plays: { /* … */ },
|
||||||
|
improv: { /* … */ },
|
||||||
|
|
||||||
|
// OPTIONAL — structured licks (this section):
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
id: 'blues-box1-bb-answer', // '<style>-<slug>', globally unique
|
||||||
|
// (shares ONE id namespace with progression ids)
|
||||||
|
name: 'B.B. box answer phrase',
|
||||||
|
level: 'foundation', // 'foundation' | 'intermediate' (required)
|
||||||
|
chordContext: 'over the I7', // which chord/station it fits — free text,
|
||||||
|
// e.g. 'dom7' or 'over the V7 turnaround'
|
||||||
|
techniques: ['bend', 'vibrato'], // summary tags, from the fixed vocabulary below
|
||||||
|
source: 'the B.B. King box, e.g. "The Thrill Is Gone" fills', // recommended attribution
|
||||||
|
tab: [ // the ORDERED note sequence (played first → last)
|
||||||
|
{ string: 2, fret: 8 }, // string 1 = high e … 6 = low E
|
||||||
|
{ string: 1, fret: 8, technique: 'bend' }, // fret 0 (open) … 15
|
||||||
|
{ string: 1, fret: 10, technique: 'vibrato' }, // technique is optional per note
|
||||||
|
{ string: 2, fret: 8 },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Field rules (all enforced by `node scripts/validate-kb.mjs` when `licks` is present):
|
||||||
|
|
||||||
|
| Field | Rule |
|
||||||
|
|---|---|
|
||||||
|
| `id` | starts with `'<style>-'`; globally unique across **all** progression and lick ids in the whole KB |
|
||||||
|
| `name` | required, non-empty |
|
||||||
|
| `level` | `'foundation'` or `'intermediate'` — nothing else |
|
||||||
|
| `chordContext` | required, non-empty string — tells the player *where* the lick lands |
|
||||||
|
| `techniques` | array; every entry from the fixed vocabulary below (empty array = plain-picked) |
|
||||||
|
| `tab` | non-empty ordered array of `{string, fret, technique?}` |
|
||||||
|
| `tab[].string` | integer 1–6 (**1 = high e, 6 = low E** — standard tab convention; note `rootStr` in shapes counts the same way) |
|
||||||
|
| `tab[].fret` | integer 0–15 (0 = open string) |
|
||||||
|
| `tab[].technique` | optional; from the vocabulary; must **also** appear in the lick's `techniques[]` summary so card tags stay honest |
|
||||||
|
| `source` | optional but recommended — name where the lick comes from (checklist: nothing invented) |
|
||||||
|
|
||||||
|
**Fixed technique vocabulary** (both for `techniques[]` and per-note `technique`
|
||||||
|
— the validator rejects anything else):
|
||||||
|
|
||||||
|
`hammer-on` · `pull-off` · `slide` · `bend` · `double-stop` · `ghost-note` · `chromatic-approach` · `vibrato`
|
||||||
|
|
||||||
|
Like shapes, licks are **key-agnostic in spirit**: write them where they sit in
|
||||||
|
the style's home position and say in `chordContext` which chord they fit; the
|
||||||
|
tab renders as absolute string/fret positions.
|
||||||
|
|
||||||
|
Note: the older freeform `improv.licks` (prose `{tab/notation, description,
|
||||||
|
over, source}`) is unchanged and still welcome — it feeds the improv text
|
||||||
|
section. This top-level `licks` array is the *structured* shape that the lick
|
||||||
|
cards render and the validator checks.
|
||||||
|
|
||||||
|
## Piano licks (optional, degree-based)
|
||||||
|
|
||||||
|
A piano pack's `licks` array uses the **degree language**, not tab — the same
|
||||||
|
reasoning as bass patterns (hard rule 1): a lick renders over a *detected*
|
||||||
|
chord in the *detected* key, so the data must transpose automatically, and a
|
||||||
|
degree either resolves through the stated quality or it doesn't — you cannot
|
||||||
|
misspell a pitch, only mislabel your intent. Registration is identical to
|
||||||
|
guitar licks: a top-level `licks` key on `<style>/piano.js`; no registry
|
||||||
|
change; the section is optional.
|
||||||
|
|
||||||
|
Unlike guitar licks (whose tab is instrument-truth and needs no quality),
|
||||||
|
degree-based licks **require an explicit `quality`** — a `CHORD_TYPES` key —
|
||||||
|
so the validator can resolve every degree. `chordContext` stays the human
|
||||||
|
sentence; `quality` is the machine truth. They must agree by eye ("over the
|
||||||
|
ii7" → `min7`); the validator can only check the machine half.
|
||||||
|
|
||||||
|
```js
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
id: 'jazz-enclosure-into-3', // '<style>-<slug>', same global id namespace
|
||||||
|
name: 'Bebop enclosure into the 3rd',
|
||||||
|
level: 'intermediate', // 'foundation' | 'intermediate'
|
||||||
|
chordContext: 'over the ii7', // human text, as in guitar licks
|
||||||
|
quality: 'min7', // REQUIRED — CHORD_TYPES key every deg resolves through
|
||||||
|
techniques: ['grace-note'], // summary tags, PIANO vocabulary (below)
|
||||||
|
source: 'Barry Harris workshop vocabulary', // recommended attribution
|
||||||
|
notes: [ // the ORDERED melodic line (played first → last)
|
||||||
|
{ deg: '5', octave: 1, beat: 1 },
|
||||||
|
{ approach: 'chrom-above', beat: 2 }, // targets the NEXT deg note
|
||||||
|
{ approach: 'chrom-below', beat: 2.5 }, // enclosure: above, below…
|
||||||
|
{ deg: '3', octave: 1, beat: 3, technique: 'grace-note' }, // …target
|
||||||
|
],
|
||||||
|
tips: 'Optional transferable idea.', // optional, unlike guitar licks
|
||||||
|
},
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Field rules (enforced by `node scripts/validate-kb.mjs` when a piano pack has
|
||||||
|
`licks`; guitar packs keep the tab rules above — the validator routes by
|
||||||
|
instrument):
|
||||||
|
|
||||||
|
| Field | Rule |
|
||||||
|
|---|---|
|
||||||
|
| `id` `name` `level` `chordContext` | exactly as guitar licks (shared global id namespace) |
|
||||||
|
| `quality` | required, a `CHORD_TYPES` key — the context every `deg` resolves through |
|
||||||
|
| `techniques` | array; every entry from the **piano vocabulary** below (empty = plain) |
|
||||||
|
| `notes` | non-empty ordered array; ≤ 16 notes (8ths over the 2-bar beat window — rule 3); the **final note must be a `deg` note** |
|
||||||
|
| note shape | exactly one of `deg` \| `approach` per note |
|
||||||
|
| `deg` | a degree **string** from the piano-recipe language, resolved through `quality` (the maj6/min6 `'7'` quirk applies — write `'6'`) |
|
||||||
|
| `octave` | optional on `deg` notes, `0` (default) \| `1` \| `2` |
|
||||||
|
| range cap | every resolved offset — `deg`: `pc + 12·octave`; `approach`: derived (below) — must sit in **[0, 25]** semitones above the root. Proof: MiniPiano's render window is absolute notes [0, 36] (0 = low C); placing the root at its pitch class in the bottom octave (0–11), the highest possible note is 11 + 25 = 36 — the window's top key — so **every lick fits the window in all 12 keys**. (Note `octave: 2` is only legal where the cap allows — e.g. ending on the high root `'1'`.) |
|
||||||
|
| `approach` | `'chrom-below'` (target − 1 semitone) · `'chrom-above'` (target + 1). The **target is the next `deg` note** in `notes[]` order, scanning past intervening approaches — so `chrom-above, chrom-below, deg` is the classic enclosure and both approaches frame the same target. The pitch is always **derived**, never authored (that's why a non-chord tone is legal here while untyped chromatics stay illegal). Guitar licks have no "next station", so unlike bass approaches these target a note *inside* the lick — and therefore **cannot close it** (nothing to target). Consecutive approaches must **differ in type** (two of the same type would derive the identical pitch — write the note you mean as a `deg` instead). No `octave` on approach notes. |
|
||||||
|
| `beat` | optional number, `1 ≤ beat < 9` (a lick spans at most two 4/4 bars); non-decreasing in order (equal beats = grace-note placement or a dyad) |
|
||||||
|
| `technique` | optional per note, from the piano vocabulary; must also appear in `techniques[]` (same honesty rule as guitar) |
|
||||||
|
| `source` | optional but recommended (checklist: nothing invented) |
|
||||||
|
| `tips` | optional string |
|
||||||
|
|
||||||
|
No root rule (unlike bass): a melodic line targets 3rds and 7ths; grounding
|
||||||
|
the root is the bassist's job.
|
||||||
|
|
||||||
|
**Piano technique vocabulary** (a distinct list from the guitar vocabulary —
|
||||||
|
keys don't bend, hammer, or sustain vibrato; the shared words keep their
|
||||||
|
guitar-lick meanings):
|
||||||
|
|
||||||
|
`slide` (the blues key-slip, off a black key onto its neighbour) ·
|
||||||
|
`double-stop` (two keys struck together) · `ghost-note` (barely-voiced filler)
|
||||||
|
· `grace-note` (crushed ornament into the main note — piano-specific)
|
||||||
|
|
||||||
|
The first three are shared with the guitar vocabulary and mean the same thing;
|
||||||
|
`grace-note` exists only here. The smoke test guards both lists (and, once
|
||||||
|
`PianoLickCard.jsx` exists, its exported `PIANO_TECHNIQUE_VOCAB` must be
|
||||||
|
set-equal to the validator's `PIANO_LICK_TECHNIQUES` — same hand-sync rule as
|
||||||
|
LickCard).
|
||||||
|
|
||||||
## Musician checklist (self-review before committing)
|
## Musician checklist (self-review before committing)
|
||||||
|
|
||||||
- [ ] Plays per progression genuinely differ in register/density/technique
|
- [ ] Plays per progression genuinely differ in register/density/technique
|
||||||
@@ -133,4 +348,7 @@ Voicings are degree recipes resolved through the chord quality. Degrees: `'1' '3
|
|||||||
- [ ] The style is recognizable from the rhythm descriptions alone (bossa ≠ jazz with new labels)
|
- [ ] The style is recognizable from the rhythm descriptions alone (bossa ≠ jazz with new labels)
|
||||||
- [ ] Every tip teaches a transferable idea (voice leading, register, space), not just "play this"
|
- [ ] Every tip teaches a transferable idea (voice leading, register, space), not just "play this"
|
||||||
- [ ] Songs/licks have sources; nothing invented
|
- [ ] Songs/licks have sources; nothing invented
|
||||||
|
- [ ] Lick techniques use only the fixed vocabulary; every lick is playable as written (strings 1–6, frets 0–15, in order)
|
||||||
|
- [ ] Piano licks state their `quality`, keep approaches typed and non-terminal, and stay within [0, 25] semitones of the root
|
||||||
|
- [ ] Bass patterns state the root, keep approaches typed and terminal, and stay within an octave + a fifth of the root
|
||||||
- [ ] `node scripts/validate-kb.mjs` green; `npm run build` green
|
- [ ] `node scripts/validate-kb.mjs` green; `npm run build` green
|
||||||
|
|||||||
@@ -0,0 +1,496 @@
|
|||||||
|
// Blues bass pack (task P-41) — the first bass cell. Patterns are degree-based
|
||||||
|
// per SCHEMA.md "Bass play": every note is either a `deg` resolved through the
|
||||||
|
// step's quality or a typed terminal `approach` whose pitch derives from the
|
||||||
|
// NEXT station's root (chrom-below = next−1, chrom-above = next+1,
|
||||||
|
// fifth-of-next = next+7). Every pitch-class and interval claim in the notes,
|
||||||
|
// feels and tips below was computed in a reference key (C) before writing:
|
||||||
|
// I=C7, IV=F7, V=G7; minor form Cm7/Fm7/A♭7/G7; turnaround C7/A7/Dm7/G7.
|
||||||
|
//
|
||||||
|
// Lines and treatments sourced from:
|
||||||
|
// Ed Friedland, "Blues Bass — A Guide to the Essential Styles and Techniques"
|
||||||
|
// (Hal Leonard Bass Method Stylistic Supplement, 2005) — the boogie/shuffle
|
||||||
|
// cells (R–3–5–6, R–5–6), two-feel, walkups, and the turnaround treatments;
|
||||||
|
// its studied repertoire includes this cell's progression songs ("Sweet Home
|
||||||
|
// Chicago", "Pride and Joy", "Hide Away", "The Thrill Is Gone");
|
||||||
|
// Ed Friedland, "Building Walking Bass Lines" (Hal Leonard) — the approach-note
|
||||||
|
// method this schema's typed approaches encode (chromatic below/above,
|
||||||
|
// dominant/fifth approach into the next root);
|
||||||
|
// Jerry Jemmott (bass on B.B. King's "Completely Well" sessions, 1969 — "The
|
||||||
|
// Thrill Is Gone"): Jemmott describes his defining move on that record as the
|
||||||
|
// half-step-below approach slid into the tonic (Guitar World bassist
|
||||||
|
// interviews) — the minor play's approach language;
|
||||||
|
// Willie Dixon — the Chess Records lane (upright behind Muddy Waters and on
|
||||||
|
// Chuck Berry sessions) that the quarter-note and eighth-note boogie lines
|
||||||
|
// double; the ramble figure itself is the boogie-woogie piano left hand
|
||||||
|
// (Pinetop Smith lineage — see blues/piano.js) moved to the bass;
|
||||||
|
// Tommy Shannon (Double Trouble) — the driving-shuffle lane the eighth-note
|
||||||
|
// ramble lives in on "Pride and Joy"-style Texas blues.
|
||||||
|
// Pedagogy frame: docs/learn-curriculum.md — lock with the kick, target the
|
||||||
|
// changes, walk as a signal rather than a default.
|
||||||
|
|
||||||
|
// Reusable cells (degree strings; quarters unless noted). Reference key C.
|
||||||
|
const BOOGIE = [ // 1–3–5–6: C E G A — the major-triad walkup plus the 6th
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 }, { deg: '6', beat: 4 },
|
||||||
|
]
|
||||||
|
const CHI_CELL = [ // 1–5–6–5: C G A G — the bass half of the Jimmy Reed dyad rock
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 2 }, { deg: '6', beat: 3 }, { deg: '5', beat: 4 },
|
||||||
|
]
|
||||||
|
const RAMBLE = [ // 1–3–5–6–♭7–6–5–3 in swung 8ths: C E G A B♭ A G E
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 1.5 }, { deg: '5', beat: 2 }, { deg: '6', beat: 2.5 },
|
||||||
|
{ deg: 'b7', beat: 3 }, { deg: '6', beat: 3.5 }, { deg: '5', beat: 4 }, { deg: '3', beat: 4.5 },
|
||||||
|
]
|
||||||
|
const R5_OCT = [ // slow 12/8 pillar: root, fifth, octave (offsets 0, 7, 12)
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 3 }, { deg: '1', octave: 1, beat: 4 },
|
||||||
|
]
|
||||||
|
const BOX_RIFF = [ // 1–3–4–5, quality-resolved: Cm7 → C E♭ F G; G7 → G B C D
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '11', beat: 3 }, { deg: '5', beat: 4 },
|
||||||
|
]
|
||||||
|
|
||||||
|
export default {
|
||||||
|
styleIntro:
|
||||||
|
'Blues bass is the handshake between the kick drum and the chord: roots on the strong beats, everything else in service of the next change. The craft is targeting — knowing which note pulls the band into bar 5, bar 9, and the top of the next chorus — and the discipline is repetition: pick a cell, lock it with the drummer, and let the form (not your fingers) provide the variety.',
|
||||||
|
|
||||||
|
comping: [
|
||||||
|
{
|
||||||
|
label: 'Two-feel (root and fifth)',
|
||||||
|
rhythm: 'half-note pulse: root on 1, fifth on 3',
|
||||||
|
description:
|
||||||
|
'The oldest blues bass job: two notes a bar, fat and unhurried. The fifth can sit above or below the root (same pitch class); the groove lives in note length, not note count. Default lane for slow blues and country blues.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Quarter-note boogie',
|
||||||
|
rhythm: 'four swung quarters, locked with the kick',
|
||||||
|
description:
|
||||||
|
'One note per beat walking the chord — 1–3–5–6 or 1–5–6–5 cells transposed to each station. The shuffle swing lives in the drummer; the bass plays even quarters and lets note placement carry the lean.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '12/8 slow blues',
|
||||||
|
rhythm: 'beats 1 and 3 weighted; triplet air between',
|
||||||
|
description:
|
||||||
|
'At slow-blues tempo every beat splits in three. The bass states less, not more: root and fifth as pillars, then a single pickup note — usually a half-step under the next root — sliding the band into the change. The Jerry Jemmott "Thrill Is Gone" lane.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
plays: {
|
||||||
|
'blues-12bar': [
|
||||||
|
{
|
||||||
|
label: 'Quarter-note boogie with walking seams',
|
||||||
|
level: 'foundation',
|
||||||
|
feel: 'medium shuffle — even quarters locked with the kick; the walkups do the leaning',
|
||||||
|
chords: [
|
||||||
|
{ pattern: BOOGIE, note: '1–3–5–6 — the triad plus the 6th; home base' },
|
||||||
|
{ pattern: BOOGIE },
|
||||||
|
{ pattern: BOOGIE },
|
||||||
|
{
|
||||||
|
// C D E♭ E → F: whole step then three half-steps, the classic blue-note walkup.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '9', beat: 2 }, { deg: 'b3', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'walk up into the IV: 1–2–♭3, then the half-step under its root',
|
||||||
|
},
|
||||||
|
{ pattern: BOOGIE, note: 'same cell, new root — the boogie transposes, it never changes' },
|
||||||
|
{
|
||||||
|
// F G A B → C: 1–2–3 of the IV, then the half-step under home.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '9', beat: 2 }, { deg: '3', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'walk home: 1–2–3, then a half-step under the I',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// C A B♭ B → C: the 6–♭7–7–1 climb. The chord's 7th degree is out of the
|
||||||
|
// degree vocabulary over dom7, so the final half-step is TYPED — the
|
||||||
|
// approach derives its pitch from bar 8's root, which is the same I.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '6', beat: 2 }, { deg: 'b7', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the boogie climb: 6–♭7, then chromatically under the octave root of bar 8',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// C D E F♯ → G: same 1–2–3 walkup aimed at the V; F♯ is the key's ♯4.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '9', beat: 2 }, { deg: '3', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'bar 8 aims at the V: 1–2–3, then the half-step under its root',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G B D E → F: up the V triad; E is the half-step under the IV's root.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'up the triad, then duck a half-step under the IV',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// F A C B → C: up the IV triad to the key's root, dip under it, resolve.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the IV\'s 5th IS the key\'s root — touch it, dip under, land',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// C B♭ A A♭ → G: the turnaround descent 1–♭7–6–♭6, the ♭6 typed as the
|
||||||
|
// approach from above (V root + 1). Four consecutive tones: whole step,
|
||||||
|
// half step, half step, then the half-step sink onto the V.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: 'b7', beat: 2 }, { deg: '6', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the turnaround descent: 1–♭7–6–♭6 sinking onto the V',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G G A B → C: pedal the V, then walk the key's 6th and 7th home.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '1', beat: 2 }, { deg: '9', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'double the root, then climb the last two steps into the next chorus',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
position: 'one position around the key root; open E and A do the low roots when the key allows',
|
||||||
|
tips: 'Approach-note targeting is the whole craft: beats 1–3 belong to THIS chord, beat 4 belongs to the NEXT one. Every seam here is the same move — walk toward the coming root and place a half-step under it — so once your ear owns bar 4, bars 6, 8, 9 and 10 are free. The one seam that differs is bar 11: the classic descent (1–♭7–6–♭6) approaches the V from a half-step ABOVE, because the ♭6 of the key already lives there.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Eighth-note ramble (jump / rock\'n\'roll)',
|
||||||
|
level: 'intermediate',
|
||||||
|
feel: 'driving swung 8ths — the boogie-woogie piano left hand on four strings, doubling the guitar\'s ramble',
|
||||||
|
chords: [
|
||||||
|
{ pattern: RAMBLE, note: 'up 1–3–5–6–♭7 and back down — peaks a minor 7th above the root' },
|
||||||
|
{ pattern: RAMBLE }, { pattern: RAMBLE },
|
||||||
|
{ pattern: RAMBLE, note: 'the last 8th (the 3rd) is already a half-step under the IV — the figure walks itself into bar 5' },
|
||||||
|
{ pattern: RAMBLE }, { pattern: RAMBLE },
|
||||||
|
{ pattern: RAMBLE }, { pattern: RAMBLE },
|
||||||
|
{
|
||||||
|
// G B D E F E D E → F: bar 9's tail bends — the V's closing 3rd (B) sits a
|
||||||
|
// tritone from the IV's root (F), so the last 8th becomes the chromatic
|
||||||
|
// approach (E) and the bar ends walking 5–6 → root of the IV.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 1.5 }, { deg: '5', beat: 2 }, { deg: '6', beat: 2.5 },
|
||||||
|
{ deg: 'b7', beat: 3 }, { deg: '6', beat: 3.5 }, { deg: '5', beat: 4 },
|
||||||
|
{ approach: 'chrom-below', beat: 4.5 },
|
||||||
|
],
|
||||||
|
note: 'V into IV is the figure\'s one rough seam (a tritone) — swap the last 8th for the half-step under the IV',
|
||||||
|
},
|
||||||
|
{ pattern: RAMBLE },
|
||||||
|
{ pattern: RAMBLE },
|
||||||
|
{ pattern: RAMBLE, note: 'bar 12 needs no edit: the closing 3rd of the V is a half-step under the returning tonic — the push is built in' },
|
||||||
|
],
|
||||||
|
position: 'one position; the figure spans root to ♭7, so it sits on two strings',
|
||||||
|
tips: 'The ramble is an agreement, not a line — guitar, piano left hand and bass all play it in octaves and nobody varies it (that IS the sound: Chess-session discipline, Willie Dixon behind Chuck Berry). Note what the figure buys you for free: it closes every bar on the chord\'s 3rd, which into the IV — and from the V back home — is already the chromatic approach. Only bar 9\'s V-to-IV seam needs a repair, and one eighth note fixes it.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'blues-quickchange': [
|
||||||
|
{
|
||||||
|
label: 'Chicago shuffle cell (R–5–6–5)',
|
||||||
|
level: 'foundation',
|
||||||
|
feel: 'Chicago shuffle — fat quarters, the 6th answering the 5th; the bass half of the Jimmy Reed rock',
|
||||||
|
chords: [
|
||||||
|
{
|
||||||
|
// C G A E → F: the cell with its 4th beat swapped for the approach —
|
||||||
|
// E, a half-step under the IV's root, is the I's own major 3rd.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 2 }, { deg: '6', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'beat 4 announces the quick change — and that approach note is the I\'s own 3rd',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// F C D D♭ → C: 6th, then chromatic slide D–D♭–C back home from above.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 2 }, { deg: '6', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'exit by half-steps: the IV\'s 6th slides 6–♭6 onto the I\'s root',
|
||||||
|
},
|
||||||
|
{ pattern: CHI_CELL, note: 'home — root, fifth, sixth, fifth' },
|
||||||
|
{ pattern: CHI_CELL, note: 'plain into bar 5: the cell\'s last 5th falls a whole step onto the IV\'s root' },
|
||||||
|
{ pattern: CHI_CELL },
|
||||||
|
{
|
||||||
|
// F C D D♭ → C — the same exit as bar 2.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 2 }, { deg: '6', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the bar-2 exit again — the quick change taught you this one early',
|
||||||
|
},
|
||||||
|
{ pattern: CHI_CELL },
|
||||||
|
{
|
||||||
|
// C G A F♯ → G: cell into the half-step under the V.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 2 }, { deg: '6', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: '6 down to ♯4, half-step under the V',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G B D E → F: up the V triad, then a half-step under the IV.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'V to IV: up the triad, duck under',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// F A C B → C: up the IV triad, dip under home, land.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'touch the key\'s root (the IV\'s 5th), dip a half-step, resolve',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// C G A F♯ → G — the bar-8 walkup again; bar 11 aims at the V.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 2 }, { deg: '6', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'same aim as bar 8 — the turnaround\'s V arrives on schedule',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G F E D → C: 1–♭7–6–5 of the V = the key's 5–4–3–2 walking down to home.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: 'b7', beat: 2 }, { deg: '6', beat: 3 },
|
||||||
|
{ deg: '5', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'walk straight down the scale — the key\'s 5–4–3–2 — into the next chorus',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
position: 'first five frets; the R–5–6 cell sits across two strings in one hand position',
|
||||||
|
tips: 'The R–5–6–5 rock is the same figure the rhythm guitarist plays as dyads (the Jimmy Reed shuffle) — you are the bottom note of that conversation, so match the guitarist\'s swing exactly or the whole band flams. The quick change is a hearing exam: beat 4 of bar 1 is where you tell the band you knew it was coming. And notice the economy — two approach flavors (half-step from below, half-step from above) cover every seam this play marks; the two it leaves plain (bars 4 and 12) already move by step on their own.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'blues-8bar': [
|
||||||
|
{
|
||||||
|
label: 'Two-feel with walking seams (Key to the Highway)',
|
||||||
|
level: 'intermediate',
|
||||||
|
feel: 'easy shuffle two-feel — roots and fifths as the default, walking only where the form moves',
|
||||||
|
chords: [
|
||||||
|
{
|
||||||
|
// C E F F♯ → G: the 1–3–4–♯4 walkup, ♯4 typed as the approach under the V.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '11', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the V is already in bar 2 — walk 1–3–4–♯4 straight at it',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G B D E → F: up the V triad, half-step under the IV.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'and immediately down to the IV — up the triad, duck under',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: [{ deg: '1', beat: 1 }, { deg: '5', beat: 3 }],
|
||||||
|
note: 'two-feel — the form finally sits still for a bar',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// F A B♭ B → C: the SAME 1–3–4–♯4 walkup — IV to I is also root motion
|
||||||
|
// up a perfect fifth, so the shape transfers note-for-note.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '11', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the bar-1 walkup again: IV→I is the same fifth-up motion as I→V',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: [{ deg: '1', beat: 1 }, { deg: '5', beat: 3 }],
|
||||||
|
note: 'two-feel — and beat 3 (the I\'s 5th) is already the V\'s root, naming what comes',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G D B → C: root, fifth, then the half-step under home.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'stay in the two-feel and add one pickup note under the I',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// C B♭ A A♭ → G: the turnaround descent, ♭6 typed as the approach from above.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: 'b7', beat: 2 }, { deg: '6', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 4 },
|
||||||
|
],
|
||||||
|
note: '1–♭7–6–♭6 sinking onto the V — the classic descent',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G A B → C: 1–2, then the half-step under the wrap.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '9', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'push: walk 1–2–3-of-the-V shape up into the next chorus',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
position: 'first position; the walkups stay within a hand span',
|
||||||
|
tips: 'The 8-bar form punishes autopilot — the V lands in bar 2, where a 12-bar reflex expects home. So invert the usual economy: sit in the two-feel and spend motion ONLY at the seams, which makes every walkup an announcement the band can steer by. The transferable prize is the 1–3–4–♯4 walkup: it targets any root a fifth above where you stand, which is why bars 1 (I→V) and 4 (IV→I) are the identical shape on different roots.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'blues-minor': [
|
||||||
|
{
|
||||||
|
label: 'Slow-burn 12/8 (root, fifth, octave)',
|
||||||
|
level: 'foundation',
|
||||||
|
feel: '12/8 slow burn — pillars on 1 and 3, one pickup note per seam; whole-bar patience',
|
||||||
|
chords: [
|
||||||
|
{ pattern: R5_OCT, note: 'root, fifth, octave — three pillars, then air' },
|
||||||
|
{ pattern: R5_OCT },
|
||||||
|
{ pattern: R5_OCT },
|
||||||
|
{
|
||||||
|
// C G E → F: the pickup under the iv is E — outside C minor, borrowed
|
||||||
|
// for one beat as a leading tone; typed as the approach, it can't misspell.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-below', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the Jemmott move: a half-step under the iv, slid into its root',
|
||||||
|
},
|
||||||
|
{ pattern: R5_OCT },
|
||||||
|
{
|
||||||
|
// F C D♭ → C: approach from above — a half-step sigh onto the tonic.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'come home from above — the ♭2 sighing a half-step onto the i',
|
||||||
|
},
|
||||||
|
{ pattern: R5_OCT },
|
||||||
|
{
|
||||||
|
// C E♭ G → A♭: spell the minor triad; its 5th already sits a half-step
|
||||||
|
// under the ♭VI's root, so the approach into bar 9 is free.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 3 }, { deg: '5', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the i\'s own 5th is a half-step under the ♭VI — beat 4 is already the approach',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// A♭ C E♭ A♭ → G: outline the new dominant, then restate the root as the
|
||||||
|
// typed approach (V root + 1 = this chord's own root) and let it sink.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the drama bar: the ♭VI\'s root IS the half-step above the V — restate it and sink',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G B D → C: the V with its leading-tone 3rd; the 5th lands home from a
|
||||||
|
// whole step above.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 3 }, { deg: '5', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the V\'s major 3rd is the key\'s leading tone — one bar of light, then dark',
|
||||||
|
},
|
||||||
|
{ pattern: R5_OCT },
|
||||||
|
{
|
||||||
|
pattern: [{ deg: '1', beat: 1 }],
|
||||||
|
note: 'one note, whole bar — no push; the minor chorus ends at home',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
position: 'low and open; let every note ring into the triplet space',
|
||||||
|
tips: 'Minor blues is won by subtraction: three pillars a bar, and one pickup note per seam does all the storytelling. Bars 8–10 are the lesson in root motion — the i\'s 5th sits a half-step under the ♭VI, and the ♭VI\'s root sits a half-step above the V, so the form\'s whole climax is two half-steps you barely have to reach for. Jerry Jemmott built "The Thrill Is Gone" on exactly this economy: the half-step-below approach, slid — not hammered — into the target.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Minor box riff (1–♭3–4–5)',
|
||||||
|
level: 'intermediate',
|
||||||
|
feel: 'hypnotic medium groove — one four-note riff, unbroken, transposed by the form',
|
||||||
|
chords: [
|
||||||
|
{ pattern: BOX_RIFF, note: 'the first four notes of the minor pentatonic, as a bassline' },
|
||||||
|
{ pattern: BOX_RIFF }, { pattern: BOX_RIFF }, { pattern: BOX_RIFF },
|
||||||
|
{ pattern: BOX_RIFF, note: 'on the iv the riff\'s top note is the key\'s tonic — the loop points home' },
|
||||||
|
{ pattern: BOX_RIFF },
|
||||||
|
{ pattern: BOX_RIFF },
|
||||||
|
{ pattern: BOX_RIFF, note: 'ends on the 5th, a half-step under the ♭VI — the approach comes free' },
|
||||||
|
{ pattern: BOX_RIFF, note: 'the 3rd majorizes by itself on the dominant — same degrees, new quality' },
|
||||||
|
{ pattern: BOX_RIFF, note: 'and again on the V: 1–3–4–5 with the leading tone in it' },
|
||||||
|
{ pattern: BOX_RIFF },
|
||||||
|
{ pattern: BOX_RIFF, note: 'the closing 5th drops a fifth onto the wrap — the strongest landing there is' },
|
||||||
|
],
|
||||||
|
position: 'one box position — the riff never leaves a four-fret window',
|
||||||
|
tips: 'The riff lane: pick a cell and refuse to leave it — the hypnosis is the point, and the form does the arranging. Because the degrees resolve through each chord\'s quality, the identical fingering thinks for you: ♭3 on the minor chords becomes a major 3rd on the ♭VI7 and V7 without you deciding anything. That is the deepest habit this pack can teach — think in degrees, not notes, and every riff you own transposes to every chord you meet.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'blues-turnaround': [
|
||||||
|
{
|
||||||
|
label: 'Walking the cycle',
|
||||||
|
level: 'intermediate',
|
||||||
|
feel: 'swinging quarters — a jazz walk squeezed into the blues\' back door',
|
||||||
|
chords: [
|
||||||
|
{
|
||||||
|
// C E G B♭ → A: up the I7 arpeggio; the ♭7 is ALSO the half-step above
|
||||||
|
// the VI's root, so the approach note is a chord tone wearing two hats.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the approach into the VI is the I\'s own ♭7 — one note, two jobs',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// A C♯ E G → D: the full dominant arpeggio; the ♭7 falls a perfect
|
||||||
|
// fourth onto the ii's root.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ deg: 'b7', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'straight up the VI7 — the ♭7 lands on the ii from a fourth above',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// D F A A♭ → G: minor arpeggio, then A–A♭–G — a pure chromatic walkdown.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '3', beat: 2 }, { deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'the ii\'s 5th starts a chromatic slide: 5, then the half-step above the V, then the V',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G A B G → C: walk 1–2–3, then drop to the fifth of the TARGET — which
|
||||||
|
// on this wrap is the V's own root: the V–I cadence inside one bar.
|
||||||
|
pattern: [
|
||||||
|
{ deg: '1', beat: 1 }, { deg: '9', beat: 2 }, { deg: '3', beat: 3 },
|
||||||
|
{ approach: 'fifth-of-next', beat: 4 },
|
||||||
|
],
|
||||||
|
note: 'climb 1–2–3, then drop to the 5th of the next root — here, the V root itself',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
position: 'one position; the arpeggios alternate strings on their own as the roots fall in fifths',
|
||||||
|
tips: 'The jazz handshake, learned as three approach flavors in four bars: half-step from above (twice — and the first one is a chord tone already), a fall from the fourth above, and the fifth-of-the-target, which is the bass player\'s strongest word because it plays a V–I cadence into whatever comes next. Loop this at a jam and you\'ve pre-learned bars 11–12 of every uptown blues — the same cycle the guitar pack shells through.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Two-beat kicks (roots and approaches)',
|
||||||
|
level: 'foundation',
|
||||||
|
feel: 'jump two-beat — root on the kick, approach right behind it; often two beats per chord',
|
||||||
|
chords: [
|
||||||
|
{
|
||||||
|
// C B♭ → A: root, then the half-step above the VI (again the I's ♭7).
|
||||||
|
pattern: [{ deg: '1', beat: 1 }, { approach: 'chrom-above', beat: 3 }],
|
||||||
|
note: 'root, then lean on the ♭7 — it drops you onto the VI',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// A C♯ → D: root, then the half-step under the ii — the VI's own 3rd.
|
||||||
|
pattern: [{ deg: '1', beat: 1 }, { approach: 'chrom-below', beat: 3 }],
|
||||||
|
note: 'the VI\'s major 3rd pushes up a half-step onto the ii',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// D A → G: root and fifth; the fifth steps down a whole step onto the V.
|
||||||
|
pattern: [{ deg: '1', beat: 1 }, { deg: '5', beat: 3 }],
|
||||||
|
note: 'root–fifth — the 5th falls a whole step onto the V',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// G B → C: root, then the leading tone (the V's 3rd) under home.
|
||||||
|
pattern: [{ deg: '1', beat: 1 }, { approach: 'chrom-below', beat: 3 }],
|
||||||
|
note: 'the V\'s 3rd is the key\'s leading tone — it hands you bar 1',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
position: 'low register, short notes — leave the triplet air to the pianist',
|
||||||
|
tips: 'The minimum viable turnaround: state the root, then play ONE note that belongs to the next chord more than this one. When the band squeezes the cycle into two bars (two beats per chord — the usual jazz-blues bars 11–12), this is the same pattern with the beats halved: root on the front beat, approach on the back. Notice that every back-beat note here is a chord tone of its own bar that also targets the next root — good targeting usually costs nothing.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -230,4 +230,84 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Structured licks (SCHEMA.md "Licks", task P-21). Written in a home key each
|
||||||
|
// (noted per lick) but key-agnostic in spirit — chordContext names the station.
|
||||||
|
// Every pitch hand-verified: s6=E s5=A s4=D s3=G s2=B s1=e (+fret, mod 12).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// In C (box at fret 8): G C D→E C A G = 5 R 9→3 R 13 5, C major pentatonic
|
||||||
|
// over the I7 — the sweet B.B. side of the coin.
|
||||||
|
id: 'blues-bb-box-sweet',
|
||||||
|
name: 'B.B. box sweet-spot phrase',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the I7',
|
||||||
|
techniques: ['bend', 'vibrato'],
|
||||||
|
source: 'in the style of B.B. King\'s box-position fills; Guitar World "B.B. box" lessons (R-2-4-5-6 grid)',
|
||||||
|
tab: [
|
||||||
|
{ string: 2, fret: 8 }, // G — the 5th
|
||||||
|
{ string: 1, fret: 8 }, // C — root
|
||||||
|
{ string: 1, fret: 10, technique: 'bend' }, // D bent a whole step to E, the 3rd — the signature move
|
||||||
|
{ string: 1, fret: 8 }, // C
|
||||||
|
{ string: 2, fret: 10 }, // A — the 13
|
||||||
|
{ string: 2, fret: 8, technique: 'vibrato' }, // G — settle on the 5th
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In E, open position: ♭7–6–♭6–5 (D C♯ C B) descending on the B string
|
||||||
|
// under a high-e root pedal, resolving to the V7's root (B).
|
||||||
|
id: 'blues-open-turnaround',
|
||||||
|
name: 'Descending turnaround under a root pedal',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'bars 11–12: I7 walking down to the V7',
|
||||||
|
techniques: ['double-stop', 'vibrato'],
|
||||||
|
source: 'the Robert Johnson-lineage turnaround (e.g. "Kind Hearted Woman"); Fundamental Changes "Blues Turnarounds for Guitar"',
|
||||||
|
tab: [
|
||||||
|
{ string: 2, fret: 3 }, // D — ♭7
|
||||||
|
{ string: 1, fret: 0, technique: 'double-stop' }, // E pedal on top
|
||||||
|
{ string: 2, fret: 2 }, // C♯ — 6
|
||||||
|
{ string: 1, fret: 0, technique: 'double-stop' },
|
||||||
|
{ string: 2, fret: 1 }, // C — ♭6
|
||||||
|
{ string: 1, fret: 0, technique: 'double-stop' },
|
||||||
|
{ string: 2, fret: 0 }, // B — 5
|
||||||
|
{ string: 1, fret: 0, technique: 'double-stop' },
|
||||||
|
{ string: 5, fret: 2, technique: 'vibrato' }, // B — root of the V7: the landing
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A, box 1: C→C♯ (♭3 hammered to the major 3) into the E+A double-stop,
|
||||||
|
// ♭7 bend, settle on the 5th — the 12/8 slow-blues answer phrase.
|
||||||
|
id: 'blues-slow-curl',
|
||||||
|
name: 'Slow-blues curl into the root double-stop',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the I7, 12/8 slow blues',
|
||||||
|
techniques: ['hammer-on', 'double-stop', 'bend', 'vibrato'],
|
||||||
|
source: 'stock box-1 slow-blues vocabulary (the ♭3→3 curl); TrueFire Texas-blues chord-tone lessons',
|
||||||
|
tab: [
|
||||||
|
{ string: 3, fret: 5 }, // C — ♭3
|
||||||
|
{ string: 3, fret: 6, technique: 'hammer-on' }, // C♯ — the major 3rd; the blues curl made explicit
|
||||||
|
{ string: 2, fret: 5 }, // E — 5th
|
||||||
|
{ string: 1, fret: 5, technique: 'double-stop' }, // A on top — root+5th dyad
|
||||||
|
{ string: 2, fret: 8, technique: 'bend' }, // G (♭7) bent a whole step toward the root
|
||||||
|
{ string: 2, fret: 5, technique: 'vibrato' }, // E — resolve on the 5th
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A (IV = D9): the IV7's 3+♭7 tritone pair (F♯+C) slid in from one fret
|
||||||
|
// below (F+B), then the 5th on top — the Texas comping move as a lick.
|
||||||
|
id: 'blues-iv9-slide',
|
||||||
|
name: 'Tritone slide into the IV9',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'bar 5: landing on the IV7',
|
||||||
|
techniques: ['chromatic-approach', 'double-stop', 'slide', 'vibrato'],
|
||||||
|
source: 'the Texas/Freddie King 9th-grip slide-in ("Hide Away" comping vocabulary); Fundamental Changes SRV/Freddie King 9ths',
|
||||||
|
tab: [
|
||||||
|
{ string: 4, fret: 3, technique: 'chromatic-approach' }, // F — one fret below the 3rd
|
||||||
|
{ string: 3, fret: 4, technique: 'double-stop' }, // B — one fret below the ♭7
|
||||||
|
{ string: 4, fret: 4, technique: 'slide' }, // F♯ — the IV7's 3rd
|
||||||
|
{ string: 3, fret: 5, technique: 'double-stop' }, // C — the IV7's ♭7: the tritone pair lands
|
||||||
|
{ string: 1, fret: 5, technique: 'vibrato' }, // A — the IV7's 5th (the key's root)
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,393 @@
|
|||||||
|
// Blues piano pack (task P-31). Recipes verified by degree-spelling against
|
||||||
|
// CHORD_TYPES (src/lib/theory.js) and the validator's stacking convention
|
||||||
|
// (order inside each hand = voicing order low → high, nearest strictly above —
|
||||||
|
// documented at jazz/piano.js header). Every voice-leading/interval statement
|
||||||
|
// in notes/tips is pitch-class arithmetic, computed against the realized
|
||||||
|
// voicings (reference key C / C minor) before writing. Combined LH+RH stacks
|
||||||
|
// are kept ≤ 23 semitones so every recipe renders inside JamGuide's 36-key
|
||||||
|
// window for all 12 roots (same budget as rnb/piano.js).
|
||||||
|
// Voicings and treatments sourced from:
|
||||||
|
// pianogroove.com — Chicago Blues course ("Chicago Blues Hand Independence":
|
||||||
|
// LH shell / RH chord two-job split), "How To Count Slow Blues" & "12/8 Feel
|
||||||
|
// For Slow Blues" (four beats each split in three; rolled arrivals), "Blues
|
||||||
|
// Piano Comping Patterns & Rhythms" and "Basic Blues Voicings & Patterns"
|
||||||
|
// (shell + guide-tone comping, 9th/13th dominant colour);
|
||||||
|
// pianowithjonny.com — "Blues Chords for Piano: The Complete Guide" (9ths and
|
||||||
|
// 13ths as the bright blues extensions, ♭9/♯9/♭13 as the crunch) and "Slow
|
||||||
|
// Blues Piano for Beginners";
|
||||||
|
// piano-ology.com — "Dominant 7(♯9) Voicings" (the no-5th grip: 3–♭7–♯9,
|
||||||
|
// major-against-minor-third tension) and "Killer Blues Piano Grace Notes"
|
||||||
|
// (the ♭3→3 crush as the pianist's bend);
|
||||||
|
// Wikipedia, "Dominant seventh sharp ninth chord" (the 7♯9 codifies the blues
|
||||||
|
// scale's ♭3 sounding over a major-third dominant);
|
||||||
|
// Otis Spann (Blues Hall of Fame) — the postwar Chicago model this pack's
|
||||||
|
// two-fisted play imitates: piano as the only harmony behind voice and guitar;
|
||||||
|
// Pinetop Smith, "Pinetop's Boogie Woogie" — the rocking 5th↔6th shuffle
|
||||||
|
// left hand; pianote.com "How to Play Blues Piano" (right-hand harmony in
|
||||||
|
// sixths); Mark Levine, The Jazz Piano Book (rootless Type A/B dominants,
|
||||||
|
// 13 replacing the 5) — the uptown/band grips blues borrows from jazz.
|
||||||
|
// Pedagogy frame: docs/learn-curriculum.md — Piano pillar (shells → rootless,
|
||||||
|
// register discipline, voice-leading as hand economy).
|
||||||
|
|
||||||
|
// Reusable degree recipes. Order inside each hand = voicing order, low → high.
|
||||||
|
const LH_R = ['1'] // single bass root
|
||||||
|
const LH_R5 = ['1', '5'] // root + fifth anchor
|
||||||
|
const LH_R7 = ['1', '7'] // root + ♭7 shell — the Chicago left hand
|
||||||
|
const RH_TRIAD = ['1', '3', '5'] // plain root-position triad (the ♭7 lives downstairs)
|
||||||
|
const GT_37 = ['3', '7'] // guide tones, 3rd on the bottom
|
||||||
|
const GT_73 = ['7', '3'] // guide tones flipped, ♭7 on the bottom
|
||||||
|
const RH_9 = ['9', '3', '7'] // 9th spread: the 9 tucked under the guide tones
|
||||||
|
const RH_7TH = ['3', '5', '7'] // full seventh chord stacked above the anchor
|
||||||
|
const RH_SHARP9 = ['3', '7', '#9'] // the crying chord: 3–♭7–♯9, no 5th (piano-ology grip)
|
||||||
|
const RH_13 = ['3', '13', '7'] // 13th cluster: the 13 crushed under the ♭7
|
||||||
|
const A_DOM = ['3', '13', '7', '9'] // rootless Type A dominant (Levine: 13 for 5)
|
||||||
|
const B_DOM = ['7', '9', '3', '13'] // rootless Type B dominant
|
||||||
|
|
||||||
|
export default {
|
||||||
|
styleIntro:
|
||||||
|
'Blues piano is two instruments in one player: a left hand that keeps the shuffle honest (roots, shells, the boogie rock) and a right hand that talks back — stabs, sixths, tremolos, the crush of ♭3 into 3. Harmony is three dominant chords and everything expressive happens in how little you move between them: the whole form voice-leads by half-steps and whole steps if you let it.',
|
||||||
|
|
||||||
|
comping: [
|
||||||
|
{
|
||||||
|
label: 'Shuffle backbeat stabs',
|
||||||
|
rhythm: 'swung 8ths; right-hand chips on 2 and 4',
|
||||||
|
description:
|
||||||
|
'The Chicago comp: the left hand holds the shell (or rocks the boogie) while the right hand stabs with the snare on 2 and 4. Keep the stabs short and identical — in a Chicago band the piano is felt more than heard until the fill.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Slow-blues 12/8 rolls',
|
||||||
|
rhythm: 'four beats to the bar, each split in three',
|
||||||
|
description:
|
||||||
|
'The slow-blues pulse: block or roll the chords into beats 1 and 3 and let the triplet grid breathe underneath. Tremolo the top of the hand at phrase ends — on a slow blues the tremolo is the horn section.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'The Pinetop rock (5–6 left hand)',
|
||||||
|
rhythm: 'left hand swung 8ths, rocking 5th ↔ 6th',
|
||||||
|
description:
|
||||||
|
'The boogie cell from "Pinetop\'s Boogie Woogie": the left hand rocks a whole step between the chord\'s 5th and 6th on every swung 8th, on every chord of the form. It is a drum pattern played on pitches — once it runs itself, the right hand is free.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
plays: {
|
||||||
|
'blues-12bar': [
|
||||||
|
{
|
||||||
|
label: 'Horn-section shells (jump-blues guide tones)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: '3rd under ♭7 — the two notes that make it a dominant' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'hold — the stabs are rhythm, not new notes' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'still home; leave holes for the singer' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'last bar of home — lean on the and-of-4 into the IV' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_73 }, note: 'both voices fall a half-step: the I\'s 3rd onto this ♭7, its ♭7 onto this 3rd' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_73 }, note: 'sit' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'home — the same two half-steps, rising this time' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'hold' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_73 }, note: 'bar 9: both voices rise a half-step — the I\'s 3rd becomes this ♭7, its ♭7 this 3rd' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_73 }, note: 'V to IV: the pair slides down a whole step in parallel' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'home on half-steps again' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_73 }, note: 'bar 12 pushes: a half-step up in both voices, and the next chorus starts' },
|
||||||
|
],
|
||||||
|
register: 'LH single roots around C3; RH dyads just above middle C — horn-section territory',
|
||||||
|
tips: 'Two right-hand fingers cover the whole form, and no change moves either of them more than a whole step: into the IV both guide tones fall a half-step, into the V both rise a half-step, and V-to-IV slides a whole step in parallel. This is the jump-blues horn pad translated to the keys — play it on the shuffle backbeat and you are the brass section. When the band thins out, add the root back with the left hand; when a soloist rips, this is already everything they need from you.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Slow blues, full hands (12/8)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'a two-hand 9th spread — root and 5th below, the 9 tucked under the guide tones above' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'hold — roll it into beat 3, or tremolo the top two notes' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'still home; answer an imaginary singer in the gaps' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_SHARP9 }, note: 'I7♯9 — the 9 sharpens a half-step into the ♯9, which is the key\'s own ♭3: the blue note leaning into the IV' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: B_DOM }, note: 'the ♯9 holds over as this chord\'s ♭7 (same key); the I\'s ♭7 falls a half-step onto this 3rd' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: B_DOM }, note: 'sit on the 13 — it is the key\'s own 9th, sweet against the IV' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'the IV\'s 13 holds as this 9; its guide tones each rise a half-step home' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'hold — or thin out before the V arrives' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_SHARP9 }, note: 'the crying chord: the key\'s ♭7 refuses to move — it was the I\'s ♭7 and stays on as this ♯9' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'the ♯9 slips a half-step onto this 3rd; the V\'s ♭7 lands in your left hand as the new root' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'the guide tones trade one last time — two half-step rises' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_13 }, note: 'V13 out: the I\'s 3rd holds as this 13 while its ♭7 pushes up a half-step onto the 3rd' },
|
||||||
|
],
|
||||||
|
register: 'LH around C3, RH stacks around middle C; 12/8 — every beat divides in three',
|
||||||
|
tips: 'The slow blues legitimizes both blue notes with chords: the key\'s ♭3 becomes the I7\'s ♯9 in bar 4 and then holds over as the IV7\'s ♭7 in bar 5; the key\'s ♭7 becomes the V7\'s ♯9 in bar 9. The 7♯9 grip here is the classic three-note voicing — 3rd, ♭7, ♯9, no 5th — the "minor third" slung up high, a major seventh above the major third — the whole blues argument in one hand. Roll the big chords into the beat and save the tremolo for the ends of phrases.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'blues-quickchange': [
|
||||||
|
{
|
||||||
|
label: 'Two-fisted Chicago (Otis Spann lane)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'root + ♭7 shell below, plain triad above — the ♭7 lives downstairs' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'quick change: the I\'s root holds as this chord\'s 5th; its 3rd climbs a half-step onto the new root' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'home in bar 3 — the IV\'s root falls the same half-step back onto the 3rd' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'hold; rock the right hand in swung 8ths' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'IV again — same half-step climb as bar 2' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'sit' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'home' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'hold — bar 8 sets up the V' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'the I\'s 5th holds as the new root; the old root slips a half-step down onto the V\'s 3rd' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'the triad slides down a whole step in parallel — V to IV is the blues\' one pure parallel move' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'home' },
|
||||||
|
{ recipe: { LH: LH_R7, RH: RH_TRIAD }, note: 'V7 — kick the next chorus' },
|
||||||
|
],
|
||||||
|
register: 'LH shell around C2–C3, RH triads mid-keyboard — two hands, two jobs',
|
||||||
|
tips: 'The postwar Chicago model (Otis Spann behind Muddy Waters): the piano is the only harmony instrument, so the left hand is the bass player (root + ♭7 shell, or the Pinetop 5–6 rock) and the right hand is the section. The right-hand triad carries no ♭7 on purpose — the shell already supplies it, so together the hands spell the full dominant without mud. The drill this progression exists for: hear bar 2 coming — the quick change is the same one-half-step move as bar 5, just three bars early.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Uptown rootless (9s and 13s behind a band)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: A_DOM }, note: 'Type A dominant: 3–13–♭7–9 — two colour tones per chord' },
|
||||||
|
{ recipe: { LH: B_DOM }, note: 'quick change: two names hold (the I\'s 13 and 9 become this 3rd and 13); the 3rd falls a half-step onto this ♭7, the ♭7 drops a minor third onto the 9' },
|
||||||
|
{ recipe: { LH: A_DOM }, note: 'home — the same two fingers walk back' },
|
||||||
|
{ recipe: { LH: A_DOM }, note: 'hold' },
|
||||||
|
{ recipe: { LH: B_DOM }, note: 'the bar-2 seam again — spot it faster this time' },
|
||||||
|
{ recipe: { LH: B_DOM }, note: 'sit' },
|
||||||
|
{ recipe: { LH: A_DOM }, note: 'home' },
|
||||||
|
{ recipe: { LH: A_DOM }, note: 'hold — or thin to bare 3 + ♭7 if the guitarist is busy' },
|
||||||
|
{ recipe: { LH: A_DOM }, note: 'two names hold again (the I\'s 3rd becomes this 13, its 13 this 9); the ♭7 rises a half-step onto the V\'s 3rd' },
|
||||||
|
{ recipe: { LH: B_DOM }, note: 'the V\'s 9 holds as this 3rd; its 13 falls a half-step onto this ♭7' },
|
||||||
|
{ recipe: { LH: A_DOM }, note: 'the IV\'s ♭7 rises a half-step onto this 3rd; its 3rd and 13 stay put as the 13 and 9' },
|
||||||
|
{ recipe: { LH: A_DOM }, note: 'bar 12 — same grip as bar 9; the form is a wheel' },
|
||||||
|
],
|
||||||
|
register: 'left hand alone, top note between C4 and C5 — the bassist owns the roots',
|
||||||
|
tips: 'The Levine rootless dominants moved into a blues — the uptown sound of a jump band with a bassist, where doubling roots just muddies the bottom. Every I-to-IV seam is the same physical fact: two fingers freeze while two slide, so the quick change costs exactly as much in bar 2 as in bar 5. Comp these on the backbeat and keep the top note in one narrow lane; the colour (9s and 13s everywhere) does the rest.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'blues-8bar': [
|
||||||
|
{
|
||||||
|
label: 'Front-porch pillars (rolled 12/8)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'root and 5th below, the full seventh chord stacked above' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'the V in bar 2 — every voice by step: the 3rd and 5th fall a whole step (onto the V\'s 5th and ♭7), the ♭7 rises a half-step onto its 3rd' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'V to IV: the entire two-hand grip — roots included — slides down a whole step in parallel' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'sit on the IV — roll it' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'home: the IV\'s ♭7 rises a half-step onto the 3rd; its 3rd and 5th each fall a whole step' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'V again — bar 6, not bar 9; count the form out loud' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'home for one bar' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'V out — it hands you bar 1' },
|
||||||
|
],
|
||||||
|
register: 'LH open fifths around C3, RH sevenths around middle C; roll into beats 1 and 3',
|
||||||
|
tips: 'One two-hand shape planted on three roots — the front-porch reading of "Key to the Highway". Because the right hand is the plain 3–5–♭7 stack, no change in the form moves any right-hand finger more than a whole step (the left hand\'s roots do the jumping), and V-to-IV slides both hands down a whole step in parallel. That makes this the form-learning play: your hands physically feel that the V arrives in bar 2, which is exactly where 12-bar reflexes get wrong-footed.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Parallel sixths (the fills lane)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: ['5', '3'] }, note: 'a bare sixth — the 5th with the 3rd singing a major sixth above it' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['7', '5'] }, note: 'both voices fall a whole step — the dyad is now ♭7 under 5th, still a sixth wide' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['1', '13'] }, note: 'the dyad does not move: the V\'s ♭7 and 5th are already this chord\'s root and 13 — only the bass falls' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['1', '13'] }, note: 'sit — tremolo the sixth' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['5', '3'] }, note: 'both voices climb a whole step home' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['7', '5'] }, note: 'down a whole step again — the early V, second lap' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['5', '3'] }, note: 'home' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['7', '5'] }, note: 'out — the sixth rocks down one more time and the form comes around' },
|
||||||
|
],
|
||||||
|
register: 'LH roots low; the sixths sit where a singer would — the middle of the keyboard',
|
||||||
|
tips: 'Right-hand sixths are blues piano\'s harmonized-vocal sound — two notes that move like one singer with a shadow. The whole eight bars is one dyad rocking between just two positions a whole step apart, plus one free change (into the IV, where the notes stay and only the bass moves). Decorate it the blues way: tremolo the dyad, and crush into its top note from the key a half-step below — the ♭3-into-3 crush is the pianist\'s string bend.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'blues-minor': [
|
||||||
|
{
|
||||||
|
label: 'The Thrill pads (m9 spreads)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'm9 — the 9 tucked under the ♭3, a slow-burn spread' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'hold — tremolo, or answer yourself with a fill' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'still home; minor blues burns slower than major' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'lean into the iv' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'two names hold — the i\'s ♭3 is this ♭7, its 5th this 9; the i\'s ♭7 and 9 each fall a whole step (onto this ♭3 and 5th)' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'sit' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'the mirror: the iv\'s ♭3 and 5th climb a whole step back; its ♭7 and 9 hold' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'hold — bar 9 is coming' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'the drama: the i\'s ♭7 holds on as this chord\'s 9, and the bass 5th climbs a half-step onto the new root' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'all five voices sink a half-step together — the ♭VI was the V a half-step early' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'resolve dark: the V\'s ♭7 falls a whole step onto the ♭3; its 3rd slips a half-step back onto the ♭7' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'sit — no push; the minor blues ends its chorus at home' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH spreads just above middle C; long tones, B.B.-band tempo',
|
||||||
|
tips: 'The lane B.B. King\'s bands live in on "The Thrill Is Gone": sustained 9th spreads, one shape for the whole form. The payoff bar is 9-into-10 — keep the identical grip on the ♭VI7 and V7 and every voice, bass included, sinks exactly a half-step: the strongest move in the style is also the easiest. (B.B.\'s recording colours the ♭VI as a maj7, as the progression card notes — this play keeps it dominant so the plane stays pure; try both.)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'After-hours dyads (two fingers and smoke)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: '♭3 under ♭7 — a bare fifth; minor blues needs almost nothing' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'hold' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'space — the drummer is playing; you don\'t have to' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'a small push into the iv' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'the i\'s ♭3 holds as this ♭7; its ♭7 falls a whole step onto this ♭3' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'sit' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'the same two names trade straight back' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'hold' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'suddenly a tritone — the form\'s first true dominant crunch; the i\'s ♭7 climbed a whole step onto this 3rd' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_SHARP9 }, note: 'both dyad voices fall a half-step, and the ♯9 lands on top — the i\'s own ♭7, back from its one-bar detour' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'the ♯9 keeps its key and goes back to being the ♭7; the V\'s ♭7 falls a whole step onto the ♭3' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'sit in the dark' },
|
||||||
|
],
|
||||||
|
register: 'one bass note, two (then three) right-hand notes mid-keyboard; late-night volume',
|
||||||
|
tips: 'Minor blues by subtraction: on the minor chords the 3-and-7 dyad is a hollow perfect fifth, and the moment the ♭VI7 arrives the same two degrees snap into a tritone — the form\'s harmonic drama is audible in one interval changing shape under two fingers. The V7♯9 is the only three-note chord of the night, and its ♯9 is the note the night was built on: the key\'s ♭7, recast as the scream. If it sounds empty, good — push the placement, not the note count.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'blues-turnaround': [
|
||||||
|
{
|
||||||
|
label: 'Stormy Monday pillars (slow 12/8)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: '9th spread over root and 5th — uptown from the first beat' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', '7', 'b9'] }, note: 'VI7♭9: the I\'s ♭7 holds on as this ♭9; its 9 falls a half-step onto this 3rd; the bass drops a minor third' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9 }, note: 'the ♭9 sighs a half-step down onto this chord\'s 5th; the VI\'s ♭7 falls a whole step onto this ♭3' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_13 }, note: 'V13: the ii\'s 9 and ♭3 hold (as this 13 and ♭7); its ♭7 falls a half-step onto this 3rd — the ii–V law' },
|
||||||
|
],
|
||||||
|
register: 'LH low anchors, RH stacks around middle C; slow 12/8, roll the big ones',
|
||||||
|
tips: 'The uptown turnaround under one thread: a single key does three jobs in three bars — it starts as the I\'s ♭7, holds on as the VI7\'s ♭9, then sighs a half-step onto the ii\'s 5th. Back into bar 1 both of the V\'s guide tones fall a half-step (♭7 onto the I\'s 3rd, 3rd onto the I\'s ♭7), so the wheel never clunks. T-Bone Walker\'s "Stormy Monday" intro walks a close cousin of this cycle, as the progression card says — learn it here as hand motion and the uptown blues stops being mysterious.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Jump kicks (two-beat shells)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'guide tones only — this cycle usually gets two beats per chord' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_73 }, note: 'the one athletic move: I and VI share no guide tones, so both voices hop up a minor third' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_37 }, note: 'the VI\'s 3rd falls a half-step onto this ♭7; its ♭7 a whole step onto this ♭3' },
|
||||||
|
{ recipe: { LH: LH_R, RH: GT_73 }, note: 'the ii\'s ♭3 holds as this ♭7; its ♭7 falls a half-step onto this 3rd — then both voices sigh a half-step into bar 1' },
|
||||||
|
],
|
||||||
|
register: 'short stabs either side of middle C; two-beat changes, land them with the drummer',
|
||||||
|
tips: 'The turnaround at jump tempo: two-note kicks placed with the drummer, two beats per chord when the band squeezes the cycle into two bars. One lap costs one athletic move — the minor-third hop into the VI, the only seam in the loop where a voice has to leap — and after that every voice holds or resolves by half-step or whole step back to the top. Drill the lap until the hop is automatic; it is the same physical seam as bar 8 of a jazz blues.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
improv: {
|
||||||
|
scales: [
|
||||||
|
{
|
||||||
|
over: 'the whole form (I7–IV7–V7)',
|
||||||
|
scale: 'the key\'s blues scale',
|
||||||
|
why: 'One scale over all three chords is the genre\'s licence, and the chords themselves pre-clear the "wrong" notes: the scale\'s ♭3 is the I7\'s ♯9 and the IV7\'s ♭7, and its ♭7 is the V7\'s ♯9.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'I7',
|
||||||
|
scale: 'mixolydian, mixed with the blues scale',
|
||||||
|
why: 'Mixolydian supplies the chord, the blues scale the attitude — switch phrase by phrase. The ♭3→3 crush (a half-step, played as a grace note) is the pianist\'s string bend: piano can\'t bend, so it crushes.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'IV7',
|
||||||
|
scale: 'mixolydian from the IV',
|
||||||
|
why: 'Its ♭7 is the key\'s ♭3 — bar 5 re-tunes the blue note into a chord tone. Target it on the downbeat of the change and the room hears you hear the form.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'V7',
|
||||||
|
scale: 'mixolydian from the V',
|
||||||
|
why: 'And keep the key\'s ♭7 on call: over the V it becomes the ♯9, the crying note. Let it melt a half-step down onto the natural 9 — the classic slow-blues resolution.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'i7 (minor blues)',
|
||||||
|
scale: 'minor pentatonic of the key',
|
||||||
|
why: 'The minor form pre-clears everything, and it mostly survives bar 9: three of the ♭VI7\'s four chord tones already sit inside the key\'s blues scale. The one outside note is the ♭VI\'s own root — lean on it only if you want the dark.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetNotes:
|
||||||
|
'Land the 3rd of each chord on the downbeat of the change — bars 5, 9 and 10 are the exam. Treat the two blue notes as a budget with a schedule: the key\'s ♭3 crushes into 3 over the I and sits still as the ♭7 over the IV; the key\'s ♭7 is home over the I and becomes the ♯9 the moment the V arrives. Between phrases, silence — a blues chorus is a conversation, and the piano already talked.',
|
||||||
|
},
|
||||||
|
|
||||||
|
// Structured piano licks (SCHEMA.md "Piano licks", task P-60). Degree-based
|
||||||
|
// and key-agnostic: every deg resolves through the stated quality (all four
|
||||||
|
// licks sit on dominant stations — the blues' native chord; the pentatonic
|
||||||
|
// fall's tip notes where it survives the minor form too). Realized offsets
|
||||||
|
// in the comments use a C-rooted chord; every interval claim in notes/tips
|
||||||
|
// was recomputed from those offsets before writing (P-41 bar).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// Over C7: (E♭4)E4 G4 C5 B♭4 G4 (E♭4)E4 — offsets [3]4 7 12 10 7 [3]4.
|
||||||
|
// Both crushes are the ♭3 (3) into the 3rd (4), same beat.
|
||||||
|
id: 'blues-b3-crush',
|
||||||
|
name: 'The ♭3 crush',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the I7',
|
||||||
|
quality: 'dom7',
|
||||||
|
techniques: ['grace-note'],
|
||||||
|
source: 'the ♭3→3 crush as the pianist\'s string bend — piano-ology "Killer Blues Piano Grace Notes"',
|
||||||
|
notes: [
|
||||||
|
{ deg: 'b3', beat: 1, technique: 'grace-note' },
|
||||||
|
{ deg: '3', beat: 1 },
|
||||||
|
{ deg: '5', beat: 1.5 },
|
||||||
|
{ deg: '1', octave: 1, beat: 2 },
|
||||||
|
{ deg: '7', beat: 2.5 },
|
||||||
|
{ deg: '5', beat: 3 },
|
||||||
|
{ deg: 'b3', beat: 3.5, technique: 'grace-note' },
|
||||||
|
{ deg: '3', beat: 3.5 },
|
||||||
|
],
|
||||||
|
tips: 'Strings bend; the piano crushes. Flick the ♭3 into the 3rd almost as one gesture, walk straight up the chord (3, 5, octave root), answer back down (♭7, 5), and close with the same crush that opened the phrase — one blue note, spent twice.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over C7: C5 B♭4 G4 F4 E♭4 C4 — offsets 12 10 7 5 3 0: the full
|
||||||
|
// minor pentatonic (1 ♭7 5 4 ♭3 1) falling top to bottom on the
|
||||||
|
// triplet grid, landing the low root on beat 3.
|
||||||
|
id: 'blues-penta-fall-turnaround',
|
||||||
|
name: 'Pentatonic fall (turnaround run)',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'bar 11, over the I7, setting up the turnaround',
|
||||||
|
quality: 'dom7',
|
||||||
|
techniques: [],
|
||||||
|
source: 'the descending minor-pentatonic run every blues pianist keeps — stock vocabulary; see pianogroove.com\'s Chicago Blues course',
|
||||||
|
notes: [
|
||||||
|
{ deg: '1', octave: 1, beat: 1 },
|
||||||
|
{ deg: '7', beat: 1.33 },
|
||||||
|
{ deg: '5', beat: 1.67 },
|
||||||
|
{ deg: '11', beat: 2 },
|
||||||
|
{ deg: 'b3', beat: 2.33 },
|
||||||
|
{ deg: '1', beat: 3 },
|
||||||
|
],
|
||||||
|
tips: 'Top to bottom of the minor pentatonic — root, ♭7, 5, 4, ♭3, root — in one triplet gesture, with a breath before the low root lands on beat 3 so the turnaround has somewhere to kick from. Over the I7 the run\'s ♭3 is the chord\'s ♯9 and the 4 passes between the 3rd and the 5th; the same six keys survive untouched over the i7 of a minor blues.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over C7, high dyads: E5+G5 ×4 (offsets 16+19, a minor third apart)
|
||||||
|
// hammered on the triplet grid, then peeling down the chord:
|
||||||
|
// C5(12) B♭4(10) G4(7).
|
||||||
|
id: 'blues-spann-hammer-dyads',
|
||||||
|
name: 'Spann hammer dyads',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the I7 — the high fill that cuts through a Chicago band',
|
||||||
|
quality: 'dom7',
|
||||||
|
techniques: ['double-stop'],
|
||||||
|
source: 'in the Otis Spann lane — hammered right-hand triplet dyads, the postwar Chicago fill (Blues Hall of Fame)',
|
||||||
|
notes: [
|
||||||
|
{ deg: '3', octave: 1, beat: 1 },
|
||||||
|
{ deg: '5', octave: 1, beat: 1, technique: 'double-stop' },
|
||||||
|
{ deg: '3', octave: 1, beat: 1.33 },
|
||||||
|
{ deg: '5', octave: 1, beat: 1.33, technique: 'double-stop' },
|
||||||
|
{ deg: '3', octave: 1, beat: 1.67 },
|
||||||
|
{ deg: '5', octave: 1, beat: 1.67, technique: 'double-stop' },
|
||||||
|
{ deg: '3', octave: 1, beat: 2 },
|
||||||
|
{ deg: '5', octave: 1, beat: 2, technique: 'double-stop' },
|
||||||
|
{ deg: '1', octave: 1, beat: 2.33 },
|
||||||
|
{ deg: '7', beat: 2.67 },
|
||||||
|
{ deg: '5', beat: 3 },
|
||||||
|
],
|
||||||
|
tips: 'One dyad — the 3rd with the 5th a minor third above it — hammered four times on the triplet grid like a snare press, then the line peels off down the chord: octave root, ♭7, settling on the 5th. The repetition IS the lick; on a slow blues, stretch it toward a tremolo.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over C7 as the V7 (an F blues): E♭5(15) held, D5(14), B♭4(10),
|
||||||
|
// G4(7), then the crush (E♭4=3)E4(4). The ♯9→9 melt is 15→14.
|
||||||
|
id: 'blues-cry-melt-v7',
|
||||||
|
name: 'The cry and melt (V7 fill)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the V7, bar 9 of a slow blues',
|
||||||
|
quality: 'dom7',
|
||||||
|
techniques: ['grace-note'],
|
||||||
|
source: 'the ♯9→9 "crying" resolution — pianogroove.com slow-blues lessons; the no-5th grip per piano-ology "Dominant 7(♯9) Voicings"',
|
||||||
|
notes: [
|
||||||
|
{ deg: '#9', octave: 1, beat: 1 },
|
||||||
|
{ deg: '9', octave: 1, beat: 2 },
|
||||||
|
{ deg: '7', beat: 2.33 },
|
||||||
|
{ deg: '5', beat: 2.67 },
|
||||||
|
{ deg: 'b3', beat: 3, technique: 'grace-note' },
|
||||||
|
{ deg: '3', beat: 3 },
|
||||||
|
],
|
||||||
|
tips: 'Lean on the ♯9 for a full beat — over the V7 it is the key\'s own ♭7, the crying note — then let it melt a half-step onto the natural 9, fall through the ♭7 and 5th, and land a ♭3 crush on the 3rd. Placement is the whole trick: bar 9 is the emotional peak of the form.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -227,4 +227,88 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Structured licks (SCHEMA.md "Licks", task P-24). Written in a home key each
|
||||||
|
// (noted per lick) but key-agnostic in spirit — chordContext names the station.
|
||||||
|
// Every pitch hand-verified: s6=E s5=A s4=D s3=G s2=B s1=e (+fret, mod 12).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// In G, open position: 2, ♭3 hammered to the 3, then 5–6 up to the open-G
|
||||||
|
// root landed on the downbeat. THE bluegrass phrase-ending tag.
|
||||||
|
id: 'country-flatt-g-run',
|
||||||
|
name: 'The Lester Flatt G-run',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'phrase-ending tag on the I',
|
||||||
|
techniques: ['hammer-on'],
|
||||||
|
source: 'the canonical Flatt & Scruggs tag — hvbluegrass.org "The Truth About the Lester Flatt G Run"',
|
||||||
|
tab: [
|
||||||
|
{ string: 5, fret: 0 }, // A — the 2
|
||||||
|
{ string: 5, fret: 1, technique: 'hammer-on' }, // B♭ — the blue ♭3, hammered from the open string
|
||||||
|
{ string: 5, fret: 2 }, // B — the major 3: the curl resolves
|
||||||
|
{ string: 4, fret: 0 }, // D — 5
|
||||||
|
{ string: 4, fret: 2 }, // E — 6
|
||||||
|
{ string: 3, fret: 0 }, // G — root: land it ON the downbeat with the chord
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A, over the I7: hybrid-picked 3rds walking up the Mixolydian —
|
||||||
|
// 3+5 (C♯+E) → 4+6 (D+F♯) → 5+♭7 (E+G) — with clucked ghost notes
|
||||||
|
// between, resolving to the root on top. Shift the hand up with each pair.
|
||||||
|
id: 'country-chicken-thirds',
|
||||||
|
name: 'Chicken-pickin\' 3rds walk-up',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the I7 — fills between vocal lines',
|
||||||
|
techniques: ['ghost-note', 'double-stop', 'slide', 'vibrato'],
|
||||||
|
source: 'in the style of Brent Mason\'s double-stop chicken pickin\' — Brent Mason, Nashville Chops & Western Swing Guitar (Hal Leonard); Sam Smiley\'s Brent Mason lick analyses',
|
||||||
|
tab: [
|
||||||
|
{ string: 3, fret: 5, technique: 'ghost-note' }, // muted cluck — the chicken in the pickin'
|
||||||
|
{ string: 3, fret: 6 }, // C♯ — the 3
|
||||||
|
{ string: 2, fret: 5, technique: 'double-stop' }, // E — the 5: first 3rd-pair
|
||||||
|
{ string: 3, fret: 6, technique: 'ghost-note' }, // cluck between pairs
|
||||||
|
{ string: 3, fret: 7 }, // D — the 4
|
||||||
|
{ string: 2, fret: 7, technique: 'double-stop' }, // F♯ — the 6: passing pair
|
||||||
|
{ string: 2, fret: 8, technique: 'slide' }, // G — ♭7, top voice slides up the B string
|
||||||
|
{ string: 3, fret: 9, technique: 'double-stop' }, // E — the 5: the dominant 5+♭7 pair lands
|
||||||
|
{ string: 2, fret: 10, technique: 'vibrato' }, // A — root on top: resolve
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A: the classic pedal-steel move — bend the 2 (B) a whole step up to
|
||||||
|
// the 3 (C♯) on the G string and HOLD it while the 5th and then the root
|
||||||
|
// ring on top: the full triad stacks up, steel-style (an oblique bend).
|
||||||
|
id: 'country-pedal-steel-bend',
|
||||||
|
name: 'Pedal-steel bend into the 3rd',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the I — the money chord change',
|
||||||
|
techniques: ['bend', 'double-stop', 'vibrato'],
|
||||||
|
source: 'the oblique 2→3 steel bend — Premier Guitar "Twang 101: 6 Essential Pedal-Steel Bends"; Fundamental Changes "Country Guitar String Bending"',
|
||||||
|
tab: [
|
||||||
|
{ string: 3, fret: 2 }, // A — root pickup
|
||||||
|
{ string: 3, fret: 4, technique: 'bend' }, // B — the 2, bent a whole step up to C♯ and HELD
|
||||||
|
{ string: 2, fret: 5, technique: 'double-stop' }, // E — the 5th rings on top of the held bend
|
||||||
|
{ string: 1, fret: 5, technique: 'vibrato' }, // A — root struck next, bend still holding: the triad stack
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In G, open position: the banjo forward roll (thumb–index–middle)
|
||||||
|
// crosspicked across strings 3-2-1 — root, 3rd, high root cascading in
|
||||||
|
// even 8ths. No left-hand tricks: the ringing roll IS the technique.
|
||||||
|
id: 'country-forward-roll',
|
||||||
|
name: 'Forward-roll crosspicking',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the I — keeps time like a banjo under a vocal',
|
||||||
|
techniques: [],
|
||||||
|
source: 'the Scruggs forward roll (T–I–M) adapted to guitar crosspicking — Wikipedia "Banjo roll"; Deering "The Four Essential 5-String Banjo Rolls"',
|
||||||
|
tab: [
|
||||||
|
{ string: 3, fret: 0 }, // G — root (thumb)
|
||||||
|
{ string: 2, fret: 0 }, // B — the 3 (index)
|
||||||
|
{ string: 1, fret: 3 }, // G — octave root (middle)
|
||||||
|
{ string: 3, fret: 0 }, // roll it again —
|
||||||
|
{ string: 2, fret: 0 }, // even 8ths,
|
||||||
|
{ string: 1, fret: 3 }, // every note ringing into the next
|
||||||
|
{ string: 3, fret: 0 }, // G
|
||||||
|
{ string: 2, fret: 0 }, // B — hand back at the top of the roll
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,4 +185,86 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Structured licks (SCHEMA.md "Licks", task P-21). Written in the style's home
|
||||||
|
// positions (E for the dominant vamps, D dorian for the minor vamps) but
|
||||||
|
// key-agnostic in spirit — chordContext names the station.
|
||||||
|
// Every pitch hand-verified: s6=E s5=A s4=D s3=G s2=B s1=e (+fret, mod 12).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// In E: root, ghost, ♭3 hammered to the 3, 5, ♭7, octave root — the
|
||||||
|
// dominant arpeggio with the blues grit built in, played staccato.
|
||||||
|
id: 'funk-nine-riff',
|
||||||
|
name: 'Single-note dominant riff',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the I9 one-chord vamp',
|
||||||
|
techniques: ['ghost-note', 'hammer-on'],
|
||||||
|
source: 'in the style of the James Brown-band single-note riffs ("Sex Machine" lineage); Fundamental Changes funk guitar lessons',
|
||||||
|
tab: [
|
||||||
|
{ string: 6, fret: 0 }, // E — root, on the One
|
||||||
|
{ string: 6, fret: 0, technique: 'ghost-note' }, // scratch — the 16th grid never stops
|
||||||
|
{ string: 6, fret: 3 }, // G — ♭3 grit
|
||||||
|
{ string: 6, fret: 4, technique: 'hammer-on' }, // G♯ — the 3: the funk curl
|
||||||
|
{ string: 5, fret: 2 }, // B — 5
|
||||||
|
{ string: 5, fret: 5 }, // D — ♭7
|
||||||
|
{ string: 5, fret: 7 }, // E — octave root; shift up to grab it
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In E (♭VII = D): chromatic climb D–D♯–E back to the One, answered by the
|
||||||
|
// 3+♭7 tritone stab straight out of the E9 grip (G♯+D).
|
||||||
|
id: 'funk-chromatic-snapback',
|
||||||
|
name: 'Chromatic snap-back to the One',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: '♭VII9 → I9, landing on the One',
|
||||||
|
techniques: ['chromatic-approach', 'double-stop'],
|
||||||
|
source: 'the E9→D9 vamp move ("Papa\'s Got a Brand New Bag" lineage); Fundamental Changes JB-style accent lessons',
|
||||||
|
tab: [
|
||||||
|
{ string: 5, fret: 5 }, // D — the ♭VII's root
|
||||||
|
{ string: 5, fret: 6, technique: 'chromatic-approach' }, // D♯ — passing
|
||||||
|
{ string: 5, fret: 7 }, // E — the One
|
||||||
|
{ string: 4, fret: 6 }, // G♯ — the 3, from the 9-grip
|
||||||
|
{ string: 3, fret: 7, technique: 'double-stop' }, // D — the ♭7: tritone stab together
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In D dorian: the ♭3+♭7 dyad (F+C) slid in from one fret below, answered
|
||||||
|
// by the root+11 dyad (D+G) — the m11 wash as two-note stabs — and a ghost.
|
||||||
|
id: 'funk-dorian-stabs',
|
||||||
|
name: 'Dorian double-stop stabs',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the i7/i9 Dorian vamp',
|
||||||
|
techniques: ['double-stop', 'slide', 'ghost-note'],
|
||||||
|
source: 'in the style of the Meters\' dyad stabs ("Cissy Strut" lineage) and the Jimmy Nolen scratch vocabulary',
|
||||||
|
tab: [
|
||||||
|
{ string: 2, fret: 5 }, // E — one fret below F
|
||||||
|
{ string: 3, fret: 4, technique: 'double-stop' }, // B — one fret below C (approach dyad)
|
||||||
|
{ string: 3, fret: 5, technique: 'slide' }, // C — the ♭7
|
||||||
|
{ string: 2, fret: 6, technique: 'double-stop' }, // F — the ♭3: the m7 pair lands
|
||||||
|
{ string: 3, fret: 7 }, // D — root
|
||||||
|
{ string: 2, fret: 8, technique: 'double-stop' }, // G — the 11 on top: the m11 colour
|
||||||
|
{ string: 3, fret: 7, technique: 'ghost-note' }, // scratch — keep the grid breathing
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In D dorian: 1 ♭3 4 5 →6 5 ♭7 1 — a single-note vamp line that leans on
|
||||||
|
// the natural 6 (B over D), the note that makes Dorian sound like funk.
|
||||||
|
id: 'funk-dorian-six-line',
|
||||||
|
name: 'Dorian line leaning on the 6',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the i7–IV7 Dorian vamp',
|
||||||
|
techniques: ['slide', 'vibrato'],
|
||||||
|
source: 'the Dorian vamp language of "Chameleon" (Herbie Hancock) — see Ethan Hein\'s Chameleon analysis; a line in that style, not a transcription',
|
||||||
|
tab: [
|
||||||
|
{ string: 5, fret: 5 }, // D — 1
|
||||||
|
{ string: 5, fret: 8 }, // F — ♭3
|
||||||
|
{ string: 4, fret: 5 }, // G — 4
|
||||||
|
{ string: 4, fret: 7 }, // A — 5
|
||||||
|
{ string: 4, fret: 9, technique: 'slide' }, // B — the natural 6, slid into
|
||||||
|
{ string: 4, fret: 7 }, // A — 5
|
||||||
|
{ string: 3, fret: 5 }, // C — ♭7
|
||||||
|
{ string: 3, fret: 7, technique: 'vibrato' }, // D — octave home
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,12 @@ const SUS4_6 = { rootStr: 6, offsets: [0, 0, 'x', 'x', 0, 'x'], fingers: [1, 2,
|
|||||||
const MAJ_6 = { rootStr: 6, offsets: [0, 2, 2, 1, 'x', 'x'], fingers: [1, 3, 4, 2, 0, 0] } // R–5–R–3 (E-shape)
|
const MAJ_6 = { rootStr: 6, offsets: [0, 2, 2, 1, 'x', 'x'], fingers: [1, 3, 4, 2, 0, 0] } // R–5–R–3 (E-shape)
|
||||||
const MAJ_5 = { rootStr: 5, offsets: ['x', 0, 2, 2, 2, 'x'], fingers: [0, 1, 2, 3, 4, 0] } // R–5–R–3 (A-shape)
|
const MAJ_5 = { rootStr: 5, offsets: ['x', 0, 2, 2, 2, 'x'], fingers: [0, 1, 2, 3, 4, 0] } // R–5–R–3 (A-shape)
|
||||||
|
|
||||||
// --- the passing diminished 7th (#iv°7) ---
|
// --- the passing diminished 7th (#iv°7 / ♯i°7 — symmetric, one grip fits both) ---
|
||||||
const DIM7_5 = { rootStr: 5, offsets: ['x', 0, 1, -1, 1, 'x'], fingers: [0, 2, 3, 1, 4, 0] } // R–♭5–𝄫7–♭3 (symmetric)
|
const DIM7_5 = { rootStr: 5, offsets: ['x', 0, 1, -1, 1, 'x'], fingers: [0, 2, 3, 1, 4, 0] } // R–♭5–𝄫7–♭3 (symmetric)
|
||||||
|
|
||||||
|
// --- the borrowed iv (minor 6th on the middle strings, for the tonicized Amen) ---
|
||||||
|
const MIN6_4 = { rootStr: 4, offsets: ['x', 'x', 0, -2, 0, -2], fingers: [0, 0, 3, 1, 4, 2] } // R–♭3–6–R
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
styleIntro:
|
styleIntro:
|
||||||
'Gospel guitar lives between the organ and the choir: short, voice-led grips that comp the changes without crowding the keys. The signature sounds are guide-tone shells for the moving 2–5–1 chains, 9th and add9 colour on the resting chords, sus tension in the modern praise vamp, and a single passing diminished that makes a plain hymn sound like church. Keep the fifth and often the root to the bass — your job is the 3rds, 7ths, and the colour note.',
|
'Gospel guitar lives between the organ and the choir: short, voice-led grips that comp the changes without crowding the keys. The signature sounds are guide-tone shells for the moving 2–5–1 chains, 9th and add9 colour on the resting chords, sus tension in the modern praise vamp, and a single passing diminished that makes a plain hymn sound like church. Keep the fifth and often the root to the bass — your job is the 3rds, 7ths, and the colour note.',
|
||||||
@@ -188,6 +191,58 @@ export default {
|
|||||||
tips: 'The two min9 chords are the identical shape a fourth apart — one of the easiest gospel moves to internalize. The maj9 resolution sounds especially plush after a back-door dominant.',
|
tips: 'The two min9 chords are the identical shape a fourth apart — one of the easiest gospel moves to internalize. The maj9 resolution sounds especially plush after a back-door dominant.',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'gospel-walkup-dim': [
|
||||||
|
{
|
||||||
|
label: 'Walk-up on the A string (shells)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: SHELL_5.maj7, note: 'Imaj7 — root on the A string' },
|
||||||
|
{ shape: DIM7_5, note: '♯i°7 — one fret up: the ladder rung' },
|
||||||
|
{ shape: SHELL_5.min7, note: 'ii7 — one more fret: the bass arrived by half steps' },
|
||||||
|
{ shape: SHELL_6.dom7, note: 'V7 — turn around and climb again' },
|
||||||
|
],
|
||||||
|
tips: 'The first three roots sit on one string, one fret apart — the walk-up is literally visible under your hand. Give the diminished its full beat but keep it quieter than the chords around it: it is a passing chord, a rung, not a destination. Over it, arpeggiate its four notes (all minor 3rds apart) — the fastest route from I\'s tones to ii\'s.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '9th-coloured walk-up (mixed registers)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: MAJ9_6, extensions: ['9'], note: 'Imaj9 — low root, the 9 shining on top' },
|
||||||
|
{ shape: DIM7_5, note: '♯i°7 — the diminished stays plain; its tension IS the colour' },
|
||||||
|
{ shape: MIN9_5, extensions: ['9'], note: 'ii9' },
|
||||||
|
{ shape: DOM9_5, extensions: ['9'], note: 'V9' },
|
||||||
|
],
|
||||||
|
tips: 'Same climb with the gospel shimmer on the resting chords. Remember what the ♯i°7 really is — a rootless VI7♭9 aimed at ii — but not every note climbs: only the root rises a half step into ii\'s root, while the hidden dominant\'s ♭7 and ♭9 sigh downward into the ii9. Don\'t decorate the diminished; decorate its resolution.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'gospel-tonicized-amen': [
|
||||||
|
{
|
||||||
|
label: 'Shell tag — one finger tells the story',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: SHELL_6.maj7, note: 'Imaj7 — R–7–3' },
|
||||||
|
{ shape: SHELL_6.dom7, note: 'I7 — same grip, one finger drops a fret: the 7 falls to ♭7' },
|
||||||
|
{ shape: SHELL_5.maj7, note: 'IVmaj7 — same fret, root string up (the I7 pointed here)' },
|
||||||
|
{ shape: MIN6_4, note: 'iv6 — the borrowed minor on the middle strings' },
|
||||||
|
{ shape: SHELL_6.maj7, note: 'Imaj7 — home' },
|
||||||
|
],
|
||||||
|
tips: 'Watch the two half-step falls: the I\'s major 7 drops to ♭7 (turning I into V7/IV), then the IV\'s 3rd drops to ♭3 (the borrowed iv). Everything else holds. When soloing, target exactly those two falling voices — the ♭7 of I7 resolves into the 3rd of IV, and the iv\'s ♭3 sighs down to the 9/1 of home.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '9th-coloured tag (upper register)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: MAJ9_6, extensions: ['9'], note: 'Imaj9' },
|
||||||
|
{ shape: DOM9_6, extensions: ['9'], note: 'I9 — the same one-finger drop, with the 9 held on top' },
|
||||||
|
{ shape: MAJ9_6, extensions: ['9'], note: 'IVmaj9 — identical grip five frets up' },
|
||||||
|
{ shape: MIN6_4, note: 'iv6 — drop to the plain borrowed minor; no 9 here' },
|
||||||
|
{ shape: MAJ9_6, extensions: ['9'], note: 'Imaj9 — resolve with colour' },
|
||||||
|
],
|
||||||
|
tips: 'The maj9 → dom9 move is the same story as the shells — only the D-string finger moves, 7 falling to ♭7 — but the held 9 makes the tag glow. Leave the iv6 uncoloured: after four 9th chords, the bare borrowed minor is the emotional dip that sets up the resolution.',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
improv: {
|
improv: {
|
||||||
|
|||||||
@@ -0,0 +1,388 @@
|
|||||||
|
// Gospel piano pack (task P-23). Recipes verified by degree-spelling against
|
||||||
|
// CHORD_TYPES (src/lib/theory.js) and the validator's stacking convention
|
||||||
|
// (order inside each hand = voicing order low → high, documented at
|
||||||
|
// jazz/piano.js header). Voicings and treatments sourced from:
|
||||||
|
// hearandplay.com — "Gospel Pianists: Don't Leave Home Without These Essential
|
||||||
|
// Chords" (root–5 / octave left hands, full RH stacks), "Little known ways to
|
||||||
|
// use diminished walk-ups and walk-downs" (♯i°7/♯iv°7 as passing chords),
|
||||||
|
// "Gospel Piano Scales — 6 Different Scales That Can Work Now" (the
|
||||||
|
// pentatonic-♭3 "gospel scale"), and GospelKeys 202 (replacing plain triads
|
||||||
|
// with full-sounding 9th/6-9 voicings in worship playing);
|
||||||
|
// pianogroove.com — "Gospel Passing Chords & Substitutions", "Blues & Gospel
|
||||||
|
// Walk-Ups", "Gospel Hymn Styles" and "Gospel Time Signatures" (12/8 and 6/8
|
||||||
|
// hymn feels), "The Gospel Walk Down";
|
||||||
|
// piano.org — "Rootless Voicings: Type A and Type B (Bill Evans Style)" (the
|
||||||
|
// rootless grips contemporary gospel borrows once a bassist is present);
|
||||||
|
// pianowithjonny.com — "Play Gospel Piano: The 6-Step Beginner Guide"
|
||||||
|
// (root–5 foundations, add9/6th colour); learncolorpiano.com — "Gospel
|
||||||
|
// Progression 1 | Diminished 7th Chords" (rolling the passing °7).
|
||||||
|
// Voice-leading statements in notes/tips are pitch-class arithmetic, checked
|
||||||
|
// against the realized voicings (key of C) before writing.
|
||||||
|
|
||||||
|
// Reusable degree recipes. Order inside each hand = voicing order, low → high.
|
||||||
|
const LH_R5 = ['1', '5'] // open fifth — the hymn "pillar" left hand
|
||||||
|
const LH_OCT = ['1', '1'] // root octave — gospel's bass-player left hand
|
||||||
|
const RH_7TH = ['3', '5', '7'] // root-position seventh-chord upper structure
|
||||||
|
const RH_9TH = ['3', '5', '7', '9'] // the full-sounding 9th stack (GospelKeys-style)
|
||||||
|
const RH_ADD9 = ['3', '5', '9'] // triad with the 9 on top (no 7th)
|
||||||
|
const RH_69 = ['3', '5', '6', '9'] // the 6/9 landing hand — gospel's final chord
|
||||||
|
|
||||||
|
export default {
|
||||||
|
styleIntro:
|
||||||
|
'In church the piano often IS the rhythm section: the left hand supplies the bass (roots, fifths, octaves), the right hand supplies the choir (full triads and 7ths with 9ths and 6ths stacked in), and the space between chords is filled with walk-ups and passing diminisheds. Everything is voiced full and vocal — every chord supports a singer, and every voice is always headed somewhere: to the 4, to the Amen, back home.',
|
||||||
|
|
||||||
|
comping: [
|
||||||
|
{
|
||||||
|
label: '12/8 hymn pulse',
|
||||||
|
rhythm: 'four beats to the bar, each felt in three (12/8)',
|
||||||
|
description:
|
||||||
|
'The slow-gospel foundation: block both hands on the four main beats and let the triplet subdivision breathe underneath. Roll the bigger chords bottom-to-top into beats 1 and 3 — on a hymn the roll is the ornament, not the notes.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Walk-up into the downbeat',
|
||||||
|
rhythm: 'beats 3–4 walk, land on 1',
|
||||||
|
description:
|
||||||
|
'Gospel\'s transitional engine: on the last beats of the bar the left hand climbs stepwise or chromatically (often through a passing diminished) so the next chord\'s downbeat lands like an arrival. The chord change is announced before it happens.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Shout-drive stabs',
|
||||||
|
rhythm: 'relentless on-beat quarters, both hands',
|
||||||
|
description:
|
||||||
|
'The praise-break gear: octave roots in the left hand, full stacks in the right, hammered on every beat of a fast swung 4/4. Where jazz comping avoids downbeats, shout playing owns them — the piano is driving the room, not commenting on it.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
plays: {
|
||||||
|
'gospel-cycle-251': [
|
||||||
|
{
|
||||||
|
label: 'Church pillars (root–5 under stacked 9ths)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'plain minor 7 — save the colour for the chords that move' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: ['3', '7', 'b9'] }, note: 'VI7♭9 — from the iii7 one RH note name holds (its ♭3 is this ♭7) and the other two each fall a half-step (5→♭9, ♭7→3)' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9TH }, note: 'the VI7\'s ♭9 just fell a half-step onto this 5th' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9TH }, note: 'two note names hold from the ii (♭3→♭7, 5→9); the ii\'s ♭7 fell a half-step onto this 3rd' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9TH }, note: 'maj9 home — the V7\'s ♭7 fell a half-step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'LH open fifths around C3, RH stacks just above middle C',
|
||||||
|
tips: 'Root and fifth below, four-note stack above — the full-choir sound that lets a piano carry a congregation alone. The cycle teaches one law: at every change the old ♭7 falls onto the new 3rd — a half-step when the landing chord is major or dominant (iii7→VI7, ii7→V7, V7→I), a whole step when it lands on the minor ii (VI7→ii7). Hear that thread and the whole chain plays itself.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless cascade (band setting)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: ['3', '5', '7'] }, note: '♭3–5–♭7, no root — the bass player has it' },
|
||||||
|
{ recipe: { LH: ['7', 'b9', '3'] }, note: 'from the iii7: one note name holds, two fall a half-step' },
|
||||||
|
{ recipe: { LH: ['3', '5', '7', '9'] }, note: 'out of the VI7 everything sinks: two half-steps and a whole step' },
|
||||||
|
{ recipe: { LH: ['7', '9', '3', '13'] }, note: 'three note names hold from the ii (♭3→♭7, 5→9, 9→13) — only the ♭7 moves, a half-step onto this 3rd' },
|
||||||
|
{ recipe: { LH: ['3', '5', '7', '9'] }, note: 'maj9 landing — the V\'s 3rd holds over as this maj7' },
|
||||||
|
],
|
||||||
|
register: 'left hand alone, top note between C4 and C5 — right hand answers the choir',
|
||||||
|
tips: 'Contemporary gospel borrows the jazz rootless grips the moment a bassist is on the platform: doubling their root just muddies the mix. Watch the ii7→V7 seam and count what your hand does — three fingers stay on the same note names (♭3→♭7, 5→9, 9→13) and one falls a half-step. That near-stillness over a moving bass is the sound of a tight church band.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'gospel-amen-625': [
|
||||||
|
{
|
||||||
|
label: 'Hymn pillars into the Amen',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'the turnaround starts its fall home' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'the vi\'s ♭7 fell a whole step onto this ♭3' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'the ii\'s ♭7 fell a half-step onto this 3rd' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'home — the V\'s ♭7 fell a half-step onto this 3rd' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: ['3', '5', '1'] }, note: 'inverted triad, root on top — set up the Amen fall' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'Amen: all three RH voices sink — root-on-top a half-step onto the 3rd, 5th a half-step onto the maj7, 3rd a whole step onto the 5th' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH close position around middle C; 12/8 pulse',
|
||||||
|
tips: 'The 6–2–5–1 is the same falling-fifths law as any turnaround: each ♭7 falls by step onto the next chord\'s 3rd. The Amen is the payoff — voice the IV with its root on top and every right-hand voice sinks into the I (two half-steps, one whole step). That downward sigh is why plagal cadences close hymns.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Octave bass, 6/9 colour (contemporary)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_ADD9 }, note: 'm9 spread — the 9 on top sings' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_ADD9 }, note: 'same shape, next station of the fall' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['3', '7', '9'] }, note: 'V9 — its 9 will hold into the I as the 6th' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_69 }, note: '6/9 instead of maj7 — the V9\'s ♭7 fell a half-step onto this 3rd, its 9 held as this 6' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['3', '6', '9'] }, note: 'IV as a 6/9 — every note of this hand is already a note of the I6/9' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_69 }, note: 'the final chord of half the gospel repertoire: 6/9, root octave below' },
|
||||||
|
],
|
||||||
|
register: 'LH octaves around C2–C3, RH between C4 and C5 — big and open',
|
||||||
|
tips: 'Swapping the maj7 for the 6/9 is the single most gospel substitution there is — the 6th and 9th colour the tonic without the maj7\'s leading-tone rub against a melody on the root. The Amen becomes pure bass motion: every note of the IV6/9 right hand is already a tone of the I6/9 (its 3, 6 and 9 are the I\'s 6, 9 and 5), so those three note names hold, the I\'s 3rd joins beneath them, and the octave bass makes the change alone.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'gospel-iv-passing-dim': [
|
||||||
|
{
|
||||||
|
label: 'The 4–♯4–5 walk (dim7 into I over its 5th)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ADD9 }, note: 'add9 home, open and ringing' },
|
||||||
|
{ recipe: { LH: ['1'], RH: ['3', '5', '1'] }, note: 'single bass note — the walk starts; root on top of the RH' },
|
||||||
|
{ recipe: { LH: ['1'], RH: RH_7TH }, note: 'two RH notes freeze (the IV\'s 3rd and 5th are this °7\'s ♭3 and ♭5); the top slips a whole step; the bass does the talking' },
|
||||||
|
{ recipe: { LH: ['5', '1'], RH: RH_ADD9 }, note: 'I over its 5th — the bass lands 4→♯4→5 while the °7\'s 𝄫7 rises a half-step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'bass line front and centre (C2–C3); RH compact around middle C',
|
||||||
|
tips: 'The whole point is the bass: 4, ♯4, 5 — two half-steps that turn a plain IV–I into church. Above it almost nothing moves: the ♯iv°7 keeps two of the IV\'s notes, and it already contains the key\'s home note (its ♭5), so the resolution is prepared before you play it. Landing on I-over-its-5th instead of root position is what makes the walk feel continuous — save root position for the phrase\'s final chord.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Praise clusters with a rolled diminished',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['9', '3', '5'] }, note: 'add9 cluster — 9 tucked under the 3rd, modern worship colour' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['9', '3', '5'] }, note: 'same grip, root a fourth up — the cluster shape carries the whole vamp' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_7TH }, note: 'roll it bottom-to-top like a grace note — two of the IV\'s three cluster notes carry straight in' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['5', '1', '9'] }, note: 'open 5–1–9 — release after the crunch' },
|
||||||
|
],
|
||||||
|
register: 'LH octaves; RH clusters between C4 and D5; straight-16th contemporary feel',
|
||||||
|
tips: 'The 9-under-the-3rd cluster is the modern praise sound — tight, bright, no 7th. Treat the ♯iv°7 as a gesture, not a destination: roll it into the beat and let it release into the open 5–1–9 hand. One crunchy chord between two clean ones is exactly the dosage; two would be a jazz solo.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'gospel-sus-vamp': [
|
||||||
|
{
|
||||||
|
label: 'Worship pads (one shape, four chords)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ADD9 }, note: 'm9 pad' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ADD9 }, note: 'add9 — same grip, the roots do the work' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ADD9 }, note: 'the "3rd" slot is the suspended 4th — which is the key\'s home note' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ADD9 }, note: 'home, still hovering on the 9' },
|
||||||
|
],
|
||||||
|
register: 'sustained, pedal down; LH fifths low, RH between C4 and C5',
|
||||||
|
tips: 'One right-hand recipe — 3(4)–5–9 — planted on four different roots: this is how worship keyboardists play a whole set. The vamp hovers because the tonic note never leaves: it is the vi\'s ♭3, the IV\'s 5th and the Vsus\'s suspended 4th before it finally lands in the bass on the I. The Vsus\'s 9 is the vi\'s root — the loop\'s seam is sewn shut.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Anticipated stabs (octaves + clusters)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['3', '5', '1'] }, note: 'first-inversion shape, root on top' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['9', '3', '5'] }, note: '9-cluster — tight against the pad version\'s spread' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['3', '1', '9'] }, note: 'sus stack: 4th, root, 9 — no 3rd to resolve' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['5', '1', '9'] }, note: 'two of the three stab notes (the key\'s 1 and 5) carry over from the Vsus' },
|
||||||
|
],
|
||||||
|
register: 'both hands mid-keyboard, short and percussive; hit the and-of-4 and tie',
|
||||||
|
tips: 'Same four chords, opposite job: instead of pads, strike each chord an eighth early (the and-of-4) and let the tie pull the band forward. Keep the right hand to three notes — stabs live or die on rhythm, and the Vsus→I seam proves how little needs to move: two of your three notes stay on the same note names while the octave bass resolves.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'gospel-backdoor': [
|
||||||
|
{
|
||||||
|
label: 'Pillars: the back door swings on its 9',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'soft diatonic start' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'two note names carry over: the iii\'s root becomes this chord\'s 5th, its ♭3 becomes this ♭7' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9TH }, note: '♭VII9 — the 9 of this chord is the key\'s home note; keep it on top of your ear' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9TH }, note: 'maj9 — the back door\'s ♭7 sank a half-step onto this 5th, its 5th a half-step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH around middle C; unhurried',
|
||||||
|
tips: 'The back door earns its name in the voice leading: where V7 resolves with leading-tone pull, the ♭VII7 slides home on two half-step sighs — its ♭7 onto the I\'s 5th and its 5th onto the I\'s 3rd — while its 9 (the key\'s home note) rings through the whole change. Play the ♭VII9 slightly softer than the chords around it; the surprise chord should whisper.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless slide (band setting)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: ['3', '5', '7'] }, note: 'three-note rootless — light' },
|
||||||
|
{ recipe: { LH: ['3', '5', '7'] }, note: 'the iii\'s ♭7 fell a whole step onto this ♭3' },
|
||||||
|
{ recipe: { LH: ['3', '13', '7', '9'] }, note: 'the vi\'s ♭3 and ♭7 are already this chord\'s 9 and 13 — two note names don\'t move' },
|
||||||
|
{ recipe: { LH: ['3', '5', '7', '9'] }, note: 'maj9 — the ♭VII\'s 13 was already this chord\'s 5th' },
|
||||||
|
],
|
||||||
|
register: 'left hand alone, top note between C4 and C5',
|
||||||
|
tips: 'The 13 is the trick: adding it to the ♭VII7 plants the I\'s 5th in your hand a bar early, and its 9 is the key\'s home note — so the "borrowed" chord is half at home before it resolves. Then the ♭7 sinks a half-step and the 3rd climbs a whole step onto the I\'s 3rd. Rootless because the bassist owns that ♭7̂ bass note — let them have the drama.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'gospel-walkup-dim': [
|
||||||
|
{
|
||||||
|
label: 'Walk-up: the bass climbs, the hands barely move',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: ['1'], RH: ['3', '5', '1'] }, note: 'root on top — it will fall a whole step while the rest of the hand freezes' },
|
||||||
|
{ recipe: { LH: ['1'], RH: RH_7TH }, note: 'the I\'s 3rd and 5th ARE this °7\'s ♭3 and ♭5 — two RH notes don\'t move; the bass climbs a half-step' },
|
||||||
|
{ recipe: { LH: ['1'], RH: RH_7TH }, note: 'every RH note climbs a half- or whole-step; the bass takes its second half-step' },
|
||||||
|
{ recipe: { LH: ['1'], RH: RH_7TH }, note: 'the ii\'s ♭3 holds as this ♭7 (same note name); its ♭7 fell a half-step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'single bass notes C2–C3 — the walking line is the melody; RH compact',
|
||||||
|
tips: 'A walk-up is a bass line wearing chords: 1, ♯1, 2 in the left hand while the right hand moves as little as arithmetic allows — two notes literally frozen through the first change. It works because ♯i°7 is a rootless VI7♭9 (its four notes are exactly the top four of the VI7♭9), so the ear hears a secondary dominant pointing at the ii. Practise hands separately: bass alone should already sound like gospel.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Full-church walk-up (root–5 + 9ths)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9TH }, note: 'maj9 — big two-hand home' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'thin to three: two RH notes freeze, the maj7 slips a half-step onto the 𝄫7, the 9 steps aside' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_9TH }, note: 'the whole right hand climbs by step out of the diminished — half-step, whole step, whole step — and the 9 returns on top' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: ['3', '13', '7', '9'] }, note: 'V13 — three note names hold from the ii (♭3→♭7, 5→9, 9→13); only its ♭7 falls, a half-step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH between C4 and C5; land the changes on downbeats',
|
||||||
|
tips: 'The same walk-up dressed for Sunday: open fifths under four-note stacks. Notice the diminished bar is the THIN one — dropping to three notes while the bass climbs makes the ♯i°7 feel like motion instead of mud, then the 9 coming back on the ii is the choir breathing in. The V13 grip (3–13–♭7–9) is the classic gospel dominant: learn it as one hand-shape and the ii7→V7 change costs you one finger.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'gospel-tonicized-amen': [
|
||||||
|
{
|
||||||
|
label: 'The two sighs, voiced plain',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'home, unhurried' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'identical grip — one note changes: the 7 falls a half-step to the ♭7, and home becomes V7 of the IV' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'the ♭7 fell a half-step onto this 3rd; the I\'s 3rd holds as this maj7 (same note name)' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: ['3', '5', '6'] }, note: 'iv6: the 3rd sank a half-step to ♭3, the maj7 a whole step to the 6th, the 5th held' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_7TH }, note: 'the iv\'s ♭3 sighs a half-step onto this 5th; its 6th rises a whole step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH around middle C; 12/8, rolled arrivals',
|
||||||
|
tips: 'Five chords, two borrowed notes, and each borrowed note resolves down a half-step — the ♭7 (into the IV\'s 3rd) and the borrowed ♭3 (into the I\'s 5th). Keep every other voice as still as the arithmetic allows and the tag plays like a pair of sighs, which is exactly how a congregation sings it. This is the hymn-ending to have under your fingers in all twelve keys.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Drive to the 4, land on the 6/9',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_ADD9 }, note: 'add9 home over octaves' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['3', '7', '9'] }, note: 'the drive: swap the 5 for the ♭7 — one finger hops up a minor third, the rest freeze' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_ADD9 }, note: 'arrival: the ♭7 sighed a half-step onto this 3rd, the 9 fell a whole step onto this 5th' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: ['3', '6', '9'] }, note: 'iv6/9: flatten the 3rd, swap the 5 for the 6 — the 9 on top never moves' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_69 }, note: 'the iv\'s 6 and 9 are already this chord\'s 9 and 5 — those note names hold; the borrowed ♭3 resolves down a half-step (♭6̂ to 5̂ of the key)' },
|
||||||
|
],
|
||||||
|
register: 'LH octaves low, RH between C4 and C5; push the I7 on the and-of-4',
|
||||||
|
tips: 'The I7 is a gesture, not a chord to sit on: strike it late in the bar (and-of-4, tied) so it shoves the music into the IV — that anticipation is the "drive to the 4" every gospel pianist leans on. Coming home, count what actually moves: two of the iv6/9\'s three notes are already tones of the I6/9, only the borrowed ♭3 resolves (down a half-step), and the I\'s 3rd slips in at the bottom of the hand. Endings this quiet are earned by voicings this shared.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
improv: {
|
||||||
|
scales: [
|
||||||
|
{
|
||||||
|
over: 'I / Imaj7 / Iadd9',
|
||||||
|
scale: 'major pentatonic + ♭3 (the gospel scale)',
|
||||||
|
why: '1–2–♭3–3–5–6: major pentatonic with a ♭3 crush note (hearandplay teaches it as the pentatonic-♭3 scale). The ♭3→3 slip into a chord tone is the single most gospel ornament on the piano.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'ii7',
|
||||||
|
scale: 'dorian',
|
||||||
|
why: 'The parent major scale started from 2 — no new notes to learn, and the natural 6 keeps the ii warm instead of mournful.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'vi7 / iii7',
|
||||||
|
scale: 'the key\'s own notes (aeolian / phrygian)',
|
||||||
|
why: 'These minor chords are diatonic, so the major scale you are already in covers them — from the vi it sounds aeolian, from the iii phrygian. Aim at each chord\'s ♭3 and ♭7 rather than reaching for a new scale.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'dom7 (V7, VI7, ♭VII7)',
|
||||||
|
scale: 'mixolydian',
|
||||||
|
why: 'Mixolydian from each dominant\'s own root hands you its ♭7. Over the backdoor ♭VII7 it also supplies the key\'s borrowed flat notes — that dusky colour is the point of the chord.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: '♯i°7 / ♯iv°7',
|
||||||
|
scale: 'the four chord tones (°7 arpeggio)',
|
||||||
|
why: 'Passing chords last a breath — arpeggiate the °7 itself (it is symmetric, stacked minor 3rds) and resolve by step: most of its tones sit a half-step or whole step from a tone of the next chord.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'iv6',
|
||||||
|
scale: 'dorian from the iv',
|
||||||
|
why: 'Dorian\'s natural 6 IS the chord\'s 6th, so the scale bakes the borrowed-iv colour in; land on the ♭3 and let it sigh down a half-step when the I arrives.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetNotes:
|
||||||
|
'Land 3rds on the strong beats, then double your line in 3rds or 6ths — the harmonized run is gospel\'s signature ornament, and on piano it is one hand-shape moved up the scale. Save the ♭3→3 crush for arrivals on the I, and when a walk-up is coming, aim your right-hand line at the same downbeat the bass is walking toward.',
|
||||||
|
},
|
||||||
|
|
||||||
|
// Structured piano licks (SCHEMA.md "Piano licks", task P-61). Degree-based
|
||||||
|
// and key-agnostic: every deg resolves through the stated quality, approach
|
||||||
|
// pitches are derived from the next deg note. Realized offsets in the
|
||||||
|
// comments use a C-rooted chord for readability; every interval claim in
|
||||||
|
// notes/tips was recomputed from those offsets before writing (P-41 bar).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// Over Cadd9: C4 D4 (E♭4)E4 G4 A4 C5 — offsets 0 2 [3]4 7 9 12: the
|
||||||
|
// hearandplay "gospel scale" (major pentatonic + ♭3) climbed straight
|
||||||
|
// up one octave, the ♭3 crushing a half-step into the 3rd.
|
||||||
|
id: 'gospel-scale-run',
|
||||||
|
name: 'Gospel-scale run (the ♭3→3 crush)',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the Iadd9 — any major-tonic bar',
|
||||||
|
quality: 'add9',
|
||||||
|
techniques: ['grace-note'],
|
||||||
|
source: 'the pentatonic-♭3 "gospel scale" — hearandplay.com, "Gospel Piano Scales — 6 Different Scales That Can Work Now"',
|
||||||
|
notes: [
|
||||||
|
{ deg: '1', beat: 1 },
|
||||||
|
{ deg: '9', beat: 1.5 },
|
||||||
|
{ deg: 'b3', beat: 2, technique: 'grace-note' },
|
||||||
|
{ deg: '3', beat: 2 },
|
||||||
|
{ deg: '5', beat: 2.5 },
|
||||||
|
{ deg: '6', beat: 3 },
|
||||||
|
{ deg: '1', octave: 1, beat: 3.5 },
|
||||||
|
],
|
||||||
|
tips: 'Major pentatonic with one borrowed note: 1–2–♭3–3–5–6–1, the ♭3 crushed into the 3rd almost as one gesture — gospel\'s answer to the string bend, same move the blues makes but headed somewhere brighter. Run it up one octave and stop; the restraint is what keeps it church and not cocktail.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over C7 (the V7 of an F shout vamp): G4 A4 C5 D5 E5 — offsets
|
||||||
|
// 7 9 12 14 16: 5–6–1–9–3 major pentatonic, straight-8th pickup on
|
||||||
|
// beats 3–4.5 landing the 3rd on beat 5 (the next downbeat).
|
||||||
|
id: 'gospel-shout-runup',
|
||||||
|
name: 'Shout run-up (pentatonic pickup)',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the V7 — the run-up into a shout/praise-break downbeat',
|
||||||
|
quality: 'dom7',
|
||||||
|
techniques: [],
|
||||||
|
source: 'praise-break run-up vocabulary — the drive gear hearandplay teaches in GospelKeys 300 (praise songs & shouting music)',
|
||||||
|
notes: [
|
||||||
|
{ deg: '5', beat: 3 },
|
||||||
|
{ deg: '6', beat: 3.5 },
|
||||||
|
{ deg: '1', octave: 1, beat: 4 },
|
||||||
|
{ deg: '9', octave: 1, beat: 4.5 },
|
||||||
|
{ deg: '3', octave: 1, beat: 5 },
|
||||||
|
],
|
||||||
|
tips: 'A five-note ladder — 5, 6, root, 9, 3, all major pentatonic off the chord\'s root — thrown at the next bar\'s downbeat like a drummer\'s fill. The landing note is the 3rd, arriving exactly ON beat 1 with the band\'s next hit: in shout music the run exists to make the downbeat feel inevitable. Play it in octaves when the room gets loud.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over Cmaj7, dyads struck together: C4+A4 → D4+B4 → E4+C5 → G4+E5 —
|
||||||
|
// offsets (0,9)(2,11)(4,12)(7,16). Every pair is a sixth (9,9,8,9
|
||||||
|
// semitones); bottom voice walks 1–2–3 then leaps a minor 3rd to 5,
|
||||||
|
// top sings 6–7–1 then leaps a major 3rd to the high 3. All eight
|
||||||
|
// notes diatonic to the root's major scale.
|
||||||
|
id: 'gospel-sixths-walkup',
|
||||||
|
name: 'Sixths walk-up (the harmonized choir line)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the Imaj7, walking into the next downbeat',
|
||||||
|
quality: 'maj7',
|
||||||
|
techniques: ['double-stop'],
|
||||||
|
source: 'harmonizing the scale in 3rds and 6ths — hearandplay.com, "Harmonization Of The Major Scale Using Third And Sixth Intervals"',
|
||||||
|
notes: [
|
||||||
|
{ deg: '1', beat: 2 },
|
||||||
|
{ deg: '6', beat: 2, technique: 'double-stop' },
|
||||||
|
{ deg: '9', beat: 3 },
|
||||||
|
{ deg: '7', beat: 3, technique: 'double-stop' },
|
||||||
|
{ deg: '3', beat: 4 },
|
||||||
|
{ deg: '1', octave: 1, beat: 4, technique: 'double-stop' },
|
||||||
|
{ deg: '5', beat: 5 },
|
||||||
|
{ deg: '3', octave: 1, beat: 5, technique: 'double-stop' },
|
||||||
|
],
|
||||||
|
tips: 'One singer with a shadow: the bottom voice walks 1–2–3 up the scale while the top sings 6–7–8 a sixth above, then both voices leap a third onto 5-under-3 for the arrival. Quarter notes, landing on the next bar\'s downbeat — it is the choir\'s soprano-alto pair under your right hand, and the 3rd on top of the last dyad is the note the pack keeps telling you to land on.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over a °7 (C root): C4 E♭4 G♭4 A4 C5 E♭5 G♭5 A5 — offsets
|
||||||
|
// 0 3 6 9 12 15 18 21: pure stacked minor 3rds, two full octaves of
|
||||||
|
// the symmetric chord, rolled in 16ths across beats 1–2.75.
|
||||||
|
id: 'gospel-dim-roll',
|
||||||
|
name: 'Diminished roll (two octaves of the passing chord)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the passing diminished bar — the ♯iv°7 or ♯i°7',
|
||||||
|
quality: 'dim7',
|
||||||
|
techniques: [],
|
||||||
|
source: 'rolling the passing °7 — learncolorpiano.com "Gospel Progression 1 | Diminished 7th Chords"; hearandplay.com diminished walk-ups/walk-downs lesson',
|
||||||
|
notes: [
|
||||||
|
{ deg: '1', beat: 1 },
|
||||||
|
{ deg: 'b3', beat: 1.25 },
|
||||||
|
{ deg: 'b5', beat: 1.5 },
|
||||||
|
{ deg: '6', beat: 1.75 },
|
||||||
|
{ deg: '1', octave: 1, beat: 2 },
|
||||||
|
{ deg: 'b3', octave: 1, beat: 2.25 },
|
||||||
|
{ deg: 'b5', octave: 1, beat: 2.5 },
|
||||||
|
{ deg: '6', octave: 1, beat: 2.75 },
|
||||||
|
],
|
||||||
|
tips: 'The °7 is symmetric — minor thirds all the way up, the same four note names in every octave — so one four-note fingering (1-2-3-4, cross, repeat) sweeps two octaves without thinking. Roll it like a harp flourish inside the passing bar and let the last note hang: every tone of the chord sits a half-step or whole step from a tone of the chord you are walking into, so wherever you stop, the resolution is already prepared.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -5,6 +5,13 @@
|
|||||||
// Wikipedia: Plagal cadence, Backdoor progression.
|
// Wikipedia: Plagal cadence, Backdoor progression.
|
||||||
// Song references are kept honest: where a single definitive recording isn't
|
// Song references are kept honest: where a single definitive recording isn't
|
||||||
// certain, the move is described by its standard use in the tradition.
|
// certain, the move is described by its standard use in the tradition.
|
||||||
|
//
|
||||||
|
// Level tags + the two intermediate progressions added by task P-20.
|
||||||
|
// Walk-up/tag theory verified against: hearandplay.com ("Little known ways to
|
||||||
|
// use diminished walk-ups and walk-downs", "An In-Depth Breakdown Of The
|
||||||
|
// Classic 1-4 Walk-Up"), pianogroove.com (Gospel Walk-Ups; Gospel Passing
|
||||||
|
// Chords & Substitutions), docs/progression-repertoire.md §1 (I–♯i°–ii,
|
||||||
|
// I–I7–IV, IV–iv–I rows).
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
id: 'gospel-cycle-251',
|
id: 'gospel-cycle-251',
|
||||||
@@ -16,6 +23,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['traditional gospel turnaround', 'His Eye Is on the Sparrow (reharmonized)'],
|
songs: ['traditional gospel turnaround', 'His Eye Is on the Sparrow (reharmonized)'],
|
||||||
tip: 'Every root falls a fifth and the off-diatonic VI7 pushes hard to ii — chain two ii–V cells back to back and the ear is dragged home. Voice-lead the 3rds and 7ths and your hand barely moves.',
|
tip: 'Every root falls a fifth and the off-diatonic VI7 pushes hard to ii — chain two ii–V cells back to back and the ear is dragged home. Voice-lead the 3rds and 7ths and your hand barely moves.',
|
||||||
|
level: 'intermediate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'gospel-amen-625',
|
id: 'gospel-amen-625',
|
||||||
@@ -27,6 +35,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['traditional hymn endings', "I'll Fly Away (turnaround/tag)"],
|
songs: ['traditional hymn endings', "I'll Fly Away (turnaround/tag)"],
|
||||||
tip: 'The 6–2–5–1 is the gospel turnaround — the extended cousin of the 2–5–1 that returns you from chorus to verse. Tag it with the plagal IV–I "Amen" for the classic church ending.',
|
tip: 'The 6–2–5–1 is the gospel turnaround — the extended cousin of the 2–5–1 that returns you from chorus to verse. Tag it with the plagal IV–I "Amen" for the classic church ending.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'gospel-iv-passing-dim',
|
id: 'gospel-iv-passing-dim',
|
||||||
@@ -38,6 +47,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['gospel hymn reharmonization', 'Amazing Grace (passing-chord arrangement)'],
|
songs: ['gospel hymn reharmonization', 'Amazing Grace (passing-chord arrangement)'],
|
||||||
tip: 'The #iv°7 is a chromatic passing chord linking IV back to I (bass walks 4 → #4 → 5/1). It is almost a signature of the gospel sound — one borrowed diminished and a plain hymn turns into church.',
|
tip: 'The #iv°7 is a chromatic passing chord linking IV back to I (bass walks 4 → #4 → 5/1). It is almost a signature of the gospel sound — one borrowed diminished and a plain hymn turns into church.',
|
||||||
|
level: 'intermediate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'gospel-sus-vamp',
|
id: 'gospel-sus-vamp',
|
||||||
@@ -49,6 +59,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['Every Praise — Hezekiah Walker (vamp feel)', 'contemporary gospel/CCM praise loop'],
|
songs: ['Every Praise — Hezekiah Walker (vamp feel)', 'contemporary gospel/CCM praise loop'],
|
||||||
tip: 'Contemporary gospel leans on open sus and add9 colour instead of plain triads — the suspended 4th over V never fully resolves, keeping the vamp hovering and "lifting". Loop it; the tension is the point.',
|
tip: 'Contemporary gospel leans on open sus and add9 colour instead of plain triads — the suspended 4th over V never fully resolves, keeping the vamp hovering and "lifting". Loop it; the tension is the point.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'gospel-backdoor',
|
id: 'gospel-backdoor',
|
||||||
@@ -60,5 +71,30 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['gospel/soul turnaround', 'standard back-door cadence (e.g. Tenderly, bars 5–7)'],
|
songs: ['gospel/soul turnaround', 'standard back-door cadence (e.g. Tenderly, bars 5–7)'],
|
||||||
tip: 'iii→vi is a soft diatonic drop; the ♭VII7 is the "back door" — a borrowed dominant a whole step below I that resolves up by step instead of down a fifth. A warmer, less expected way home than V7.',
|
tip: 'iii→vi is a soft diatonic drop; the ♭VII7 is the "back door" — a borrowed dominant a whole step below I that resolves up by step instead of down a fifth. A warmer, less expected way home than V7.',
|
||||||
|
level: 'intermediate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'gospel-walkup-dim',
|
||||||
|
name: 'Chromatic walk-up (I–♯i°7–ii7–V7)',
|
||||||
|
rn: ['Imaj7', '♯i°7', 'ii7', 'V7'],
|
||||||
|
degrees: [0, 1, 2, 7],
|
||||||
|
qualities: ['maj7', 'dim7', 'min7', 'dom7'],
|
||||||
|
bars: [1, 1, 1, 1],
|
||||||
|
mode: 'major',
|
||||||
|
songs: ['traditional gospel walk-up (bass climbs 1–♯1–2)', 'the standard hymn-to-church reharmonization move'],
|
||||||
|
tip: 'The ♯i°7 turns the step from I to ii into two half-steps — the bass climbs while the upper voices barely move. It works because ♯i°7 is a rootless VI7♭9, the secondary dominant of ii in disguise; then the V7 launches the loop again.',
|
||||||
|
level: 'intermediate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'gospel-tonicized-amen',
|
||||||
|
name: 'Tonicized Amen (I–I7–IV–iv–I)',
|
||||||
|
rn: ['Imaj7', 'I7', 'IVmaj7', 'iv6', 'Imaj7'],
|
||||||
|
degrees: [0, 0, 5, 5, 0],
|
||||||
|
qualities: ['maj7', 'dom7', 'maj7', 'min6', 'maj7'],
|
||||||
|
bars: [1, 1, 1, 1, 2],
|
||||||
|
mode: 'major',
|
||||||
|
songs: ['Amazing Grace ("how sweet the sound" — the I7 pointing at IV)', 'traditional hymn tag (Amen with the borrowed iv)'],
|
||||||
|
tip: 'Two borrowed notes tell the whole story: the ♭7 that turns I into the dominant of IV (a secondary dominant, V7/IV), and the ♭3 that turns IV minor on the way home. Both fall by half step — the gospel tag is a pair of sighs.',
|
||||||
|
level: 'intermediate',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
+11
-5
@@ -3,9 +3,12 @@
|
|||||||
import jazzMeta from './jazz/meta.js'
|
import jazzMeta from './jazz/meta.js'
|
||||||
import jazzProgressions from './jazz/progressions.js'
|
import jazzProgressions from './jazz/progressions.js'
|
||||||
import jazzGuitar from './jazz/guitar.js'
|
import jazzGuitar from './jazz/guitar.js'
|
||||||
|
import jazzPiano from './jazz/piano.js'
|
||||||
import bluesMeta from './blues/meta.js'
|
import bluesMeta from './blues/meta.js'
|
||||||
import bluesProgressions from './blues/progressions.js'
|
import bluesProgressions from './blues/progressions.js'
|
||||||
import bluesGuitar from './blues/guitar.js'
|
import bluesGuitar from './blues/guitar.js'
|
||||||
|
import bluesPiano from './blues/piano.js'
|
||||||
|
import bluesBass from './blues/bass.js'
|
||||||
import rockMeta from './rock/meta.js'
|
import rockMeta from './rock/meta.js'
|
||||||
import rockProgressions from './rock/progressions.js'
|
import rockProgressions from './rock/progressions.js'
|
||||||
import rockGuitar from './rock/guitar.js'
|
import rockGuitar from './rock/guitar.js'
|
||||||
@@ -24,23 +27,26 @@ import countryGuitar from './country/guitar.js'
|
|||||||
import rnbMeta from './rnb/meta.js'
|
import rnbMeta from './rnb/meta.js'
|
||||||
import rnbProgressions from './rnb/progressions.js'
|
import rnbProgressions from './rnb/progressions.js'
|
||||||
import rnbGuitar from './rnb/guitar.js'
|
import rnbGuitar from './rnb/guitar.js'
|
||||||
|
import rnbPiano from './rnb/piano.js'
|
||||||
import gospelMeta from './gospel/meta.js'
|
import gospelMeta from './gospel/meta.js'
|
||||||
import gospelProgressions from './gospel/progressions.js'
|
import gospelProgressions from './gospel/progressions.js'
|
||||||
import gospelGuitar from './gospel/guitar.js'
|
import gospelGuitar from './gospel/guitar.js'
|
||||||
|
import gospelPiano from './gospel/piano.js'
|
||||||
import popMeta from './pop/meta.js'
|
import popMeta from './pop/meta.js'
|
||||||
import popProgressions from './pop/progressions.js'
|
import popProgressions from './pop/progressions.js'
|
||||||
import popGuitar from './pop/guitar.js'
|
import popGuitar from './pop/guitar.js'
|
||||||
|
import popPiano from './pop/piano.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
jazz: {
|
jazz: {
|
||||||
meta: jazzMeta,
|
meta: jazzMeta,
|
||||||
progressions: jazzProgressions,
|
progressions: jazzProgressions,
|
||||||
instruments: { guitar: jazzGuitar },
|
instruments: { guitar: jazzGuitar, piano: jazzPiano },
|
||||||
},
|
},
|
||||||
blues: {
|
blues: {
|
||||||
meta: bluesMeta,
|
meta: bluesMeta,
|
||||||
progressions: bluesProgressions,
|
progressions: bluesProgressions,
|
||||||
instruments: { guitar: bluesGuitar },
|
instruments: { guitar: bluesGuitar, piano: bluesPiano, bass: bluesBass },
|
||||||
},
|
},
|
||||||
rock: {
|
rock: {
|
||||||
meta: rockMeta,
|
meta: rockMeta,
|
||||||
@@ -70,16 +76,16 @@ export default {
|
|||||||
rnb: {
|
rnb: {
|
||||||
meta: rnbMeta,
|
meta: rnbMeta,
|
||||||
progressions: rnbProgressions,
|
progressions: rnbProgressions,
|
||||||
instruments: { guitar: rnbGuitar },
|
instruments: { guitar: rnbGuitar, piano: rnbPiano },
|
||||||
},
|
},
|
||||||
gospel: {
|
gospel: {
|
||||||
meta: gospelMeta,
|
meta: gospelMeta,
|
||||||
progressions: gospelProgressions,
|
progressions: gospelProgressions,
|
||||||
instruments: { guitar: gospelGuitar },
|
instruments: { guitar: gospelGuitar, piano: gospelPiano },
|
||||||
},
|
},
|
||||||
pop: {
|
pop: {
|
||||||
meta: popMeta,
|
meta: popMeta,
|
||||||
progressions: popProgressions,
|
progressions: popProgressions,
|
||||||
instruments: { guitar: popGuitar },
|
instruments: { guitar: popGuitar, piano: popPiano },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,6 +146,54 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'jazz-tritone-sub': [
|
||||||
|
{
|
||||||
|
label: 'Shells down one string (chromatic slide)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: SHELL_5.min7, note: 'ii7 — root on the A string' },
|
||||||
|
{ shape: SHELL_5.dom7, note: '♭II7 — two fingers drop a fret; the guide-tone finger stays put' },
|
||||||
|
{ shape: SHELL_5.maj7, note: 'Imaj7 — one more fret down: home' },
|
||||||
|
],
|
||||||
|
tips: 'The tritone sub turns the ii–V–I bass into a one-string chromatic slide: 2 → ♭2 → 1, one fret per chord. It works because ♭II7 and V7 share their guide tones — the 3rd and ♭7 swap names (in C: Db7 has F and B, exactly G7\'s B and F). Target the ♭II7\'s 3rd when soloing; it is the old V7\'s ♭7.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Drop-2 slide, top four strings',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: DROP2.min7Root, note: 'ii7 — root position, root on the D string' },
|
||||||
|
{ shape: DROP2.dom7Root, note: '♭II7 — same architecture, one fret down' },
|
||||||
|
{ shape: DROP2.maj7Root, note: 'Imaj7 — one more fret down: three voices fall a half step, one holds' },
|
||||||
|
],
|
||||||
|
tips: 'The upper-register version: three root-position drop-2 grips, roots falling a fret at a time. Each change is three voices dropping a half step around one common tone — the ii7\'s ♭3 is held to become the ♭II7\'s 3rd, then the ♭II7\'s ♭7 is held to become the Imaj7\'s 7. High and thin, it stays out of the piano\'s way, and the top string sings the guide-tone line: held into the ♭II7, falling a half step into home.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'jazz-rhythm-bridge': [
|
||||||
|
{
|
||||||
|
label: 'Shells around the circle',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: SHELL_6.dom7, note: 'III7 — V7 of vi, the first domino' },
|
||||||
|
{ shape: SHELL_5.dom7, note: 'VI7 — root string up, nearly the same fret' },
|
||||||
|
{ shape: SHELL_6.dom7, note: 'II7 — the pattern repeats a whole step down' },
|
||||||
|
{ shape: SHELL_5.dom7, note: 'V7 — hands you back the A section' },
|
||||||
|
],
|
||||||
|
tips: 'One grip pair, four chords: roots falling in fifths alternate 6th → 5th string at almost the same fret, so the whole bridge sits in one position. Each chord is the V of the next — comp two bars each and voice-lead the ♭7 falling a half step onto the next chord\'s 3rd.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Drop-2, alternating inversions (top four strings)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: DROP2.dom7Inv2, note: 'III7 — 3rd in the bass voice' },
|
||||||
|
{ shape: DROP2.dom7Root, note: 'VI7 — nearest root-position grip' },
|
||||||
|
{ shape: DROP2.dom7Inv2, note: 'II7 — back to the inversion' },
|
||||||
|
{ shape: DROP2.dom7Root, note: 'V7 — root position into the turnaround' },
|
||||||
|
],
|
||||||
|
tips: 'Alternating the 3rd-in-the-bass grip with root-position drop-2 keeps every change a short hop — root-position-only would force five-fret jumps around this circle. Two bars per chord is room to decorate: restrike on the Charleston, or walk the top voice.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
'jazz-blues': [
|
'jazz-blues': [
|
||||||
{
|
{
|
||||||
label: 'Shells through the form',
|
label: 'Shells through the form',
|
||||||
@@ -213,4 +261,90 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Structured licks (SCHEMA.md "Licks", task P-21). Written over a ii–V–I in C
|
||||||
|
// (Dm7–G7–Cmaj7) but key-agnostic in spirit — chordContext names the station.
|
||||||
|
// Every pitch hand-verified: s6=E s5=A s4=D s3=G s2=B s1=e (+fret, mod 12).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// In D dorian: D E F G E C D — degrees 1 2 ♭3 4 2 ♭7 1 of the ii7.
|
||||||
|
id: 'jazz-the-lick',
|
||||||
|
name: 'The Lick',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the ii7',
|
||||||
|
techniques: ['vibrato'],
|
||||||
|
source: 'the most famous ii-chord cliché in jazz — Wikipedia "The Lick"; Alex Heitlinger\'s 2011 supercut',
|
||||||
|
tab: [
|
||||||
|
{ string: 5, fret: 5 }, // D — 1
|
||||||
|
{ string: 4, fret: 2 }, // E — 2
|
||||||
|
{ string: 4, fret: 3 }, // F — ♭3
|
||||||
|
{ string: 4, fret: 5 }, // G — 4
|
||||||
|
{ string: 4, fret: 2 }, // E — 2
|
||||||
|
{ string: 5, fret: 3 }, // C — ♭7
|
||||||
|
{ string: 5, fret: 5, technique: 'vibrato' }, // D — home
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In C: Dm7 arpeggio (D F A C), G7 guide tones (B F), then the bebop
|
||||||
|
// enclosure F–D♯–E — above diatonically, below chromatically — onto the
|
||||||
|
// Imaj7's 3rd on the downbeat.
|
||||||
|
id: 'jazz-enclosure-251',
|
||||||
|
name: 'ii–V–I enclosure into the 3rd',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'ii7 → V7 → Imaj7',
|
||||||
|
techniques: ['chromatic-approach', 'vibrato'],
|
||||||
|
source: 'in the style of bebop enclosure exercises — David Baker, How to Play Bebop Vol. 1; jazzguitar.be enclosure lessons',
|
||||||
|
tab: [
|
||||||
|
{ string: 5, fret: 5 }, // D — ii7 root
|
||||||
|
{ string: 4, fret: 3 }, // F — ♭3
|
||||||
|
{ string: 3, fret: 2 }, // A — 5
|
||||||
|
{ string: 3, fret: 5 }, // C — ♭7
|
||||||
|
{ string: 3, fret: 4 }, // B — the V7's 3rd, right at the change
|
||||||
|
{ string: 2, fret: 6 }, // F — the V7's ♭7 (upper neighbour of the target)
|
||||||
|
{ string: 2, fret: 4, technique: 'chromatic-approach' }, // D♯ — chromatic from below
|
||||||
|
{ string: 2, fret: 5, technique: 'vibrato' }, // E — the Imaj7's 3rd: enclosed and landed
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Descending G bebop dominant from the root: G F♯ F E D C B A G —
|
||||||
|
// Mixolydian plus the chromatic passing 7 so chord tones fall on strong
|
||||||
|
// beats in straight eighths.
|
||||||
|
id: 'jazz-bebop-dom-descent',
|
||||||
|
name: 'Bebop dominant descent',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'dom7 — e.g. the V7',
|
||||||
|
techniques: ['chromatic-approach', 'vibrato'],
|
||||||
|
source: 'the bebop dominant scale — David Baker, How to Play Bebop Vol. 1',
|
||||||
|
tab: [
|
||||||
|
{ string: 1, fret: 3 }, // G — root
|
||||||
|
{ string: 1, fret: 2, technique: 'chromatic-approach' }, // F♯ — the added passing tone
|
||||||
|
{ string: 1, fret: 1 }, // F — ♭7
|
||||||
|
{ string: 1, fret: 0 }, // E — 13
|
||||||
|
{ string: 2, fret: 3 }, // D — 5
|
||||||
|
{ string: 2, fret: 1 }, // C — passing 11
|
||||||
|
{ string: 3, fret: 4 }, // B — 3
|
||||||
|
{ string: 3, fret: 2 }, // A — 9
|
||||||
|
{ string: 4, fret: 5, technique: 'vibrato' }, // G — root, an octave down
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In C, as dyads: Dm7's ♭3+♭7 (F+C) → the ♭7 falls a half step to the
|
||||||
|
// V7's 3rd (B, F holds) → the held F falls a half step to the Imaj7's
|
||||||
|
// 3rd (E, B holds as the 7). The 7→3 rails, played literally.
|
||||||
|
id: 'jazz-guide-tone-rail',
|
||||||
|
name: 'Guide-tone rail (7 falls to 3)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'ii7 → V7 → Imaj7 guide tones',
|
||||||
|
techniques: ['double-stop', 'slide'],
|
||||||
|
source: 'guide-tone comping lines — jazzguitar.be guide-tone lessons; Jens Larsen voice-leading studies',
|
||||||
|
tab: [
|
||||||
|
{ string: 2, fret: 6 }, // F — the ii7's ♭3
|
||||||
|
{ string: 3, fret: 5, technique: 'double-stop' }, // C — the ii7's ♭7 (dyad)
|
||||||
|
{ string: 3, fret: 4, technique: 'slide' }, // B — C falls a half step: the V7's 3rd
|
||||||
|
{ string: 2, fret: 6, technique: 'double-stop' }, // F — held, renamed the V7's ♭7
|
||||||
|
{ string: 2, fret: 5, technique: 'slide' }, // E — F falls a half step: the Imaj7's 3rd
|
||||||
|
{ string: 3, fret: 4, technique: 'double-stop' }, // B — held, now the Imaj7's 7
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,351 @@
|
|||||||
|
// Jazz piano pack — first authored piano cell (task P-22). Recipes verified by
|
||||||
|
// degree-spelling against CHORD_TYPES (src/lib/theory.js) and SCHEMA.md's
|
||||||
|
// resolveDegree contract. Voicings sourced from: Mark Levine, The Jazz Piano
|
||||||
|
// Book (three-note "Bud Powell" shells; rootless left-hand voicings; altered
|
||||||
|
// dominants in minor); learnjazzstandards.com "Left-Hand Piano Voicings for
|
||||||
|
// ii-V7-Is" (the middle-C position set F-A-C-E / F-A-B-E / E-G-B-D);
|
||||||
|
// piano.org "Rootless Voicings: Type A and Type B (Bill Evans Style)"
|
||||||
|
// (A = 3rd on the bottom 3-5-7-9, B = 7th on the bottom 7-9-3-5, dominants
|
||||||
|
// swap the 5 for the 13); pianogroove.com (minor ii-V-i, ø11 colour);
|
||||||
|
// jazz-library.com/articles/comping (Charleston; Red Garland offbeats).
|
||||||
|
// Pedagogy frame: docs/learn-curriculum.md — Piano pillar (shells → rootless,
|
||||||
|
// register discipline, "rule of 1").
|
||||||
|
|
||||||
|
// Reusable degree recipes. Order inside each hand = voicing order, low → high.
|
||||||
|
const SHELL_R7 = { LH: ['1', '7'] } // Bud Powell shell: root + 7th
|
||||||
|
const SHELL_R3 = { LH: ['1', '3'] } // Bud Powell shell: root + 3rd
|
||||||
|
const A_FORM = { LH: ['3', '5', '7', '9'] } // rootless Type A (3rd on bottom)
|
||||||
|
const B_FORM = { LH: ['7', '9', '3', '5'] } // rootless Type B (7th on bottom)
|
||||||
|
const A_FORM_DOM = { LH: ['3', '13', '7', '9'] } // dominant Type A: 5 → 13
|
||||||
|
const B_FORM_DOM = { LH: ['7', '9', '3', '13'] } // dominant Type B: 5 → 13
|
||||||
|
|
||||||
|
export default {
|
||||||
|
styleIntro:
|
||||||
|
'In a jazz rhythm section the piano is a commentator, not a metronome: short voicings placed around the soloist, roots left to the bassist, colour tones (9ths, 13ths) doing the talking. Left hand learns two grips per chord — a shell and a rootless voicing — and the music comes from where you place them in time.',
|
||||||
|
|
||||||
|
comping: [
|
||||||
|
{
|
||||||
|
label: 'Charleston',
|
||||||
|
rhythm: '♩. + "and of 2"',
|
||||||
|
description: 'Chord on beat 1 (held) plus a stab on the and-of-2 — the foundational syncopated comping cell. Displace it around the bar once it is automatic; comping failure in jams is usually rhythmic, not harmonic.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Red Garland offbeats',
|
||||||
|
rhythm: '"and of 2" + "and of 4"',
|
||||||
|
description: 'Both hits off the beat — the Miles Davis quintet sound. The bassist and drummer own the downbeats; you answer them. Keep the voicings short and identical so only the rhythm speaks.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'The push (anticipated and-of-4)',
|
||||||
|
rhythm: 'tied from "and of 4"',
|
||||||
|
description: 'Strike the next bar\'s chord an eighth note early and hold it over the barline. Telegraphs the change to the whole band — use it going into bar 1 of the form.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
plays: {
|
||||||
|
'jazz-251-major': [
|
||||||
|
{
|
||||||
|
label: 'Bud Powell shells (LH 1–7 / 1–3)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: SHELL_R7, note: 'root + ♭7 — the lightest possible ii chord' },
|
||||||
|
{ recipe: SHELL_R3, note: 'the ii\'s ♭7 just fell a half-step to become this 3rd' },
|
||||||
|
{ recipe: SHELL_R7, note: 'the V\'s 3rd holds over as the maj7 — one finger stays put' },
|
||||||
|
],
|
||||||
|
register: 'LH around C3; keep the right hand free for melody or answers',
|
||||||
|
tips: 'Alternating 1–7 and 1–3 shells is the whole voice-leading engine: the top note either holds or falls a half-step, never jumps. Two notes is not "beginner" — it is what Bud Powell played behind Charlie Parker. In a duo the root matters; once a bassist arrives, graduate to the rootless play below.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless A–B–A (Bill Evans left hand)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: A_FORM, note: 'Type A: ♭3–5–♭7–9, 3rd on the bottom' },
|
||||||
|
{ recipe: B_FORM_DOM, note: 'Type B: ♭7–9–3–13 — only one finger moves from the ii' },
|
||||||
|
{ recipe: A_FORM, note: 'back to Type A: 3–5–7–9, a maj9 sound' },
|
||||||
|
],
|
||||||
|
register: 'top note between C4 and C5; the bassist owns everything below G3',
|
||||||
|
tips: 'A on the ii, B on the V, A on the I: alternate the two types and the hand barely moves — that is the entire point of the system. No roots anywhere: that is the bassist\'s lane, and doubling it muddies the band. Practise the pair in all 12 keys around the circle of fifths.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'jazz-251-minor': [
|
||||||
|
{
|
||||||
|
label: 'Shells with the colour on top',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: ['1', '7'], RH: ['3', '5'] }, note: 'RH ♭3 + ♭5 — the ø colour; don\'t skip the ♭5' },
|
||||||
|
{ recipe: { LH: ['1', '7'], RH: ['3', 'b9'] }, note: 'the ♭9 is the same key the iiø7\'s ♭5 just was — hold it' },
|
||||||
|
{ recipe: { LH: ['1', '7'], RH: ['3', '5'] }, note: 'home — resolve and get light' },
|
||||||
|
],
|
||||||
|
register: 'LH shells around C3, RH colour tones just above middle C',
|
||||||
|
tips: 'Hand-role splitting in miniature: LH anchors root + 7th, RH carries the two notes that make the minor ii–V dark. The physical lesson is the shared key: the iiø7\'s ♭5 and the V7\'s ♭9 are the same pitch reinterpreted — find it once and keep the finger there through both chords.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless with the altered V',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: ['3', '5', '7', '11'] }, note: '♭3–♭5–♭7–11 — the 11 is the classic colour on ø chords' },
|
||||||
|
{ recipe: { LH: ['7', 'b9', '3', 'b13'] }, note: '♭7–♭9–3–♭13: the altered dominant that minor keys demand' },
|
||||||
|
{ recipe: A_FORM, note: '♭3–5–♭7–9 — a m9 sound; resolved but still coloured' },
|
||||||
|
],
|
||||||
|
register: 'top note between C4 and C5',
|
||||||
|
tips: 'Same A/B logic as the major ii–V–I, darker fuel: the V7 swaps its 9 and 13 for ♭9 and ♭13 (both live in the key\'s harmonic minor). If the four-note ø voicing feels crunchy, drop the 11 and play the three-note core ♭3–♭5–♭7 — the shells play above is the easier road into this one.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'jazz-rhythm-a': [
|
||||||
|
{
|
||||||
|
label: 'Shells on the Charleston',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: SHELL_R7, note: 'maj7 shell — root + 7' },
|
||||||
|
{ recipe: SHELL_R3, note: 'the I\'s 7th steps up a half-step to the vi\'s ♭3' },
|
||||||
|
{ recipe: SHELL_R7, note: 'the vi\'s ♭3 holds over as the ii\'s ♭7 — same key' },
|
||||||
|
{ recipe: SHELL_R3, note: 'falls a half-step onto the V\'s 3rd, which leads back to bar 1' },
|
||||||
|
],
|
||||||
|
register: 'LH around C3; Charleston rhythm, one cell per bar',
|
||||||
|
tips: 'One chord per bar at rhythm-changes tempo — the two-note grips are the only ones that keep up. Learn the top-voice thread as a loop: hold, half-step, hold, half-step, forever. Rhythm first: put the metronome on 2 and 4 and drill the Charleston until the hands stop negotiating.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless turnaround in one hand position',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: A_FORM, note: 'Type A on the I' },
|
||||||
|
{ recipe: B_FORM, note: 'Type B on the vi — two fingers move, two hold' },
|
||||||
|
{ recipe: A_FORM, note: 'Type A on the ii' },
|
||||||
|
{ recipe: B_FORM_DOM, note: 'Type B on the V — one finger moves; bar 4 feeds bar 1' },
|
||||||
|
],
|
||||||
|
register: 'top note between C4 and C5',
|
||||||
|
tips: 'A–B–A–B around the loop keeps most changes to a finger or two — two keys hold into the vi and again into the ii, and only the seam back into bar 1 re-sets three fingers, each by a whole step or less. This is the "rule of 1" made physical: in a five-piece band you supply one fifth of the music, and identical small voicings placed on Red Garland offbeats are exactly that fifth.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'jazz-625': [
|
||||||
|
{
|
||||||
|
label: 'Shells falling in fifths',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: SHELL_R7, note: 'vi — root + ♭7' },
|
||||||
|
{ recipe: SHELL_R3, note: 'the vi\'s ♭7 falls a whole step onto the ii\'s ♭3' },
|
||||||
|
{ recipe: SHELL_R7, note: 'ii\'s ♭3 holds over as the V\'s ♭7' },
|
||||||
|
{ recipe: SHELL_R3, note: 'half-step fall onto the I\'s 3rd — journey over' },
|
||||||
|
],
|
||||||
|
register: 'LH around C3',
|
||||||
|
tips: 'Pure circle-of-fifths motion: alternating 1–7 / 1–3 shells was built for exactly this — every root falls a fifth while the top voice walks down by step. Sing the top voice while you play; if you can hear this two-note line, you can predict half the jazz repertoire.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless B–A–B–A circle',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: B_FORM, note: 'Type B on the vi — ♭7 on the bottom' },
|
||||||
|
{ recipe: A_FORM, note: 'Type A on the ii — two voices fall a step, two hold' },
|
||||||
|
{ recipe: B_FORM_DOM, note: 'Type B on the V — a single half-step move' },
|
||||||
|
{ recipe: A_FORM, note: 'Type A on the I — maj9 landing' },
|
||||||
|
],
|
||||||
|
register: 'top note between C4 and C5',
|
||||||
|
tips: 'Starting on the B form instead of A puts the whole circle a fourth away — same alternation, different lane. Learn both start positions so you can pick whichever keeps the top note between C4 and C5 in the key of the night; that window sits above the bass and below the soloist.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'jazz-blues': [
|
||||||
|
{
|
||||||
|
label: 'Shells through the form',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: SHELL_R7, note: 'I7 — root + ♭7' },
|
||||||
|
{ recipe: SHELL_R3, note: 'IV7 — the I\'s ♭7 falls a half-step to this 3rd' },
|
||||||
|
{ recipe: SHELL_R7, note: 'back home' },
|
||||||
|
{ recipe: SHELL_R7, note: 'hold — or restrike on the and-of-2' },
|
||||||
|
{ recipe: SHELL_R3, note: 'IV7 again — same half-step fall' },
|
||||||
|
{ recipe: SHELL_R3, note: 'sit on it' },
|
||||||
|
{ recipe: SHELL_R7, note: 'home' },
|
||||||
|
{ recipe: SHELL_R3, note: 'VI7 — the jazz move; hear bar 8 coming' },
|
||||||
|
{ recipe: SHELL_R7, note: 'ii7 of the turnaround' },
|
||||||
|
{ recipe: SHELL_R3, note: 'V7 — the ii\'s ♭7 falls a half-step onto this 3rd' },
|
||||||
|
{ recipe: SHELL_R7, note: 'home' },
|
||||||
|
{ recipe: SHELL_R3, note: 'V7 pickup into the next chorus' },
|
||||||
|
],
|
||||||
|
register: 'LH around C3; RH free for blues fills between phrases',
|
||||||
|
tips: 'Most of the form runs on one alternation: 1–7 on the I, 1–3 on the chord it falls into — those tops arrive by half-step. Bar 8\'s VI7 is the one real reach in the chorus; aim for it early. Fill with the right hand only in the gaps the soloist leaves (rule of 1).',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless blues (Wynton Kelly lane)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: A_FORM_DOM, note: 'Type A dominant: 3–13–♭7–9' },
|
||||||
|
{ recipe: B_FORM_DOM, note: 'Type B on the IV7 — two fingers slide, two hold' },
|
||||||
|
{ recipe: A_FORM_DOM, note: '' },
|
||||||
|
{ recipe: A_FORM_DOM, note: 'thin it to just 3 + ♭7 if the band is loud' },
|
||||||
|
{ recipe: B_FORM_DOM, note: '' },
|
||||||
|
{ recipe: B_FORM_DOM, note: '' },
|
||||||
|
{ recipe: A_FORM_DOM, note: '' },
|
||||||
|
{ recipe: { LH: ['3', '7', 'b9'] }, note: 'VI7♭9 — the V-of-ii sound; the ♭9 pulls into the next bar' },
|
||||||
|
{ recipe: A_FORM, note: 'ii7 — Type A minor' },
|
||||||
|
{ recipe: B_FORM_DOM, note: 'V7 — Type B, one finger from the ii' },
|
||||||
|
{ recipe: A_FORM_DOM, note: 'home' },
|
||||||
|
{ recipe: B_FORM_DOM, note: 'V7 — hands you the next chorus' },
|
||||||
|
],
|
||||||
|
register: 'top note between C4 and C5; comp Red Garland offbeats',
|
||||||
|
tips: 'Dominant rootless voicings carry two colour tones each (9 and 13) — that is why a jazz blues sounds like a suit, not overalls. Between I7 and IV7 the A/B alternation trades like this: two keys hold while swapping names, one voice slips a half-step (the 3↔♭7 trade), and one finger hops a minor third. Bar 8\'s ♭9 is the one dark note in the form: let it ring into the ii.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'jazz-tritone-sub': [
|
||||||
|
{
|
||||||
|
label: 'Guide tones over the chromatic bass',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: ['1'], RH: ['3', '7'] }, note: 'ii7 — bass on 2, guide tones ♭3 + ♭7 on top' },
|
||||||
|
{ recipe: { LH: ['1'], RH: ['3', '7'] }, note: '♭II7 — bass slides to ♭2; the ii\'s ♭3 holds as this 3rd' },
|
||||||
|
{ recipe: { LH: ['1'], RH: ['3', '7'] }, note: 'Imaj7 — bass lands on 1; the ♭II7\'s ♭7 holds as this 7' },
|
||||||
|
],
|
||||||
|
register: 'LH single bass notes around C3, RH guide tones just above middle C',
|
||||||
|
tips: 'The sub turns the bass line into a chromatic slide — 2, ♭2, 1 — while the right hand proves *why* it works: at every change one guide tone holds and the other falls a half-step, because ♭II7 and V7 share the same tritone (the 3rd and ♭7 simply trade names). Play it slow and listen for the two threads.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless: the ♭II7 is a free altered V7',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: A_FORM, note: 'ii7 — Type A' },
|
||||||
|
{ recipe: A_FORM_DOM, note: '♭II7 Type A — read from the old V7\'s root, this exact hand spells ♭7–♯9–3–♭13: a V7alt for free' },
|
||||||
|
{ recipe: A_FORM, note: 'Imaj7 — Type A; the ♭II7\'s ♭7 holds over as your maj7' },
|
||||||
|
],
|
||||||
|
register: 'top note between C4 and C5',
|
||||||
|
tips: 'This is the deepest lesson in the substitution: a plain 9/13 rootless voicing on the ♭II7 contains, note for note, the altered voicing of the V7 it replaced — ♭9s and ♭13s appear without you learning a single new grip. Into the ♭II7 every voice holds or moves a half-step — that slide is the sub\'s whole sales pitch. Coming home, three voices resolve the same way while one finger (the sub\'s 13) drops a third onto the I\'s 5th.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'jazz-rhythm-bridge': [
|
||||||
|
{
|
||||||
|
label: 'Shells around the circle of dominants',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: SHELL_R7, note: 'III7 — the first domino; two bars to sit on it' },
|
||||||
|
{ recipe: SHELL_R3, note: 'VI7 — the III7\'s ♭7 fell a half-step onto this 3rd' },
|
||||||
|
{ recipe: SHELL_R7, note: 'II7 — the pattern repeats a whole step down' },
|
||||||
|
{ recipe: SHELL_R3, note: 'V7 — one more half-step fall, then the A section' },
|
||||||
|
],
|
||||||
|
register: 'LH around C3; two bars per chord — leave space',
|
||||||
|
tips: 'Each chord is the V of the next, so the same two-grip alternation from the ii–V–I walks the whole bridge: ♭7 falls a half-step onto the next 3rd, four times in a row. That chromatic thread in your top voice is also the soloist\'s map — comp it clearly and you are conducting.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless dominants, alternating types',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: A_FORM_DOM, note: 'III7 — Type A: 3–13–♭7–9' },
|
||||||
|
{ recipe: B_FORM_DOM, note: 'VI7 — Type B: two keys hold, the old 3rd falls a half-step, the old ♭7 drops a third onto the 9' },
|
||||||
|
{ recipe: A_FORM_DOM, note: 'II7 — back to Type A' },
|
||||||
|
{ recipe: B_FORM_DOM, note: 'V7 — Type B hands you the A section' },
|
||||||
|
],
|
||||||
|
register: 'top note between C4 and C5',
|
||||||
|
tips: 'Around a circle of dominants the A/B alternation keeps each step compact: at least one key holds, the old 3rd falls a half-step onto the new ♭7, and nothing moves more than a minor third. Two bars per chord is room to decorate — restrike the same voicing on the Charleston, or walk the top finger up to the 13 and back rather than reaching for a new chord.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
improv: {
|
||||||
|
scales: [
|
||||||
|
{ over: 'ii7', scale: 'dorian', why: 'Minor 7 chords in a major key take Dorian — the natural 6 keeps it from sounding sad. On piano it is the parent major scale started from 2: no new fingering.' },
|
||||||
|
{ over: 'V7', scale: 'mixolydian', why: 'The ♭7 is built in. In minor keys use Phrygian dominant (harmonic minor from the V) — it hands you the ♭9 and ♭13 your left hand is already voicing.' },
|
||||||
|
{ over: 'Imaj7', scale: 'major', why: 'Plain major works; avoid sitting on the 4th over the maj7 — it rubs against the 3rd a half-step below.' },
|
||||||
|
{ over: 'I7 (blues)', scale: 'mixolydian', why: 'Mixolydian for the changes, blues scale for the attitude — mix them phrase by phrase, not note by note.' },
|
||||||
|
{ over: 'iiø7', scale: 'locrian', why: 'Target the ♭3 or ♭5; the ♭5 becomes the ♭9 of the next V7 — the same pivot key your comping hand holds.' },
|
||||||
|
],
|
||||||
|
targetNotes:
|
||||||
|
'Land the 3rd of each chord on the downbeat of the change — your left hand is already holding it, so the ear-check is built in. In any ii–V–I the 7th of one chord falls a half-step to the 3rd of the next; play that two-note rail as a whole-note chorus before you play eighth notes.',
|
||||||
|
},
|
||||||
|
|
||||||
|
// Structured piano licks (SCHEMA.md "Piano licks", task P-60). Degree-based
|
||||||
|
// and key-agnostic: every deg resolves through the stated quality, approach
|
||||||
|
// pitches are derived from the next deg note. Realized offsets in the
|
||||||
|
// comments use a C-rooted chord for readability; every interval claim in
|
||||||
|
// notes/tips was recomputed from those offsets before writing (P-41 bar).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// Over Cm7: C5 B♭4 G4 (E4) (D4) E♭4 — offsets 12 10 7 [4] [2] 3. The
|
||||||
|
// approaches derive from the ♭3 target: above = 4 (the major 3rd, the
|
||||||
|
// outside note), below = 2 (the 9). Triplet pickup into beat 3.
|
||||||
|
id: 'jazz-enclosure-b3',
|
||||||
|
name: 'Enclosure into the ♭3',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the ii7',
|
||||||
|
quality: 'min7',
|
||||||
|
techniques: [],
|
||||||
|
source: 'the bebop enclosure — Barry Harris workshop vocabulary; David Baker, How to Play Bebop Vol. 1',
|
||||||
|
notes: [
|
||||||
|
{ deg: '1', octave: 1, beat: 1 },
|
||||||
|
{ deg: '7', beat: 1.5 },
|
||||||
|
{ deg: '5', beat: 2 },
|
||||||
|
{ approach: 'chrom-above', beat: 2.33 },
|
||||||
|
{ approach: 'chrom-below', beat: 2.67 },
|
||||||
|
{ deg: '3', beat: 3 },
|
||||||
|
],
|
||||||
|
tips: 'The line falls down the chord — octave root, ♭7, 5th — then the enclosure frames the ♭3 from a half-step either side: the upper neighbour is the major 3rd (deliberately outside on a minor chord), the lower is the 9. Land the target on a strong beat; the two "wrong" notes are what make the right one land.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over C7: E4 G4 B♭4 D♭5 C5 — offsets 4 7 10 13 12: stacked minor
|
||||||
|
// thirds 4→7→10→13 (the dim7 arpeggio off the 3rd), then the ♭9
|
||||||
|
// falling a half-step onto the octave root.
|
||||||
|
id: 'jazz-dim-flip-v7',
|
||||||
|
name: '3–♭9 arpeggio over the V7',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the V7, resolving to the I',
|
||||||
|
quality: 'dom7',
|
||||||
|
techniques: [],
|
||||||
|
source: 'the 3–5–♭7–♭9 diminished arpeggio — David Baker, How to Play Bebop Vol. 1',
|
||||||
|
notes: [
|
||||||
|
{ deg: '3', beat: 1 },
|
||||||
|
{ deg: '5', beat: 1.5 },
|
||||||
|
{ deg: '7', beat: 2 },
|
||||||
|
{ deg: 'b9', octave: 1, beat: 2.5 },
|
||||||
|
{ deg: '1', octave: 1, beat: 3 },
|
||||||
|
],
|
||||||
|
tips: 'From the 3rd it is minor thirds all the way up — 3, 5, ♭7, ♭9 spell the diminished seventh chord that lives inside every dominant — and the ♭9 sighs a half-step back onto the octave root. When the chord changes, that landing note is renamed the I\'s 5th, so the lick resolves itself.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over Cmaj7: C4 (E♭4) E4 G4 B4 D5 C5 — offsets 0 [3] 4 7 11 14 12.
|
||||||
|
// The chromatic slip derives from the 3rd (4−1=3); thirds 4→7→11→14;
|
||||||
|
// the 9 settles a whole step onto the octave root.
|
||||||
|
id: 'jazz-powell-ascent',
|
||||||
|
name: 'Powell ascent to the 9th',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the Imaj7',
|
||||||
|
quality: 'maj7',
|
||||||
|
techniques: [],
|
||||||
|
source: 'in the style of Bud Powell\'s right-hand arpeggio runs — Mark Levine, The Jazz Piano Book',
|
||||||
|
notes: [
|
||||||
|
{ deg: '1', beat: 1 },
|
||||||
|
{ approach: 'chrom-below', beat: 1.5 },
|
||||||
|
{ deg: '3', beat: 2 },
|
||||||
|
{ deg: '5', beat: 2.5 },
|
||||||
|
{ deg: '7', beat: 3 },
|
||||||
|
{ deg: '9', octave: 1, beat: 3.5 },
|
||||||
|
{ deg: '1', octave: 1, beat: 4 },
|
||||||
|
],
|
||||||
|
tips: 'One chromatic slip between the root and the 3rd, then nothing but thirds: 3–5–7–9 climbs the chord to the colour tone before the 9 relaxes a whole step onto the octave root. Arpeggiate to the 9th, not the root — the top of the line is where the chord gets its shine.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over C7, dyads low+high struck together: B♭4+D5 → A4+C5 → G4+B♭4 →
|
||||||
|
// E4+G4 — offsets (10,14)(9,12)(7,10)(4,7). Every pair is a third
|
||||||
|
// (4,3,3,3 semitones); top voice 14→12→10→7, bottom 10→9→7→4; all
|
||||||
|
// eight notes diatonic to the dominant (Mixolydian) scale.
|
||||||
|
id: 'jazz-thirds-fall-dom',
|
||||||
|
name: 'Dominant thirds fall',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the V7, or any dominant bar of a jazz blues',
|
||||||
|
quality: 'dom7',
|
||||||
|
techniques: ['double-stop'],
|
||||||
|
source: 'the dominant scale in diatonic thirds — Barry Harris workshop vocabulary; placed like Red Garland\'s offbeat fills',
|
||||||
|
notes: [
|
||||||
|
{ deg: '7', beat: 1 },
|
||||||
|
{ deg: '9', octave: 1, beat: 1, technique: 'double-stop' },
|
||||||
|
{ deg: '13', beat: 1.5 },
|
||||||
|
{ deg: '1', octave: 1, beat: 1.5, technique: 'double-stop' },
|
||||||
|
{ deg: '5', beat: 2 },
|
||||||
|
{ deg: '7', beat: 2, technique: 'double-stop' },
|
||||||
|
{ deg: '3', beat: 2.5 },
|
||||||
|
{ deg: '5', beat: 2.5, technique: 'double-stop' },
|
||||||
|
],
|
||||||
|
tips: 'Four dyads, each one a third: the top voice walks 9–root–♭7–5 (two whole steps, then a skip) while the bottom answers ♭7–13–5–3 (a half-step, a whole step, then a skip), landing on the chord\'s 3rd-plus-5th. No finger travels more than a minor third between hits. Played short on the offbeats it is comping; let it ring on the beat and it is a fill — same four grips.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
// Level tags + the two intermediate progressions added by task P-20.
|
||||||
|
// Intermediate-entry theory verified against: musictheorymanual.com &
|
||||||
|
// learnjazzstandards.com (Girl from Ipanema tritone sub, ii–♭II7–I),
|
||||||
|
// pianogroove.com (Ipanema harmony/comping analysis), Wikipedia: Rhythm changes
|
||||||
|
// (bridge = III7–VI7–II7–V7 circle of dominants), docs/progression-repertoire.md §1.
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
id: 'jazz-251-major',
|
id: 'jazz-251-major',
|
||||||
@@ -9,6 +14,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['All The Things You Are', 'Tune Up — Miles Davis', 'Honeysuckle Rose'],
|
songs: ['All The Things You Are', 'Tune Up — Miles Davis', 'Honeysuckle Rose'],
|
||||||
tip: 'The 7th of each chord resolves down a half-step to the 3rd of the next — that two-note thread is the whole progression.',
|
tip: 'The 7th of each chord resolves down a half-step to the 3rd of the next — that two-note thread is the whole progression.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'jazz-251-minor',
|
id: 'jazz-251-minor',
|
||||||
@@ -20,6 +26,7 @@ export default [
|
|||||||
mode: 'minor',
|
mode: 'minor',
|
||||||
songs: ['Autumn Leaves (bridge)', 'Blue Bossa', 'Beautiful Love'],
|
songs: ['Autumn Leaves (bridge)', 'Blue Bossa', 'Beautiful Love'],
|
||||||
tip: 'Same engine as the major ii–V–I, darker fuel: the ♭5 of the iiø7 is the ♭9 colour waiting to happen on the V7.',
|
tip: 'Same engine as the major ii–V–I, darker fuel: the ♭5 of the iiø7 is the ♭9 colour waiting to happen on the V7.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'jazz-rhythm-a',
|
id: 'jazz-rhythm-a',
|
||||||
@@ -31,6 +38,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['I Got Rhythm — Gershwin', 'Oleo — Sonny Rollins', 'Blue Moon'],
|
songs: ['I Got Rhythm — Gershwin', 'Oleo — Sonny Rollins', 'Blue Moon'],
|
||||||
tip: 'A loop, not a line — bar 4 hands you straight back to bar 1. Learn it as one circular shape your hands repeat.',
|
tip: 'A loop, not a line — bar 4 hands you straight back to bar 1. Learn it as one circular shape your hands repeat.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'jazz-625',
|
id: 'jazz-625',
|
||||||
@@ -42,6 +50,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['Fly Me to the Moon', 'Autumn Leaves (A section, relative view)'],
|
songs: ['Fly Me to the Moon', 'Autumn Leaves (A section, relative view)'],
|
||||||
tip: 'Pure circle-of-fifths motion: every root falls a fifth. If you can hear this one, you can predict half the jazz repertoire.',
|
tip: 'Pure circle-of-fifths motion: every root falls a fifth. If you can hear this one, you can predict half the jazz repertoire.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'jazz-blues',
|
id: 'jazz-blues',
|
||||||
@@ -53,5 +62,30 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ["Billie's Bounce — Charlie Parker", "Now's the Time — Charlie Parker", 'Tenor Madness — Sonny Rollins'],
|
songs: ["Billie's Bounce — Charlie Parker", "Now's the Time — Charlie Parker", 'Tenor Madness — Sonny Rollins'],
|
||||||
tip: 'A 12-bar blues wearing a suit: bars 8-10 swap the plain V-IV for a VI7 → ii–V turnaround. Hear bar 8 coming and you sound like a jazz player.',
|
tip: 'A 12-bar blues wearing a suit: bars 8-10 swap the plain V-IV for a VI7 → ii–V turnaround. Hear bar 8 coming and you sound like a jazz player.',
|
||||||
|
level: 'foundation',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jazz-tritone-sub',
|
||||||
|
name: 'Tritone-sub cadence (ii–♭II7–I)',
|
||||||
|
rn: ['ii7', '♭II7', 'Imaj7'],
|
||||||
|
degrees: [2, 1, 0],
|
||||||
|
qualities: ['min7', 'dom7', 'maj7'],
|
||||||
|
bars: [1, 1, 2],
|
||||||
|
mode: 'major',
|
||||||
|
songs: ['The Girl from Ipanema — Jobim (ii–♭II7–I in the A section)', 'standard substitute for any V7 in any tune'],
|
||||||
|
tip: 'The ♭II7 replaces V7 because they share the same tritone — the 3rd and ♭7 simply trade names. What changes is the bass: 2–♭2–1, a chromatic slide instead of a fifth-fall. Your old ii–V line still works over it.',
|
||||||
|
level: 'intermediate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'jazz-rhythm-bridge',
|
||||||
|
name: 'Rhythm changes bridge (circle of dominants)',
|
||||||
|
rn: ['III7', 'VI7', 'II7', 'V7'],
|
||||||
|
degrees: [4, 9, 2, 7],
|
||||||
|
qualities: ['dom7', 'dom7', 'dom7', 'dom7'],
|
||||||
|
bars: [2, 2, 2, 2],
|
||||||
|
mode: 'major',
|
||||||
|
songs: ['I Got Rhythm — Gershwin (bridge)', 'Oleo — Sonny Rollins (bridge)', 'Anthropology — Parker/Gillespie (bridge)'],
|
||||||
|
tip: 'Four dominants, each the V of the next — the bridge leaves home and falls back in fifths until it hands you the A section. Follow the ♭7 of each chord dropping a half step onto the 3rd of the next; that chromatic thread is your solo map.',
|
||||||
|
level: 'intermediate',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,246 @@
|
|||||||
|
// Pop piano pack (task P-62). Recipes verified by degree-spelling against
|
||||||
|
// CHORD_TYPES (src/lib/theory.js) and the validator's stacking convention
|
||||||
|
// (order inside each hand = voicing order low → high, nearest strictly above —
|
||||||
|
// documented at jazz/piano.js header). Every voice-leading claim in notes/tips
|
||||||
|
// is pitch-class arithmetic, computed and checked against the realized
|
||||||
|
// voicings (key of C for the major loops, E minor for the minor loop) before
|
||||||
|
// writing. Max combined stack in this pack: 19 semitones (renders for all 12
|
||||||
|
// roots inside the 36-key MiniPiano window).
|
||||||
|
//
|
||||||
|
// Pop piano is deliberately NOT jazz: plain triads and inversions, sus4 pulls
|
||||||
|
// and one add9 shimmer where the songs themselves put it — no 7ths or 13ths
|
||||||
|
// bolted on. Patterns and treatments sourced from:
|
||||||
|
// pianote.com — "Someone Like You" tutorial (the broken bottom–middle–top–
|
||||||
|
// middle roll over A–E–F♯m–D, i.e. the axis) and "How To Make Your Left Hand
|
||||||
|
// Sound Awesome" / "3 Left Hand Piano Patterns" (the root–5th–octave "1–5–8"
|
||||||
|
// pop anchor); pianowithjonny.com — "Rock and Roll Piano Chords and
|
||||||
|
// Accompaniment" (the '50s triplet pump) and "Pop Piano Accompaniment:
|
||||||
|
// Popstinatos" (repeated-figure pop comping); 500songs.com episode 25 —
|
||||||
|
// "Earth Angel" (piano triplets as the doo-wop signature, on the record
|
||||||
|
// itself); en.wikipedia.org/wiki/Pachelbel's_Canon and /wiki/'50s_progression
|
||||||
|
// (the descending first-inversion bass stair; the ice-cream changes); and the
|
||||||
|
// records the progressions.js songs list names: Let It Be (quarter-note block
|
||||||
|
// chords), Graduation — Vitamin C (Canon changes as straight-8th piano pulse),
|
||||||
|
// Numb — Linkin Park (8th-note octave pulse), Royals — Lorde (sparse pads,
|
||||||
|
// the ♭VII shimmer). Pedagogy frame: docs/learn-curriculum.md — Piano pillar
|
||||||
|
// (register discipline; voice-leading as hand economy).
|
||||||
|
|
||||||
|
// Reusable degree recipes. Order inside each hand = voicing order, low → high.
|
||||||
|
const LH_R = ['1'] // single bass root
|
||||||
|
const LH_R5 = ['1', '5'] // root + fifth anchor
|
||||||
|
const LH_OCT = ['1', '1'] // pumping octaves (the rock-piano kick drum)
|
||||||
|
const LH_STACK = ['1', '5', '1'] // root–5th–octave: the pianote "1–5–8" pop anchor
|
||||||
|
const RH_ROOT = ['1', '3', '5'] // root-position triad
|
||||||
|
const RH_INV1 = ['3', '5', '1'] // first inversion (root on top)
|
||||||
|
const RH_INV2 = ['5', '1', '3'] // second inversion (3rd on top)
|
||||||
|
const RH_35 = ['3', '5'] // bare 3rd + 5th dyad
|
||||||
|
|
||||||
|
export default {
|
||||||
|
styleIntro:
|
||||||
|
'Pop piano is the whole arrangement in one instrument: the left hand plays the bass part (roots, fifths, octaves), the right hand stacks plain triads, and the rhythm — pillars, pulses, rolls, triplets — is what changes between songs, not the harmony. Voice-lead the inversions so the top note barely moves, and spend your one colour (a sus4 pull, an add9 shimmer) where the record spends it.',
|
||||||
|
|
||||||
|
comping: [
|
||||||
|
{
|
||||||
|
label: 'Quarter-note pillars',
|
||||||
|
rhythm: 'four even quarter-note chords per bar',
|
||||||
|
description:
|
||||||
|
'The Let It Be pulse: block the chord on every beat, straight and unhurried, and let the sustain pedal glue the changes. The steadiness is the point — the vocal supplies all the motion.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Driving eighths',
|
||||||
|
rhythm: 'straight 8ths, accents on 2 and 4',
|
||||||
|
description:
|
||||||
|
'Eight even strokes a bar, the piano as rhythm guitar. Verse quiet, chorus loud — in pop the dynamic jump IS the arrangement, so resist adding notes and add weight instead.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "'50s triplets",
|
||||||
|
rhythm: '12/8 — three strokes per beat',
|
||||||
|
description:
|
||||||
|
'Twelve even triplet chords a bar, the sound of every slow dance since Earth Angel. Keep them soft and metronomic; accent beats 2 and 4 and the whole band swings around you.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'The ballad roll',
|
||||||
|
rhythm: 'broken-chord 16ths: bottom–middle–top–middle',
|
||||||
|
description:
|
||||||
|
'Never block the chord — roll it, low to high to low, in an even stream (the Someone Like You engine). One dynamic swell per phrase, pedal through each change.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
plays: {
|
||||||
|
'pop-axis': [
|
||||||
|
{
|
||||||
|
label: 'The ballad roll (Someone Like You bed)',
|
||||||
|
level: 'foundation',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'anchor 1–5 low, roll the triad above: bottom–middle–top–middle in even 16ths' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'the I\'s 5th is this chord\'s root — the whole pattern just slides down a fourth' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'nothing carries over from the V — the total change is why the relative-minor drop lands' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'two names return: the vi\'s root and ♭3 are this chord\'s 3rd and 5th' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH roll around middle C',
|
||||||
|
tips: 'The piano-ballad axis is a texture, not a chord trick: keep the 16ths rolling (the literal Someone Like You verse figure) and let the pedal connect the bars. Know the loop\'s one seam with zero shared notes — V into vi — and lean into it; every other change hands you at least one common tone for free.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Let It Be pillars (voice-led quarters)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV1 }, note: 'first inversion — the key\'s home note on top' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV2 }, note: 'the G holds; the other two fall by step (top C→B a half-step, E→D a whole)' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV2 }, note: 'all three voices rise by step: D→E and G→A whole steps, B→C the half-step' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_ROOT }, note: 'two keys hold (A and C); one finger moves — E up a half-step to F' },
|
||||||
|
],
|
||||||
|
register: 'RH pillars around middle C, LH single roots an octave and more below',
|
||||||
|
tips: 'Four even quarters per bar — the Let It Be pulse — with inversions chosen so the top note only ever leaves the tonic for its neighbour a half-step below (C…B…C…C in the reference key). No right-hand finger moves more than a whole step anywhere in the loop, and the seam home is almost free: the top C holds while F and A fall by step onto E and G.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'pop-50s-doowop': [
|
||||||
|
{
|
||||||
|
label: 'Earth Angel triplets',
|
||||||
|
level: 'foundation',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'root-position triad over the 1–5 anchor — pump it in triplets' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'two names survive the wistful drop: the I\'s root and 3rd are this chord\'s ♭3 and 5th' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'two survive again: the vi\'s root and ♭3 become this chord\'s 3rd and 5th' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'nothing survives — the whole triad steps up a whole step in parallel: the turn home' },
|
||||||
|
],
|
||||||
|
register: 'LH around C3, RH triads just above middle C',
|
||||||
|
tips: 'Twelve even triplet strokes a bar — the doo-wop engine on the Earth Angel record itself. Root positions on purpose: the pump, not the voice leading, is the part. Play them soft and metronomic, accent 2 and 4, and give the singer the whole top of the keyboard.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Wedding-band walk (one-finger changes)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV2 }, note: 'second inversion — G–C–E, the 3rd on top' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_ROOT }, note: 'one finger: the bottom G rises a whole step to A; C and E hold, re-named from root+3rd to ♭3+5th' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV1 }, note: 'one finger again: E rises a half-step to F; A and C hold' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV1 }, note: 'the whole hand lifts a whole step — A→B, C→D, F→G' },
|
||||||
|
],
|
||||||
|
register: 'RH close position around middle C, LH roots below; sustained halves and wholes',
|
||||||
|
tips: 'The same four chords as the triplet play, reorganised so the first two changes cost exactly one finger each. The seam home is the lesson: the G stays under your hand (top of the V, bottom of the I) while B and D resolve up by step onto C and E. This is the slow-set reading; the triplets play is the dance-set one.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'pop-canon': [
|
||||||
|
{
|
||||||
|
label: 'The Pachelbel stair (first-inversion walk)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV1 }, note: 'root in the bass — the stair starts on 1' },
|
||||||
|
{ recipe: { LH: ['3'], RH: RH_INV2 }, note: 'LH plays the 3rd, not the root: the bass steps down a half-step onto the key\'s 7th; above, G holds while E→D and C→B fall by step' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV2 }, note: 'bass falls a whole step to 6; every right-hand voice rises by step (D→E, G→A, B→C)' },
|
||||||
|
{ recipe: { LH: ['3'], RH: RH_INV2 }, note: 'LH takes the ♭3: the bass stair falls another whole step onto the key\'s 5th; E holds while A→G and C→B fall' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV2 }, note: 'bass reaches 4, one more whole step down; all three voices rise (B→C and E→F by half-step, G→A by whole)' },
|
||||||
|
],
|
||||||
|
register: 'LH bass line around C3, RH close voicings just above middle C',
|
||||||
|
tips: 'The whole trick is two first inversions: put the V and iii over their own 3rds and the left hand walks 1–7–6–5–4 — a half-step then three whole steps, the "classical" stair under Memories and Don\'t Look Back in Anger. The right hand alternates fall, rise, fall, rise so no voice ever leaps; at the loop seam the C holds while F and A fall by step.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Graduation pulse (root-position eighths)',
|
||||||
|
level: 'foundation',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'straight-eighth root positions — the school-assembly reading' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'the bass drops a fourth; the right hand just re-plants the same grip' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'bass up a whole step' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'down a fourth again' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_ROOT }, note: 'up a half-step — then the loop falls a fourth home' },
|
||||||
|
],
|
||||||
|
register: 'both hands mid-low; eight even strokes a bar',
|
||||||
|
tips: 'Graduation (Friends Forever) plays the Canon changes exactly like this: every chord root position, eight even eighths, zero negotiation in the right hand. Let the left hand tell the story instead — down a fourth, up a step, down a fourth, up a half-step, and a fourth drop home. The stair play is what to graduate to once this grooves.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'pop-mixo-bVII': [
|
||||||
|
{
|
||||||
|
label: 'The tonic drone (pad voicings)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV1 }, note: 'the key\'s home note on top for the two tonic bars' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', '5', '9'] }, note: 'the top note refuses to move — over the ♭VII it becomes the 9, an add9 shimmer; the two voices under it each fall a whole step (E→D, G→F)' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_ROOT }, note: 'two keys stay down (the ♭VII\'s 5th is this root, its 9 this 5th); only the 3rd moves, leaping a fifth up onto the IV\'s 3rd' },
|
||||||
|
],
|
||||||
|
register: 'RH just above middle C; long sustains, pedal through each chord',
|
||||||
|
tips: 'One key — the key\'s tonic — is physically held down for the entire loop: root of the I, 9 of the ♭VII, 5th of the IV. That drone is the piano translation of the guitar pack\'s ringing open strings, and the 9 it creates on the ♭VII is honest pop colour (Royals hangs its verse on exactly this shimmer). At the seam home the tonic holds again while F and A fall by step onto E and G.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Stadium pulse with the sus pull',
|
||||||
|
level: 'foundation',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_STACK, RH: RH_35 }, note: 'root–5th–octave low, bare 3–5 above; across the two bars lift the 3rd a half-step to the 4th and drop it back — the sus4 pull' },
|
||||||
|
{ recipe: { LH: LH_STACK, RH: RH_35 }, note: 'the whole five-note stack slides down a whole step in parallel' },
|
||||||
|
{ recipe: { LH: LH_STACK, RH: RH_35 }, note: 'up a fifth (or feel it as down a fourth) — same grip, third station' },
|
||||||
|
],
|
||||||
|
register: 'LH stack from around C2, RH dyad just above middle C — big and low',
|
||||||
|
tips: 'The piano as rhythm guitar: the 1–5–8 left hand is the pop anchor pianote teaches, the two-finger right hand keeps the mid-range clear for the vocal, and dynamics — not new chords — make the chorus. The sus4 pull on the long I bar is the keys version of the guitar pack\'s hammer-on wiggle: 3rd up a half-step, back down, harmony never changes.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'pop-minor-loop': [
|
||||||
|
{
|
||||||
|
label: 'Dark pads (voice-led)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_ROOT }, note: 'root-position minor — state the lone i plainly' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV1 }, note: 'one finger: the i\'s 5th rises a half-step onto this root (on top); the other two hold, re-named as the ♭VI\'s 3rd and 5th' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_INV2 }, note: 'the ♭VI\'s 5th holds as this root; E→D a whole step, C→B a half-step (reference key E minor)' },
|
||||||
|
{ recipe: { LH: LH_R, RH: RH_ROOT }, note: 'the ♭III\'s 5th holds as this root; G→F♯ a half-step, B→A a whole step' },
|
||||||
|
],
|
||||||
|
register: 'RH around middle C, LH roots below; sustained wholes',
|
||||||
|
tips: 'Three of the four changes cost a finger or two; the seam home costs everything — the ♭VII and the i share no notes at all, so all three voices rise by step together (D→E and A→B whole steps, F♯→G the half-step). That full-hand climb is why the loop feels like it leans back into the minor i. Practise the seam alone until the climb is one gesture.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Octave drive (Numb pulse)',
|
||||||
|
level: 'foundation',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_35 }, note: 'left-hand octaves hammer the root; the right hand is just ♭3+5 — thin on purpose' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_35 }, note: 'same grip on the major: the dyad narrows by one key (♭3–5 is four semitones, 3–5 is three)' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_35 }, note: 'keep the eighths even; accent 2 and 4' },
|
||||||
|
{ recipe: { LH: LH_OCT, RH: RH_35 }, note: 'last bar — lean the crescendo into the climb back to the i' },
|
||||||
|
],
|
||||||
|
register: 'LH octaves around C2–C3, RH dyad mid-keyboard; straight eighths throughout',
|
||||||
|
tips: 'The rock-piano reading (Numb\'s pulse): octaves are the kick drum, the two-note right hand stays out of the vocal\'s way, and the chorus is a dynamic, not a chord. The one theory note worth keeping: the dyad is four semitones wide on the minor i and three on the majors — one key narrower every time the loop brightens.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
improv: {
|
||||||
|
scales: [
|
||||||
|
{
|
||||||
|
over: 'the major loops (axis, doo-wop, Canon)',
|
||||||
|
scale: 'major pentatonic',
|
||||||
|
why: 'Pop toplines are mostly pentatonic: five notes with no avoid tone over any chord in the loop. Add the full major scale for passing notes between phrases.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'vi (and the minor loop\'s i)',
|
||||||
|
scale: 'minor',
|
||||||
|
why: 'Natural minor of the vi is the same keys as the parent major — identical fingering, darker targets. Minor pentatonic when in doubt; every chord of the minor loop is diatonic to it.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'I–♭VII–IV',
|
||||||
|
scale: 'mixolydian',
|
||||||
|
why: 'The ♭VII is built from the key\'s ♭7, so Mixolydian covers the whole vamp with one scale — the same call the guitar pack makes.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'V (doo-wop, Canon)',
|
||||||
|
scale: 'major',
|
||||||
|
why: 'Stay in the parent major; land on the V\'s 3rd — the key\'s leading tone — when you want the turn home to bite.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetNotes:
|
||||||
|
'Pop fills live between vocal phrases, not over them. Find the note the whole loop shares — the tonic-drone play makes it physical — and hang fills off it, landing phrase endings on the current chord\'s 3rd. The 9 is pop\'s one free colour: a whole step above any root, it reads as shimmer, never as jazz.',
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
over: 'pop-axis',
|
||||||
|
description:
|
||||||
|
'The roll figure is itself the fill: when the vocal rests, take the right-hand bottom–middle–top–middle broken pattern up an octave for two beats and come back down — motion without a single new note. This is how the Someone Like You verse breathes.',
|
||||||
|
source: 'pianote.com — "Someone Like You" piano tutorial (the broken-chord verse figure)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'pop-mixo-bVII',
|
||||||
|
description:
|
||||||
|
'The sus4 pull as a fill: over the held I, alternate the 3rd and 4th in even eighths (3–4–3, harmony unchanged) — the keyboard translation of the guitar sus hammer-on that fills long tonic bars in pop-rock loops.',
|
||||||
|
source: 'the guitar pack\'s sus figure (fretjam.com / guitar.com sus embellishments), translated per pianowithjonny.com pop accompaniment patterns',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -179,4 +179,70 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Structured licks (SCHEMA.md "Licks", task P-24). Written in a home key each
|
||||||
|
// (noted per lick) but key-agnostic in spirit — chordContext names the station.
|
||||||
|
// Every pitch hand-verified: s6=E s5=A s4=D s3=G s2=B s1=e (+fret, mod 12).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// In A minor (i–♭VII = Am–G): the skank chords answered as a fill —
|
||||||
|
// the i's ♭3+5 pair (C+E), the ♭VII's 3+5 pair (B+D) two frets down,
|
||||||
|
// back home, root on top. Strictly in the vocal gaps.
|
||||||
|
id: 'reggae-skank-answer',
|
||||||
|
name: 'Skank-answer double-stop fill',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'answer fill over the i–♭VII vamp, in the vocal gaps',
|
||||||
|
techniques: ['double-stop', 'vibrato'],
|
||||||
|
source: 'call-and-response fills in the Wailers style — Guitar World\'s Bob Marley rhythm-guitar lesson',
|
||||||
|
tab: [
|
||||||
|
{ string: 3, fret: 5 }, // C — the i's ♭3
|
||||||
|
{ string: 2, fret: 5, technique: 'double-stop' }, // E — the i's 5: the minor pair
|
||||||
|
{ string: 3, fret: 4 }, // B — the ♭VII's 3, two frets down
|
||||||
|
{ string: 2, fret: 3, technique: 'double-stop' }, // D — the ♭VII's 5: the pair moves with the chord
|
||||||
|
{ string: 3, fret: 5 }, // C — back home
|
||||||
|
{ string: 2, fret: 5, technique: 'double-stop' }, // E
|
||||||
|
{ string: 1, fret: 5, technique: 'vibrato' }, // A — the root caps the answer
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A minor, low register, palm-muted throughout: a minor-pentatonic
|
||||||
|
// line doubling the bassline in unison — the Lynn Taitt second-guitar
|
||||||
|
// job. Dull attack, locked exactly with the bass, never approximately.
|
||||||
|
id: 'reggae-bass-double',
|
||||||
|
name: 'Muted bass-doubling riddim line',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the i — unison with the bassline',
|
||||||
|
techniques: ['ghost-note'],
|
||||||
|
source: 'the rocksteady bass-doubling role in Lynn Taitt\'s muted picking style — Wikipedia "Rocksteady"; Brian Keyo\'s Taitt tribute (tallawah.com)',
|
||||||
|
tab: [
|
||||||
|
{ string: 6, fret: 5 }, // A — root, palm-muted like everything here
|
||||||
|
{ string: 6, fret: 5, technique: 'ghost-note' }, // muted pluck — the fluttering Taitt attack
|
||||||
|
{ string: 6, fret: 8 }, // C — ♭3
|
||||||
|
{ string: 5, fret: 5 }, // D — 4
|
||||||
|
{ string: 5, fret: 7 }, // E — 5
|
||||||
|
{ string: 5, fret: 5 }, // D — 4
|
||||||
|
{ string: 6, fret: 8 }, // C — ♭3
|
||||||
|
{ string: 6, fret: 5 }, // A — home; keep the attack dull to the end
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A: chromatic walk-up 6–♭7–7 into the root, timed so the root lands
|
||||||
|
// with the drum's drop (beat 3 of the one drop — beat 1 stays sacred and
|
||||||
|
// silent), answered by the 3+5 chop up top on the offbeat.
|
||||||
|
id: 'reggae-walkup-drop',
|
||||||
|
name: 'Chromatic walk into the one drop',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'pickup into the I — the root lands on the drop (beat 3)',
|
||||||
|
techniques: ['chromatic-approach', 'double-stop'],
|
||||||
|
source: 'in the style of rocksteady/early-reggae walk-ups (the Lynn Taitt-era bass-and-guitar lines — Wikipedia "Rocksteady", "One drop rhythm")',
|
||||||
|
tab: [
|
||||||
|
{ string: 6, fret: 2 }, // F♯ — the 6
|
||||||
|
{ string: 6, fret: 3, technique: 'chromatic-approach' }, // G — ♭7, passing
|
||||||
|
{ string: 6, fret: 4, technique: 'chromatic-approach' }, // G♯ — 7, passing
|
||||||
|
{ string: 6, fret: 5 }, // A — root, landing WITH the drop
|
||||||
|
{ string: 3, fret: 6 }, // C♯ — the 3: jump up for the answer chop
|
||||||
|
{ string: 2, fret: 5, technique: 'double-stop' }, // E — the 5: the skank answers on the offbeat
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,6 +169,58 @@ export default {
|
|||||||
tips: 'For the gospel walk, insert a passing diminished between any two diatonic chords a step apart (I→♯i°→ii) — same borrowed-from-the-choir logic as the iv.',
|
tips: 'For the gospel walk, insert a passing diminished between any two diatonic chords a step apart (I→♯i°→ii) — same borrowed-from-the-choir logic as the iv.',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'rnb-justthetwo': [
|
||||||
|
{
|
||||||
|
label: 'Smooth-soul 9ths and the 13',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: MAJ9_5, extensions: ['9'], note: '♭VImaj9 — the lush opener' },
|
||||||
|
{ shape: DOM13_6, extensions: ['13'], note: 'V13 — dominant colour without the bark' },
|
||||||
|
{ shape: M9_5, extensions: ['9'], note: 'i9 — home, briefly' },
|
||||||
|
{ shape: M9_5, extensions: ['9'], note: '♭vii9 — same grip, two frets down' },
|
||||||
|
{ shape: DOM9_5, extensions: ['9'], note: '♭III9 — the V of ♭VI: the loop re-arms itself' },
|
||||||
|
],
|
||||||
|
tips: 'Treat the last two chords as one gesture — a ii–V pointing at the ♭VImaj9 that starts the next lap (in the original they share a single bar). Solo target: the major 7 of ♭VI is the sweetest note in the loop, and the ♭III9\'s ♭7 falls a half step onto it.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Leaner set with the altered V',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: MAJ7_5, note: '♭VImaj7 — plainer, room for the vocal' },
|
||||||
|
{ shape: HENDRIX, extensions: ['#9'], note: 'V7♯9 — the minor-key dominant with grit, one fret below ♭VI' },
|
||||||
|
{ shape: M11_C, extensions: ['11'], note: 'i11 — dark and hollow' },
|
||||||
|
{ shape: M9_6, extensions: ['9'], note: '♭vii9 — low root, 9 on top' },
|
||||||
|
{ shape: DOM13_6, extensions: ['13'], note: '♭III13' },
|
||||||
|
],
|
||||||
|
tips: 'The verse-register version: fewer notes, lower voicings, and the ♯9 on the V because in a minor key the dominant wants tension. Save the first play\'s glossy 9ths for the hook — the contrast between the two sets is the arrangement.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'rnb-chromatic-vi': [
|
||||||
|
{
|
||||||
|
label: 'Chromatic descent on the A string',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: SIX9_5, extensions: ['6', '9'], note: 'I6/9 — Motown sunshine on the tonic' },
|
||||||
|
{ shape: M9_5, extensions: ['9'], note: 'vi9 — root high on the A string' },
|
||||||
|
{ shape: DOM9_5, extensions: ['9'], note: '♭VI9 — the borrowed dominant, one fret down' },
|
||||||
|
{ shape: DOM9_5, extensions: ['9'], note: 'V9 — one more fret: the slide lands' },
|
||||||
|
],
|
||||||
|
tips: 'The last three roots fall one fret at a time down a single string — vi, ♭VI7, V is chromatic planing, the same trick as the jazz tritone sub seen from above (♭VI7 subs for II7). Target the ♭VI7\'s 3rd: it slides a half step down onto the 3rd of V.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Low-string 13th descent, triad on top',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ shape: TOP3_MAJ, note: 'I — a bare high triad; let the bass state the root' },
|
||||||
|
{ shape: M9_6, extensions: ['9'], note: 'vi9 — drop to the low-E root' },
|
||||||
|
{ shape: DOM13_6, extensions: ['13'], note: '♭VI13 — one fret down, horn-section colour' },
|
||||||
|
{ shape: DOM13_6, extensions: ['13'], note: 'V13 — one more fret; hold it for the horn hit' },
|
||||||
|
],
|
||||||
|
tips: 'The register story: start thin and high, then walk the low E string down in half steps with big 13th colour — the guitar plays the horn line. Punch the two 13ths on the beat and mute instantly; Sir Duke swings because of the silence between hits.',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
improv: {
|
improv: {
|
||||||
|
|||||||
@@ -0,0 +1,374 @@
|
|||||||
|
// R&B / Neo-soul piano pack (task P-30). Recipes verified by degree-spelling
|
||||||
|
// against CHORD_TYPES (src/lib/theory.js) and the validator's stacking
|
||||||
|
// convention (order inside each hand = voicing order low → high, nearest
|
||||||
|
// strictly above — documented at jazz/piano.js header). Every voice-leading
|
||||||
|
// statement in notes/tips is pitch-class arithmetic, computed and checked
|
||||||
|
// against the realized voicings (key of C) before writing.
|
||||||
|
// Voicings and treatments sourced from:
|
||||||
|
// pianowithjonny.com — "4 Steps to Play Neo Soul Chords on Piano" (maj7/min7
|
||||||
|
// as the base colour, the common-tone voicing rule, Rhodes as the idiomatic
|
||||||
|
// sound); hearandplay.com — "Neo Soul Chords: Exploring Extended Minor Chords"
|
||||||
|
// (the m11 voiced as a major triad on the ♭7 over the minor shell);
|
||||||
|
// pianogroove.com — "'So What' Chord Voicing" (the 1–11–♭7–♭3–5 stack: three
|
||||||
|
// perfect fourths capped by a major third; Bill Evans via the Miles Davis
|
||||||
|
// session) and "Quartal Comping Voicings for Jazz Piano" (fourths as planeable,
|
||||||
|
// harmonically ambiguous grips — the Robert Glasper-school texture);
|
||||||
|
// Mark Levine, The Jazz Piano Book (rootless left-hand voicings Type A/B,
|
||||||
|
// dominants swapping 5 for 13; sus voicings as a major triad off the ♭7);
|
||||||
|
// piano.org — "Rootless Voicings: Type A and Type B (Bill Evans Style)";
|
||||||
|
// freejazzlessons.com & jazzpianoblog.com — "Isn't She Lovely" piano analyses
|
||||||
|
// (the II9 → V9sus cadence treatment); musicradar.com — D'Angelo "Brown Sugar"
|
||||||
|
// breakdown & brltheory.com — the Dilla feel (both already cited by
|
||||||
|
// rnb/guitar.js). Pedagogy frame: docs/learn-curriculum.md — Piano pillar
|
||||||
|
// (shells → rootless, register discipline, voice-leading as hand economy).
|
||||||
|
|
||||||
|
// Reusable degree recipes. Order inside each hand = voicing order, low → high.
|
||||||
|
const LH_R5 = ['1', '5'] // root + fifth anchor
|
||||||
|
const LH_R = ['1'] // single bass note
|
||||||
|
const RH_SPREAD9 = ['9', '3', '7'] // the neo-soul default hand: 9 tucked under the 3rd, 7th on top
|
||||||
|
const RH_69 = ['6', '9', '3'] // the 6/9 hand: 6 above the LH fifth, 3rd on top
|
||||||
|
const A_FORM = ['3', '5', '7', '9'] // rootless Type A (3rd on the bottom)
|
||||||
|
const A_FORM_DOM = ['3', '13', '7', '9'] // dominant Type A: 5 → 13
|
||||||
|
const B_FORM = ['7', '9', '3', '5'] // rootless Type B (7th on the bottom)
|
||||||
|
const B_FORM_DOM = ['7', '9', '3', '13'] // dominant Type B: 5 → 13
|
||||||
|
const SO_WHAT_LH = ['1', '11'] // So What bottom: two of the stacked fourths
|
||||||
|
const SO_WHAT_RH = ['7', '3', '5'] // So What top: ♭7–♭3 fourth + major-3rd cap
|
||||||
|
|
||||||
|
export default {
|
||||||
|
styleIntro:
|
||||||
|
'On a neo-soul record the keyboard is the harmonic centre of gravity: Rhodes pads voiced in 9ths and 11ths, roots ceded to the bass player, every change placed a breath behind the drums. The left hand plays anchors (a root, a fifth) or vacates entirely; the right hand carries the colour — and the colour, not the changes, is the song.',
|
||||||
|
|
||||||
|
comping: [
|
||||||
|
{
|
||||||
|
label: 'Rhodes pads',
|
||||||
|
rhythm: 'whole- and half-note sustains, soft attack',
|
||||||
|
description:
|
||||||
|
'Lay the voicing down and leave it: neo-soul keys breathe in long tones while the drums chop 16ths underneath. Voice-lead so the top note barely moves between chords, and let the Rhodes tremolo (or the piano pedal) do the animating.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Behind-the-beat stabs (the Dilla pocket)',
|
||||||
|
rhythm: '16th-note stabs, dragged a hair late',
|
||||||
|
description:
|
||||||
|
'Short chords placed just behind the drum grid — deliberately, consistently late. Practise with the metronome ON the 16ths and aim to feel lazy without slowing down: the drag is a placement, not a tempo.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'The half-step slip',
|
||||||
|
rhythm: 'grace-note crush into the beat',
|
||||||
|
description:
|
||||||
|
'Form the whole grip a half-step below the target, brush it as a grace note, and place the real chord on the beat. The keys translation of the neo-soul guitar slide — most at home on the m9 and maj9 grips.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
plays: {
|
||||||
|
'rnb-mediant-circle': [
|
||||||
|
{
|
||||||
|
label: 'm9 spreads on the Rhodes',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'm9 planed — even on the iii, where the 9 leans outside the key; the parallel colour is the point' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the iii\'s ♭3 holds over as this ♭7 (same key); its ♭7 falls a whole step onto this ♭3' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the same trade again — the circle\'s law, one station later' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', '13', '7', '9'] }, note: 'V13 — two note names hold from the ii (♭3→♭7, 9→13); its ♭7 falls a half-step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'LH anchors around C3, RH spreads just above middle C; let the Rhodes bark soften the 9s',
|
||||||
|
tips: 'Three m9s falling in fifths, then the V13. At every change the old ♭3 keeps its key and becomes the new ♭7, while the old ♭7 falls by step — a whole step into a minor chord, a half-step into the dominant. Place every chord a hair behind the drums; the Dilla feel is placement, not extra notes.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'So What fourths (quartal planing)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: SO_WHAT_LH, RH: SO_WHAT_RH }, note: 'the So What chord: 1–11–♭7–♭3–5, three perfect fourths capped by a major third' },
|
||||||
|
{ recipe: { LH: SO_WHAT_LH, RH: SO_WHAT_RH }, note: 'the same five-finger grip planed down a fifth — nothing to re-finger' },
|
||||||
|
{ recipe: { LH: SO_WHAT_LH, RH: SO_WHAT_RH }, note: 'third station on the circle; the fourths keep it airy and unresolved' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', '13', '9'] }, note: 'quartal V13: the right hand stacks two perfect fourths (3–13–9) over the bare root; two of the ii\'s note names are already here — its 11 is this root, its 5th this 9' },
|
||||||
|
],
|
||||||
|
register: 'both hands close together, mid-keyboard — the five So What notes span a twelfth',
|
||||||
|
tips: 'This is the Bill Evans "So What" grip that the Glasper school planes shamelessly: fourths are harmonically ambiguous, so one hand-shape covers every m7 on the circle — you slide, the drums swing, nobody asks questions. Save the stacked-third m9 play for hooks; fourths are verse texture.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'rnb-6251': [
|
||||||
|
{
|
||||||
|
label: 'Stevie hands (the full cadence)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'm9 spread to start the fall home' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the dominant II: the vi\'s ♭3 holds as this ♭7 — and that note is the key\'s tonic; its ♭7 falls a half-step onto this 3rd' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: ['b7', '9', '3'] }, note: '9sus: the right hand is a plain major triad built on the ♭7 — the II\'s 3rd just fell a half-step into it' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_69 }, note: '6/9 instead of a plain triad — the sus ♭7 fell a half-step onto this 3rd, its 9 held over as this 6' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH around middle C; unhurried, let the sus ring',
|
||||||
|
tips: 'The cadence never plays a plain dominant: the II is a 9, the V is a 9sus that melts rather than resolves, and home is a 6/9. Track the key\'s home note through the middle of it — it is the II9\'s ♭7, then the sus chord\'s suspended 4th, before it finally lands in your left hand on the I.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless (Levine grips behind a bassist)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: A_FORM }, note: 'Type A rootless: ♭3–5–♭7–9' },
|
||||||
|
{ recipe: { LH: A_FORM_DOM }, note: 'three note names hold (♭3→♭7, 5→9, 9→13); only the ♭7 moves, a half-step onto this 3rd' },
|
||||||
|
{ recipe: { LH: ['3', '13', 'b7', '9'] }, note: '13sus — the dominant Type A shape with the 4th where the 3rd was; two names hold from the II (♭7→4, 9→13), the 3rd falls a half-step onto this ♭7, the 13 a whole step onto this 9' },
|
||||||
|
{ recipe: { LH: ['3', '5', '6', '9'] }, note: '6/9 landing: the sus 13 was already this 3rd, its 9 this 6th — those hold; the 4th and ♭7 each rise a whole step (onto the 9 and the 5th)' },
|
||||||
|
],
|
||||||
|
register: 'left hand alone, top note between C4 and C5 — the bassist owns the roots',
|
||||||
|
tips: 'The vi→II seam is the same physical move as any ii–V — three fingers hold, one falls — even though the II is a secondary dominant; your hand doesn\'t care about the theory. The 13sus is the modern-soul V: as a shape it is your dominant Type A with the bottom note a half-step up, and it never fully commits to dominant. That non-commitment IS the Stevie sound.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'rnb-maj7-vamp': [
|
||||||
|
{
|
||||||
|
label: 'maj9 pads',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'maj9 spread — the 9 tucked in above the anchor, 3rd and maj7 closing the hand' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the I\'s 3rd holds over as this maj7 (same note name); its maj7 falls a whole step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'wide and sustained; pedal through each two-bar chord',
|
||||||
|
tips: 'Two chords, one hinge: the I\'s 3rd and the IV\'s maj7 are the same note name — keep it in your voicing all night and float the rest around it (the common-tone rule pianowithjonny builds the whole style on). Colour each repeat differently — add the 9, thin to a bare 3–7, restrike on the and-of-2 — instead of changing chords.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Quartal drift (Glasper pads)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: ['7', '3', '13'] }, note: 'fourths off the maj7: 7–3–13, two perfect fourths — lush but weightless over the bare bass note' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['7', '3', '13'] }, note: 'same shape on the new root — two of its three note names were already sounding (the I\'s 3rd is this maj7, its 13 this 3rd)' },
|
||||||
|
],
|
||||||
|
register: 'single bass notes low, the fourths around middle C; let everything ring into everything',
|
||||||
|
tips: 'Every note both chords use comes from one parent scale, which is why this vamp can loop for six minutes without leaving home. The fourth-stack keeps the maj7 from sounding like a piano-bar ballad — same colour tones, none of the syrup. Vary the attack point (bar 2, the and-of-3) rather than the harmony.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'rnb-dorian': [
|
||||||
|
{
|
||||||
|
label: 'm11 haze (Voodoo pads)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: ['7', '9', '11'] }, note: 'm11: the right hand is a major triad built on the ♭7 — the hearandplay neo-soul grip' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'every right-hand voice moves by a step and no further: the ♭7 falls a half-step onto this 3rd, the 9 rises a half-step onto this ♭7, the 11 rises a whole step onto this 9' },
|
||||||
|
],
|
||||||
|
register: 'low fifths, right hand clustered just above middle C; 70 BPM, pedal-blurred',
|
||||||
|
tips: 'The whole haze is two steps wide — at the change every voice moves by a step and the grip re-forms. The IV9\'s major 3rd is Dorian\'s raised 6th, the one note separating this from plain sad minor: it is what tells the room this is D\'Angelo. Let it arrive slightly late.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Voodoo minimal (two-finger stabs)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: ['b3', '11'] }, note: 'a bare whole-step rub — ♭3 against 11 — more smoke than chord' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', 'b7'] }, note: 'just the dominant\'s tritone; the i\'s ♭3 has become this ♭7 (same note name) — half the dyad doesn\'t move' },
|
||||||
|
],
|
||||||
|
register: 'almost nothing: one bass note, two right-hand notes mid-keyboard — the drums are the point',
|
||||||
|
tips: 'Voodoo-era D\'Angelo is subtraction: three notes total, laid so far behind the beat they almost fall over. Two-finger shapes leave room for the slip — brush the dyad a half-step below and land both fingers on it on the beat. If it sounds empty, good: resist adding notes and push the placement instead.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'rnb-gospel-amen': [
|
||||||
|
{
|
||||||
|
label: 'The borrowed sigh (full hands)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'maj9 — bright before the shadow' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: ['6', '9', '3'] }, note: 'the borrowed chord: the 3rd fell a half-step to ♭3, the maj7 a whole step onto the 6th, and the 9 held' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'home: the iv\'s 6th holds as this 9; its borrowed ♭3 sighs a half-step down onto the key\'s 5th — your left hand is already holding it' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH just above middle C; let the iv bar breathe',
|
||||||
|
tips: 'One chord borrowed from the parallel minor, two sighs to pay for it: the 3rd falls a half-step going in (IV→iv), the borrowed ♭3 falls a half-step coming home (iv→I). Every other note name holds or steps down — soul ballads end on this cadence because the hands literally relax. Play the iv softer than the IV; borrowed chords whisper.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless, iv as m6/9',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: A_FORM }, note: 'Type A rootless: 3–5–7–9' },
|
||||||
|
{ recipe: { LH: ['3', '5', '6', '9'] }, note: 'm6/9: the 5th and the 9 hold; the 3rd falls a half-step to ♭3, the maj7 a whole step onto the 6th' },
|
||||||
|
{ recipe: { LH: A_FORM }, note: 'the iv\'s 6th and 9th are already this chord\'s 9th and 5th — those names hold; the borrowed ♭3 (the key\'s ♭6) resolves down a half-step to the 5th, and the iv\'s 5th — the key\'s own tonic — slips a half-step onto this maj7' },
|
||||||
|
],
|
||||||
|
register: 'left hand alone, top note C4–C5; a bassist owns the roots',
|
||||||
|
tips: 'The m6/9 grip is what makes the borrowed iv sound like Musiq Soulchild instead of a hymn: same borrowed ♭3, but the 6 and 9 around it are both notes the I wants anyway, so the chord arrives already half-resolved. Across the whole cadence no change moves more than two note names — that stillness is the neo-soul reading of gospel\'s Amen.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'rnb-justthetwo': [
|
||||||
|
{
|
||||||
|
label: 'Planed 9ths (smooth-soul pads)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'maj9 on the ♭VI — the loop starts away from home' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the whole chord sinks: roots, 5ths, 3rds and 9s each fall a half-step; the 7 falls a whole step (maj7 becomes ♭7)' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the V\'s 3rd — the raised leading tone — resolves up a half-step into your bass root; its ♭7 falls a whole step onto this ♭3' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the same m9 hand slides down a whole step — every voice, together' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'a ii–V pointing at ♭VI: the ♭vii\'s ♭3 holds as this ♭7 (same name); its ♭7 falls a half-step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths mid-low, RH spreads above middle C; think slow-jam strings',
|
||||||
|
tips: 'The loop teaches two lessons. First, the half-step fall: ♭VI→V drags every voice down by step. Second, ii–Vs that aim somewhere other than home: ♭vii–♭III7 is a ii–V of the ♭VI, and the ♭III7\'s 3rd is the ♭VI\'s maj7 by name — so the loop\'s seam resolves as smoothly as its middle. Hear those two things and every smooth-soul chart gets easier.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Rootless A/B (90s R&B changes)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: A_FORM }, note: 'Type A on the ♭VImaj7: 3–5–7–9' },
|
||||||
|
{ recipe: { LH: B_FORM_DOM }, note: 'Type B on the V: no name survives — every voice moves by step, three of the four by half-step' },
|
||||||
|
{ recipe: { LH: A_FORM }, note: 'back to Type A: the V\'s 3rd falls a half-step onto this ♭7, its ♭7 a whole step onto this ♭3' },
|
||||||
|
{ recipe: { LH: B_FORM }, note: 'Type B — alternating types keeps the voicing in the same part of the keyboard while the roots move' },
|
||||||
|
{ recipe: { LH: A_FORM_DOM }, note: 'three names hold from the ♭vii (9→13, ♭3→♭7, 5→9); only its ♭7 falls, a half-step onto this 3rd' },
|
||||||
|
],
|
||||||
|
register: 'top note between C4 and C5; leave the low register to the bass and pads',
|
||||||
|
tips: 'The ii–V law rides again in a strange neighbourhood: minor-to-dominant a fifth down means three fingers freeze and one falls, whether the target is home or — as here — the ♭VI. Around the seam, two names hold into the ♭VImaj7: the ♭III7\'s 3rd becomes its maj7, its 13 becomes its 3rd. Learn the loop as hand motion, not chord names.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
'rnb-chromatic-vi': [
|
||||||
|
{
|
||||||
|
label: 'The chromatic slide (full hands)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_69 }, note: '6/9 — the Motown tonic; its 6th is the vi\'s root arriving early' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the I\'s 9 fell a whole step onto this ♭3; its 6th fell another onto this ♭7' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the key\'s home note holds through this change — the vi\'s ♭3 IS the ♭VI7\'s 3rd; the ♭7 and 9 each slip down a half-step' },
|
||||||
|
{ recipe: { LH: LH_R5, RH: RH_SPREAD9 }, note: 'the whole chord planes down a semitone — all five voices fall exactly a half-step' },
|
||||||
|
],
|
||||||
|
register: 'LH fifths around C3, RH around middle C',
|
||||||
|
tips: 'Sir Duke\'s verse is a bass line wearing chords: home for a bar, then 6–♭6–5 in half-steps. Count what survives on top: the tonic note refuses to move from vi into ♭VI7 (it just turns from ♭3 into 3rd), then nothing survives into V7 — the one change where everything slides together. Whether you call the ♭VI7 borrowed or a tritone sub of II7, the hands play the same thing.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Stab set with the ♯9 (horn-section hands)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chords: [
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', '5', '1'] }, note: 'plain triad, root on top — punchy, no colour yet' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', '5', '7'] }, note: 'the same three note names you just played, reread as this chord\'s ♭3, 5th and ♭7 — only the bass moves' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', '13', '7'] }, note: '♭VI13: the home note holds (♭3 turned 3rd) while the outer pair pinch inward by half-steps — 5th up onto the 13, ♭7 down onto the ♭7' },
|
||||||
|
{ recipe: { LH: LH_R, RH: ['3', '7', '#9'] }, note: 'the ♯9 exclamation: the ♭VI\'s 13 holds over as this ♭7 (same name) while the home note finally gives way, a half-step down onto the leading tone' },
|
||||||
|
],
|
||||||
|
register: 'tight three-note stabs either side of middle C; short, on the hits',
|
||||||
|
tips: 'Play these like a horn section: short, placed, gone. The I-to-vi change is free (same three names, new bass), the middle pinches chromatically, and the ♯9 on the V is spice you spend once per loop — the soul-horn exclamation, same budget as the guitar pack\'s 7♯9. Between stabs, dead silence is the groove.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
improv: {
|
||||||
|
scales: [
|
||||||
|
{
|
||||||
|
over: 'i7 / IV9 (Dorian vamps)',
|
||||||
|
scale: 'dorian',
|
||||||
|
why: 'D\'Angelo vamps live on Dorian: its raised 6th is the IV9\'s major 3rd, so the scale agrees with the chord change instead of fighting it — one scale covers both chords of the loop.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'the m9 circle (iii–vi–ii)',
|
||||||
|
scale: 'dorian from each root',
|
||||||
|
why: 'Each root\'s own Dorian contains exactly the planed m9 grip (9, ♭3, 11, ♭7) — shift scales with the chords, the way the chords themselves plane. Aim at each new 9th.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'Imaj7 / IVmaj7',
|
||||||
|
scale: 'major pentatonic of the key',
|
||||||
|
why: 'Five notes, no avoid note over either chord — over the IV they land on its 3rd, 5th, maj7, 9 and 13. The pentatonic haze over lush maj7s is half of bedroom R&B.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'dom7 (II9, V13, ♭VI7, ♭III7)',
|
||||||
|
scale: 'mixolydian from the chord\'s root',
|
||||||
|
why: 'Each passing dominant carries its own Mixolydian for exactly one bar. Over the ♭VI7 that scale still contains the key\'s home note — the same pivot your comping hand is holding.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
over: 'V9sus',
|
||||||
|
scale: 'the key\'s major scale',
|
||||||
|
why: 'A 9sus is the ii7 stacked on the V\'s bass, so the plain parent scale cannot miss. Land on the 9 or the suspended 4th, and let the ♭7 fall to the I\'s 3rd when the chord finally turns.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetNotes:
|
||||||
|
'Nines on the downbeats: most grips in this pack keep a 9 under your fingers, and landing on it — a whole step above each new root — is the fastest way to sound like the record. Approach chord tones from a half-step below (the single-note version of the slip), and when in doubt lay out for a bar: neo-soul solos breathe on the 16th grid they float over.',
|
||||||
|
},
|
||||||
|
|
||||||
|
// Structured piano licks (SCHEMA.md "Piano licks", task P-61). Degree-based
|
||||||
|
// and key-agnostic: every deg resolves through the stated quality, approach
|
||||||
|
// pitches are derived from the next deg note. Realized offsets in the
|
||||||
|
// comments use a C-rooted chord for readability; every interval claim in
|
||||||
|
// notes/tips was recomputed from those offsets before writing (P-41 bar).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// Over Cm7: D5 C5 B♭4 G4 E♭4 — offsets 14 12 10 7 3: the 9 held a
|
||||||
|
// beat and a half, sighing a whole step onto the octave root, then
|
||||||
|
// the m7 arpeggio falling away (root, ♭7, 5, ♭3) on dragged beats.
|
||||||
|
id: 'rnb-nine-sigh',
|
||||||
|
name: 'The nine sigh',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the i7 — the m9 colour of a Dorian vamp',
|
||||||
|
quality: 'min7',
|
||||||
|
techniques: [],
|
||||||
|
source: 'the 9-over-minor colour neo-soul leads with — hearandplay.com "Neo Soul Chords: Exploring Extended Minor Chords"; pianowithjonny.com neo-soul lessons',
|
||||||
|
notes: [
|
||||||
|
{ deg: '9', octave: 1, beat: 1 },
|
||||||
|
{ deg: '1', octave: 1, beat: 2.5 },
|
||||||
|
{ deg: '7', beat: 3 },
|
||||||
|
{ deg: '5', beat: 3.5 },
|
||||||
|
{ deg: '3', beat: 4.5 },
|
||||||
|
],
|
||||||
|
tips: 'Start ON the 9 — the note this pack keeps under your fingers — hold it past the beat, then let it sigh a whole step onto the octave root and fall away down the chord: ♭7, 5th, ♭3. The beats are written lazy on purpose (the root lands on the and-of-2, the ♭3 limps in on the and-of-4): the sigh is a placement as much as a pitch.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over Cm7, quartal dyads (each pair a perfect 4th, 5 semitones):
|
||||||
|
// brush (A4,D5)=(9,14) a half-step below, land (B♭4,E♭5)=(10,15),
|
||||||
|
// then plane down (G4,C5)=(7,12) and (F4,B♭4)=(5,10). Every note —
|
||||||
|
// grace pair included — sits in the root's Dorian scale.
|
||||||
|
id: 'rnb-quartal-slip',
|
||||||
|
name: 'Quartal slip (fourths on the drag)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the i7 — verse texture on any m7 station',
|
||||||
|
quality: 'min7',
|
||||||
|
techniques: ['grace-note', 'double-stop'],
|
||||||
|
source: 'fourths as planeable neo-soul texture (the Glasper-school grip) — pianogroove.com "Quartal Comping Voicings for Jazz Piano"; the half-step slip per pianowithjonny.com "4 Steps to Play Neo Soul Chords on Piano"',
|
||||||
|
notes: [
|
||||||
|
{ deg: '6', beat: 1, technique: 'grace-note' },
|
||||||
|
{ deg: '9', octave: 1, beat: 1, technique: 'grace-note' },
|
||||||
|
{ deg: '7', beat: 1 },
|
||||||
|
{ deg: '3', octave: 1, beat: 1, technique: 'double-stop' },
|
||||||
|
{ deg: '5', beat: 2.5 },
|
||||||
|
{ deg: '1', octave: 1, beat: 2.5, technique: 'double-stop' },
|
||||||
|
{ deg: '11', beat: 3.5 },
|
||||||
|
{ deg: '7', beat: 3.5, technique: 'double-stop' },
|
||||||
|
],
|
||||||
|
tips: 'One perfect fourth does the whole lick: brush it a half-step low (6 under 9 — both Dorian notes, so even the smear is in the scale) and land it on ♭7-under-♭3 at the beat, then drop the same two-finger grip a third onto 5-under-root, and a step onto 11-under-♭7. Ending on the 11 dyad resolves nothing, and that hovering non-arrival is exactly the verse texture the fourths exist for.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over Cm7: C5 (B4) B♭4 (A♭4) G4 (E4) E♭4 — offsets 12 [11] 10 [8] 7
|
||||||
|
// [4] 3. Each bracketed pitch is derived (chrom-above of the next
|
||||||
|
// deg); the beat-notes alone spell the falling m7 arpeggio
|
||||||
|
// (root, ♭7, 5, ♭3), each one dragged into from a half-step above
|
||||||
|
// on the last 16th before the beat.
|
||||||
|
id: 'rnb-dilla-drop',
|
||||||
|
name: 'The Dilla drop (lazy chromatic fall)',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the i7, dragged behind the grid',
|
||||||
|
quality: 'min7',
|
||||||
|
techniques: [],
|
||||||
|
source: 'the behind-the-grid drag of the Dilla feel — brltheory.com on the Dilla time-feel; falling-chromatic voice motion per the musicradar.com D\'Angelo "Brown Sugar" breakdown',
|
||||||
|
notes: [
|
||||||
|
{ deg: '1', octave: 1, beat: 1 },
|
||||||
|
{ approach: 'chrom-above', beat: 1.75 },
|
||||||
|
{ deg: '7', beat: 2 },
|
||||||
|
{ approach: 'chrom-above', beat: 2.75 },
|
||||||
|
{ deg: '5', beat: 3 },
|
||||||
|
{ approach: 'chrom-above', beat: 3.75 },
|
||||||
|
{ deg: '3', beat: 4 },
|
||||||
|
],
|
||||||
|
tips: 'The skeleton is just the chord falling — octave root, ♭7, 5th, ♭3 on the beats — but every chord tone gets dragged into from the half-step above, placed on the last 16th before it lands. The first drag is the minor chord\'s natural 7, the last is the major 3rd — the same "wrong" upper neighbour the jazz enclosure uses — and neither sounds wrong at this tempo because each one falls immediately. Play it almost too late; the lean IS the lick.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Over Cmaj7: G4 A4 C5 D5 E5 D5 — offsets 7 9 12 14 16 14: the major
|
||||||
|
// pentatonic climbed to the 3rd (whole step, minor 3rd, whole step,
|
||||||
|
// whole step), then settling a whole step back onto the 9. Ghosts on
|
||||||
|
// the passing 6 and the first 9.
|
||||||
|
id: 'rnb-penta-turn',
|
||||||
|
name: 'Pentatonic turn onto the 9',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the Imaj7 (or IVmaj7) of the maj7 vamp',
|
||||||
|
quality: 'maj7',
|
||||||
|
techniques: ['ghost-note'],
|
||||||
|
source: 'the major-pentatonic haze over lush maj7s — stock bedroom-R&B fill vocabulary; see pianowithjonny.com neo-soul piano lessons',
|
||||||
|
notes: [
|
||||||
|
{ deg: '5', beat: 1 },
|
||||||
|
{ deg: '6', beat: 1.5, technique: 'ghost-note' },
|
||||||
|
{ deg: '1', octave: 1, beat: 2 },
|
||||||
|
{ deg: '9', octave: 1, beat: 2.5, technique: 'ghost-note' },
|
||||||
|
{ deg: '3', octave: 1, beat: 3 },
|
||||||
|
{ deg: '9', octave: 1, beat: 4 },
|
||||||
|
],
|
||||||
|
tips: 'Climb the major pentatonic — 5, 6, root, 9 — peak on the 3rd, then settle a whole step back onto the 9 and stay there: the resolution note is the colour note, which is the whole neo-soul bargain. The ghosted notes (the 6 and the first 9) should be felt more than heard — press them at half weight so the beat-notes ring and the in-betweens blur. Same six keys work over the IVmaj7 a bar later.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -1,3 +1,11 @@
|
|||||||
|
// Level tags + the two intermediate progressions added by task P-20.
|
||||||
|
// Intermediate-entry changes verified against: guitarmusictheory.com &
|
||||||
|
// Hooktheory TheoryTab & musescore.com feature ("Just the Two of Us" —
|
||||||
|
// D♭maj7–C7–Fm7 with the E♭m7–A♭7 ii–V pointing back at ♭VI, key of F minor),
|
||||||
|
// Hooktheory TheoryTab & songdna.blogspot.com & spytunes.com ("Sir Duke"
|
||||||
|
// verse B–G♯m–G–F♯7 = I–vi–♭VI7–V chromatic descent),
|
||||||
|
// docs/progression-repertoire.md §2 (modal interchange, secondary dominants,
|
||||||
|
// tritone substitution rows).
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
id: 'rnb-mediant-circle',
|
id: 'rnb-mediant-circle',
|
||||||
@@ -9,6 +17,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['September — Earth, Wind & Fire (rotation family)', 'the soul turnaround started from the iii'],
|
songs: ['September — Earth, Wind & Fire (rotation family)', 'the soul turnaround started from the iii'],
|
||||||
tip: 'The 1-6-2-5 family entered from the mediant — home is implied for three bars before the V finally points at it. Neo-soul lives in that deferral.',
|
tip: 'The 1-6-2-5 family entered from the mediant — home is implied for three bars before the V finally points at it. Neo-soul lives in that deferral.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'rnb-6251',
|
id: 'rnb-6251',
|
||||||
@@ -20,6 +29,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ["Isn't She Lovely — Stevie Wonder"],
|
songs: ["Isn't She Lovely — Stevie Wonder"],
|
||||||
tip: 'The II is a secondary dominant (not the polite ii), and the V arrives as a 9sus — suspended, never quite dominant, melting into the I. Stevie\'s whole cadence language in four chords.',
|
tip: 'The II is a secondary dominant (not the polite ii), and the V arrives as a 9sus — suspended, never quite dominant, melting into the I. Stevie\'s whole cadence language in four chords.',
|
||||||
|
level: 'intermediate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'rnb-maj7-vamp',
|
id: 'rnb-maj7-vamp',
|
||||||
@@ -31,6 +41,7 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['Waiting in Vain — Bob Marley', "Cruisin' — Smokey Robinson (I–ii7 variant)"],
|
songs: ['Waiting in Vain — Bob Marley', "Cruisin' — Smokey Robinson (I–ii7 variant)"],
|
||||||
tip: 'Two lush chords trading forever — the song is the texture. The same vamp underpins half of modern bedroom R&B; colour it differently every two bars.',
|
tip: 'Two lush chords trading forever — the song is the texture. The same vamp underpins half of modern bedroom R&B; colour it differently every two bars.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'rnb-dorian',
|
id: 'rnb-dorian',
|
||||||
@@ -42,6 +53,7 @@ export default [
|
|||||||
mode: 'dorian',
|
mode: 'dorian',
|
||||||
songs: ["Spanish Joint — D'Angelo", "Didn't Cha Know — Erykah Badu (i–iv minor variant)", "Brown Sugar — D'Angelo (E Dorian loop)"],
|
songs: ["Spanish Joint — D'Angelo", "Didn't Cha Know — Erykah Badu (i–iv minor variant)", "Brown Sugar — D'Angelo (E Dorian loop)"],
|
||||||
tip: 'The IV9 carries the raised 6th that makes it Dorian — the same pair as the funk vamp, slowed to 70 BPM and dragged behind the beat.',
|
tip: 'The IV9 carries the raised 6th that makes it Dorian — the same pair as the funk vamp, slowed to 70 BPM and dragged behind the beat.',
|
||||||
|
level: 'foundation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'rnb-gospel-amen',
|
id: 'rnb-gospel-amen',
|
||||||
@@ -53,5 +65,30 @@ export default [
|
|||||||
mode: 'major',
|
mode: 'major',
|
||||||
songs: ['the gospel "Amen" cadence', 'countless soul ballad turnarounds (borrowed iv)'],
|
songs: ['the gospel "Amen" cadence', 'countless soul ballad turnarounds (borrowed iv)'],
|
||||||
tip: 'The IV turns minor on its way home — borrowed from the parallel minor, the single most-borrowed chord in soul. One semitone (the 3rd of the IV falling) does all the work.',
|
tip: 'The IV turns minor on its way home — borrowed from the parallel minor, the single most-borrowed chord in soul. One semitone (the 3rd of the IV falling) does all the work.',
|
||||||
|
level: 'intermediate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'rnb-justthetwo',
|
||||||
|
name: 'Just-the-Two-of-Us loop (♭VI–V–i + ii–V of ♭VI)',
|
||||||
|
rn: ['♭VImaj7', 'V7', 'i7', '♭vii7', '♭III7'],
|
||||||
|
degrees: [8, 7, 0, 10, 3],
|
||||||
|
qualities: ['maj7', 'dom7', 'min7', 'min7', 'dom7'],
|
||||||
|
bars: [1, 1, 2, 1, 1],
|
||||||
|
mode: 'minor',
|
||||||
|
songs: ['Just the Two of Us — Grover Washington Jr. & Bill Withers', 'a smooth-soul/90s-R&B staple loop'],
|
||||||
|
tip: 'A minor loop that spends most of its time away from home: ♭VI–V–i falls in half steps, then the ♭vii–♭III7 is a ii–V aimed back at ♭VI, not at i. Hearing ii–Vs that target chords other than the tonic is the door out of diatonic playing — in the original the last two chords share one bar.',
|
||||||
|
level: 'intermediate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'rnb-chromatic-vi',
|
||||||
|
name: 'Chromatic soul descent (I–vi–♭VI7–V)',
|
||||||
|
rn: ['I', 'vi7', '♭VI7', 'V7'],
|
||||||
|
degrees: [0, 9, 8, 7],
|
||||||
|
qualities: ['maj', 'min7', 'dom7', 'dom7'],
|
||||||
|
bars: [1, 1, 1, 1],
|
||||||
|
mode: 'major',
|
||||||
|
songs: ['Sir Duke — Stevie Wonder (verse)'],
|
||||||
|
tip: 'One swapped chord makes it: where the diatonic loop would repeat vi or move to IV, the ♭VI7 (borrowed from the parallel minor) slides the bass down 6–♭6–5 in half steps. It doubles as a tritone sub of II7 (V/V) — either way the whole chord planes down a semitone into V.',
|
||||||
|
level: 'intermediate',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -209,4 +209,95 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Structured licks (SCHEMA.md "Licks", task P-24). Written in a home key each
|
||||||
|
// (noted per lick) but key-agnostic in spirit — chordContext names the station.
|
||||||
|
// Every pitch hand-verified: s6=E s5=A s4=D s3=G s2=B s1=e (+fret, mod 12).
|
||||||
|
licks: [
|
||||||
|
{
|
||||||
|
// In A: the 4 slid up to the 5 on the B string, the root stacked on top
|
||||||
|
// (E+A — the Berry 4ths dyad), hammered in triplets, then the ♭3→3 curl
|
||||||
|
// and home. The rock-and-roll intro figure.
|
||||||
|
id: 'rock-berry-double-stop',
|
||||||
|
name: 'Berry double-stop intro figure',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the I — intro or turnaround energy',
|
||||||
|
techniques: ['slide', 'double-stop', 'hammer-on', 'vibrato'],
|
||||||
|
source: 'in the style of the "Johnny B. Goode" intro double-stops — Chuck Berry (1958); JustinGuitar song lesson SB-425',
|
||||||
|
tab: [
|
||||||
|
{ string: 2, fret: 3 }, // D — the 4, pickup two frets below
|
||||||
|
{ string: 2, fret: 5, technique: 'slide' }, // E — the 5th, slid up the B string
|
||||||
|
{ string: 1, fret: 5, technique: 'double-stop' }, // A — root on top: the Berry 4ths dyad lands
|
||||||
|
{ string: 2, fret: 5 }, // E — restrike the pair in triplets
|
||||||
|
{ string: 1, fret: 5, technique: 'double-stop' }, // A
|
||||||
|
{ string: 2, fret: 5 }, // E
|
||||||
|
{ string: 1, fret: 5, technique: 'double-stop' }, // A
|
||||||
|
{ string: 3, fret: 5 }, // C — ♭3
|
||||||
|
{ string: 3, fret: 6, technique: 'hammer-on' }, // C♯ — the 3: the curl resolves up
|
||||||
|
{ string: 1, fret: 5, technique: 'vibrato' }, // A — end on the root
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A, box 1 at fret 5: the B-string ♭7 (G) bent a whole step up to the
|
||||||
|
// root against the same root held on the top string — the beating unison,
|
||||||
|
// then the ♭3 answer and home. The Purple Haze-outro cliché.
|
||||||
|
id: 'rock-unison-bend',
|
||||||
|
name: 'Box-1 unison bend',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'over the I (or i) at the solo climax',
|
||||||
|
techniques: ['bend', 'double-stop', 'vibrato'],
|
||||||
|
source: 'the unison-bend cliché ("Purple Haze" outro lineage — Hendrix, Page, May); JustinGuitar unison bend technique BL-607',
|
||||||
|
tab: [
|
||||||
|
{ string: 1, fret: 5 }, // A — state the root first
|
||||||
|
{ string: 2, fret: 8, technique: 'bend' }, // G — ♭7 bent a whole step up to A
|
||||||
|
{ string: 1, fret: 5, technique: 'double-stop' }, // A — held on top: the unison pair beats
|
||||||
|
{ string: 2, fret: 8, technique: 'bend' }, // bend it again
|
||||||
|
{ string: 1, fret: 5, technique: 'double-stop' }, // A on top
|
||||||
|
{ string: 1, fret: 8 }, // C — the ♭3: blues grit over a major I
|
||||||
|
{ string: 1, fret: 5, technique: 'vibrato' }, // A — resolve on the root
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A Mixolydian (I–♭VII–IV = A–G–D): climb the mode from the root and
|
||||||
|
// land the key's ♭7 (G) exactly as the ♭VII chord hits — it IS that
|
||||||
|
// chord's root — then let it fall a half step to F♯, the IV's 3rd. A
|
||||||
|
// voice-leading rail, rock edition.
|
||||||
|
id: 'rock-mixo-rail',
|
||||||
|
name: 'Mixolydian rail onto the ♭VII',
|
||||||
|
level: 'intermediate',
|
||||||
|
chordContext: 'I → ♭VII → IV vamp',
|
||||||
|
techniques: ['slide', 'vibrato'],
|
||||||
|
source: 'the I–♭VII–IV Mixolydian language ("All Right Now"/"Highway to Hell" triads) — GuitarPlayer "Master the Mixolydian Mode"; Fundamental Changes "Study the Mixolydian Mode Pt 1"',
|
||||||
|
tab: [
|
||||||
|
{ string: 4, fret: 7 }, // A — root, over the I
|
||||||
|
{ string: 3, fret: 4 }, // B — 2
|
||||||
|
{ string: 3, fret: 6 }, // C♯ — 3
|
||||||
|
{ string: 3, fret: 7, technique: 'slide' }, // D — 4, slid into
|
||||||
|
{ string: 2, fret: 5 }, // E — 5
|
||||||
|
{ string: 2, fret: 8, technique: 'vibrato' }, // G — the key's ♭7: the ♭VII's root, landed at the change
|
||||||
|
{ string: 2, fret: 7 }, // F♯ — falls a half step: the IV's 3rd
|
||||||
|
{ string: 1, fret: 5, technique: 'vibrato' }, // A — the IV's 5th; home
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// In A minor, box 1: the descending pull-off cascade — two notes per
|
||||||
|
// string down the pentatonic, ending on the root an octave down. The
|
||||||
|
// stock rock run every soloist owns.
|
||||||
|
id: 'rock-box1-cascade',
|
||||||
|
name: 'Descending pull-off cascade',
|
||||||
|
level: 'foundation',
|
||||||
|
chordContext: 'over the i — works across the whole minor-key vamp',
|
||||||
|
techniques: ['pull-off', 'vibrato'],
|
||||||
|
source: 'the box-1 descending run — stock rock vocabulary; MusicRadar "50 rock guitar licks you need to know"; Guitar World "20 rock guitar licks"',
|
||||||
|
tab: [
|
||||||
|
{ string: 1, fret: 8 }, // C — ♭3
|
||||||
|
{ string: 1, fret: 5, technique: 'pull-off' }, // A — root
|
||||||
|
{ string: 2, fret: 8 }, // G — ♭7
|
||||||
|
{ string: 2, fret: 5, technique: 'pull-off' }, // E — 5
|
||||||
|
{ string: 3, fret: 7 }, // D — 4
|
||||||
|
{ string: 3, fret: 5, technique: 'pull-off' }, // C — ♭3
|
||||||
|
{ string: 4, fret: 7, technique: 'vibrato' }, // A — root, an octave down: land it
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,304 @@
|
|||||||
|
// ─── Chord audio preview engine (L-20) ────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// A pure, React-free Web Audio module that AUDITIONS voicings — the sound behind
|
||||||
|
// the ▶ buttons in the Voicing Browser (D-21) and anywhere else the Knowledge
|
||||||
|
// Center wants a chord heard, not just seen.
|
||||||
|
//
|
||||||
|
// It owns ONE module-level, lazily-created AudioContext, spun up on the first
|
||||||
|
// play call (which, in the UI, is always a user gesture — required by browser
|
||||||
|
// autoplay policy). It NEVER touches the detection pipeline: no import from
|
||||||
|
// AudioCapture.jsx, audioService.js, or App.jsx, no analyser, no microphone.
|
||||||
|
// Playback goes straight to the speakers on its own context.
|
||||||
|
//
|
||||||
|
// ── ⚠ MIC-FEEDBACK CAVEAT (read before wiring a UI) ───────────────────────────
|
||||||
|
// This module plays chords out of the speakers. While the mic is live, the
|
||||||
|
// DETECTION pipeline (pitch + chroma analysers in AudioCapture) will HEAR this
|
||||||
|
// playback like any other sound in the room — a previewed voicing can vote into
|
||||||
|
// chord/key detection and pollute the session. UI callers should pause or
|
||||||
|
// ignore detection for the duration of a preview (roughly the `durMs` window
|
||||||
|
// after the last strummed note). Wiring that suppression is a FUTURE task —
|
||||||
|
// this module deliberately stays decoupled and just makes sound.
|
||||||
|
//
|
||||||
|
// ── Note space ────────────────────────────────────────────────────────────────
|
||||||
|
// All play functions take notes in the piano.js convention: absolute semitone
|
||||||
|
// positions where 0 = the C of the low displayed octave = C3 = MIDI 48
|
||||||
|
// (130.81 Hz). `pianoVoicing().notes` (0–36) drops straight in. Guitar shapes
|
||||||
|
// reach BELOW that anchor (open low E = E2 = MIDI 40 = note −8); negative
|
||||||
|
// values are legal input to `playVoicing` — only the renderers care about the
|
||||||
|
// 0–36 window, the synth maps any integer to its true frequency.
|
||||||
|
//
|
||||||
|
// ── Tone ──────────────────────────────────────────────────────────────────────
|
||||||
|
// Per note: two slightly-detuned triangle oscillators (a little chorus warmth)
|
||||||
|
// plus a quiet sine an octave up (shimmer), through a lowpass and a gain
|
||||||
|
// envelope (~20 ms soft attack, exponential release inside `durMs`). Simple,
|
||||||
|
// pleasant, no samples. A master compressor guards against clipping when many
|
||||||
|
// notes ring together.
|
||||||
|
|
||||||
|
// ─── Module state (the ONE lazy AudioContext) ─────────────────────────────────
|
||||||
|
|
||||||
|
let ctx = null // dedicated AudioContext — created on first play call only
|
||||||
|
let master = null // master gain → compressor → destination
|
||||||
|
const active = new Set() // live note handles: { g, oscs } — for stopAll()
|
||||||
|
|
||||||
|
const ATTACK_S = 0.02 // soft attack
|
||||||
|
const TAIL_S = 0.06 // oscillator stop margin after the envelope floor
|
||||||
|
const ENV_FLOOR = 0.0001 // exponential ramps can't reach 0
|
||||||
|
const MAX_NOTES = 12 // defensive cap on simultaneous scheduled notes
|
||||||
|
|
||||||
|
function ensureContext() {
|
||||||
|
if (!ctx) {
|
||||||
|
const AC = globalThis.AudioContext || globalThis.webkitAudioContext
|
||||||
|
if (!AC) throw new Error('chordAudio: Web Audio API not available in this environment')
|
||||||
|
ctx = new AC()
|
||||||
|
|
||||||
|
master = ctx.createGain()
|
||||||
|
master.gain.value = 0.9
|
||||||
|
const comp = ctx.createDynamicsCompressor()
|
||||||
|
comp.threshold.value = -18
|
||||||
|
comp.knee.value = 24
|
||||||
|
comp.ratio.value = 4
|
||||||
|
master.connect(comp)
|
||||||
|
comp.connect(ctx.destination)
|
||||||
|
}
|
||||||
|
// A suspended context (autoplay policy) resumes on the user-gesture play call.
|
||||||
|
if (ctx.state === 'suspended') ctx.resume()
|
||||||
|
return ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Pitch math ───────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
const mod12 = (n) => ((n % 12) + 12) % 12
|
||||||
|
|
||||||
|
/**
|
||||||
|
* noteToFreq(note) → frequency in Hz.
|
||||||
|
*
|
||||||
|
* `note` is an absolute position in the piano.js space (0 = C3 = MIDI 48).
|
||||||
|
* Pure helper — exported so tests can verify the mapping without an
|
||||||
|
* AudioContext. noteToFreq(0) ≈ 130.81 (C3), noteToFreq(21) = 440 (A4).
|
||||||
|
*/
|
||||||
|
export function noteToFreq(note) {
|
||||||
|
return 440 * Math.pow(2, (note + 48 - 69) / 12)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Synthesis ────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
// Schedule one note: detuned triangle pair + octave sine → lowpass → envelope.
|
||||||
|
function scheduleNote(note, when, durMs, peakGain) {
|
||||||
|
const freq = noteToFreq(note)
|
||||||
|
const durS = Math.max(0.1, durMs / 1000)
|
||||||
|
|
||||||
|
const g = ctx.createGain()
|
||||||
|
g.gain.setValueAtTime(ENV_FLOOR, when)
|
||||||
|
g.gain.linearRampToValueAtTime(peakGain, when + ATTACK_S)
|
||||||
|
g.gain.exponentialRampToValueAtTime(ENV_FLOOR, when + durS)
|
||||||
|
|
||||||
|
const lp = ctx.createBiquadFilter()
|
||||||
|
lp.type = 'lowpass'
|
||||||
|
lp.frequency.value = Math.min(freq * 7, 5500) // keep it warm, not raw
|
||||||
|
lp.Q.value = 0.4
|
||||||
|
|
||||||
|
const partials = [
|
||||||
|
{ type: 'triangle', ratio: 1, detune: 0, level: 1.0 },
|
||||||
|
{ type: 'triangle', ratio: 1, detune: 6, level: 0.35 }, // +6 cents chorus
|
||||||
|
{ type: 'sine', ratio: 2, detune: 0, level: 0.18 }, // octave shimmer
|
||||||
|
]
|
||||||
|
|
||||||
|
const oscs = partials.map((p) => {
|
||||||
|
const osc = ctx.createOscillator()
|
||||||
|
osc.type = p.type
|
||||||
|
osc.frequency.value = freq * p.ratio
|
||||||
|
osc.detune.value = p.detune
|
||||||
|
const og = ctx.createGain()
|
||||||
|
og.gain.value = p.level
|
||||||
|
osc.connect(og)
|
||||||
|
og.connect(lp)
|
||||||
|
osc.start(when)
|
||||||
|
osc.stop(when + durS + TAIL_S)
|
||||||
|
return osc
|
||||||
|
})
|
||||||
|
|
||||||
|
lp.connect(g)
|
||||||
|
g.connect(master)
|
||||||
|
|
||||||
|
const handle = { g, oscs }
|
||||||
|
active.add(handle)
|
||||||
|
oscs[0].onended = () => active.delete(handle) // GC the handle when done
|
||||||
|
return handle
|
||||||
|
}
|
||||||
|
|
||||||
|
// Release one handle now (quick fade, then hard-stop the oscillators).
|
||||||
|
function releaseHandle(handle, now) {
|
||||||
|
try {
|
||||||
|
handle.g.gain.cancelScheduledValues(now)
|
||||||
|
handle.g.gain.setValueAtTime(Math.max(handle.g.gain.value, ENV_FLOOR), now)
|
||||||
|
handle.g.gain.linearRampToValueAtTime(ENV_FLOOR, now + 0.04)
|
||||||
|
for (const osc of handle.oscs) osc.stop(now + TAIL_S)
|
||||||
|
} catch {
|
||||||
|
// node already stopped — nothing to release
|
||||||
|
}
|
||||||
|
active.delete(handle)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Public API ───────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
/**
|
||||||
|
* playVoicing(notes, opts?) → { stop() }
|
||||||
|
*
|
||||||
|
* Plays a voicing — the primary entry point. `notes` are absolute positions in
|
||||||
|
* the piano.js space (0 = C3 = MIDI 48; `pianoVoicing().notes` drops straight
|
||||||
|
* in; `guitarShapeToNotes(...)` output too, including its below-C3 negatives).
|
||||||
|
*
|
||||||
|
* @param {number[]} notes absolute semitone positions (0 = C3)
|
||||||
|
* @param {{strumMs?: number, durMs?: number, gain?: number}} [opts]
|
||||||
|
* strumMs — stagger between note onsets, low→high (default 30; 0 = block chord)
|
||||||
|
* durMs — each note's envelope length (default 1800)
|
||||||
|
* gain — overall loudness 0–1 (default 0.5), split across the notes
|
||||||
|
* @returns {{ stop: () => void }} releases just THIS chord (stopAll() gets everything)
|
||||||
|
*
|
||||||
|
* First call creates the AudioContext — call from a user gesture (click).
|
||||||
|
*/
|
||||||
|
export function playVoicing(notes, opts = {}) {
|
||||||
|
const { strumMs = 30, durMs = 1800, gain = 0.5 } = opts
|
||||||
|
const clean = [...new Set((Array.isArray(notes) ? notes : []).filter(Number.isFinite))]
|
||||||
|
.sort((a, b) => a - b)
|
||||||
|
.slice(0, MAX_NOTES)
|
||||||
|
if (clean.length === 0) return { stop() {} }
|
||||||
|
|
||||||
|
ensureContext()
|
||||||
|
const now = ctx.currentTime
|
||||||
|
// Split the chord's loudness across its voices (sqrt: correlated-ish summing).
|
||||||
|
const perNote = Math.min(0.6, gain / Math.sqrt(clean.length))
|
||||||
|
|
||||||
|
const handles = clean.map((note, i) =>
|
||||||
|
scheduleNote(note, now + (i * strumMs) / 1000, durMs, perNote)
|
||||||
|
)
|
||||||
|
return {
|
||||||
|
stop() {
|
||||||
|
if (!ctx) return
|
||||||
|
const t = ctx.currentTime
|
||||||
|
for (const h of handles) releaseHandle(h, t)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Standard-tuning open-string MIDI numbers, strings [s6 … s1] = E2 A2 D3 G3 B3 E4.
|
||||||
|
// (voicings.js' OPEN holds the same strings as pitch classes; here we need real
|
||||||
|
// octaves to make sound, so the octaved values live here — same tuning, same order.)
|
||||||
|
const OPEN_STRING_MIDI = [40, 45, 50, 55, 59, 64]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* guitarShapeToNotes(shape, opts?) → number[]
|
||||||
|
*
|
||||||
|
* Maps a guitar voicing to the shared absolute-note space (0 = C3 = MIDI 48) so
|
||||||
|
* guitar shapes are playable via playVoicing. Low guitar strings sit BELOW C3,
|
||||||
|
* so the result can contain negatives (open low E = −8) — legal for playback.
|
||||||
|
* Returns sorted, deduped notes; [] for anything unrecognisable.
|
||||||
|
*
|
||||||
|
* Accepted shapes (everything voicings.js and the lick schema produce):
|
||||||
|
* 1. `[{string, fret}, …]` — note list (lick `tab` form); string 6 = low E,
|
||||||
|
* string 1 = high e; entries with a non-finite
|
||||||
|
* fret or string outside 1–6 are skipped.
|
||||||
|
* 2. `{frets: [s6…s1]}` — absolute frets, 'x'/null = muted. This is both
|
||||||
|
* voicings.js' open form and every resolved
|
||||||
|
* `getGuitarVoicings()` entry.
|
||||||
|
* 3. `{rootStr, offsets: [s6…s1]}` — voicings.js movable/barre form; offsets are
|
||||||
|
* fret distances from the root fret. Needs the
|
||||||
|
* key: pass `opts.rootPc` (0–11) to place it
|
||||||
|
* (falls back to shape.rootPc, then C).
|
||||||
|
*
|
||||||
|
* @param {Array|Object} shape
|
||||||
|
* @param {{rootPc?: number}} [opts] root pitch class for movable shapes
|
||||||
|
* @returns {number[]} absolute notes (may be negative), sorted low→high
|
||||||
|
*/
|
||||||
|
export function guitarShapeToNotes(shape, opts = {}) {
|
||||||
|
if (!shape) return []
|
||||||
|
|
||||||
|
// Form 1: [{string, fret}, …]
|
||||||
|
if (Array.isArray(shape)) {
|
||||||
|
const notes = []
|
||||||
|
for (const entry of shape) {
|
||||||
|
const s = entry?.string
|
||||||
|
const f = entry?.fret
|
||||||
|
if (!Number.isFinite(s) || s < 1 || s > 6 || !Number.isFinite(f) || f < 0) continue
|
||||||
|
notes.push(OPEN_STRING_MIDI[6 - s] + f - 48)
|
||||||
|
}
|
||||||
|
return [...new Set(notes)].sort((a, b) => a - b)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve the per-string absolute frets [s6…s1].
|
||||||
|
let frets = null
|
||||||
|
if (Array.isArray(shape.frets)) {
|
||||||
|
// Form 2: open shape / resolved getGuitarVoicings entry.
|
||||||
|
frets = shape.frets
|
||||||
|
} else if (Array.isArray(shape.offsets) && Number.isFinite(shape.rootStr)) {
|
||||||
|
// Form 3: movable shape — offsets relative to the root fret on rootStr.
|
||||||
|
// rootStr: 6 = low E … 1 = high e → low-E-first index is 6 − rootStr
|
||||||
|
// (the same convention ChordDiagram.jsx renders with).
|
||||||
|
const idx = 6 - shape.rootStr
|
||||||
|
if (idx < 0 || idx > 5) return []
|
||||||
|
const rootPc = mod12(opts.rootPc ?? shape.rootPc ?? 0)
|
||||||
|
const openPc = mod12(OPEN_STRING_MIDI[idx])
|
||||||
|
const rootFret = mod12(rootPc - openPc)
|
||||||
|
frets = shape.offsets.map((off) => (Number.isFinite(off) ? rootFret + off : 'x'))
|
||||||
|
// Negative-offset shapes (e.g. the G shape) can dip below fret 0 near the
|
||||||
|
// nut — slide the WHOLE shape up an octave rather than dropping strings.
|
||||||
|
const finite = frets.filter(Number.isFinite)
|
||||||
|
if (finite.length && Math.min(...finite) < 0) {
|
||||||
|
frets = frets.map((f) => (Number.isFinite(f) ? f + 12 : f))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!frets) return []
|
||||||
|
|
||||||
|
const notes = []
|
||||||
|
for (let i = 0; i < Math.min(6, frets.length); i++) {
|
||||||
|
const f = frets[i]
|
||||||
|
if (!Number.isFinite(f) || f < 0) continue // 'x' / muted / impossible
|
||||||
|
notes.push(OPEN_STRING_MIDI[i] + f - 48)
|
||||||
|
}
|
||||||
|
return [...new Set(notes)].sort((a, b) => a - b)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* playChord(pcs, octave?, opts?) → { stop() }
|
||||||
|
*
|
||||||
|
* Simple fallback when all you have is a bare pitch-class set (e.g. a detected
|
||||||
|
* chord's tones, no voicing). Stacks the pcs ASCENDING from the first pc, which
|
||||||
|
* is treated as the bass: each subsequent pc lands in the nearest position
|
||||||
|
* above the previous note — so [7, 11, 5] plays G4-B4-F5, a real shell, not a
|
||||||
|
* scrambled cluster. `octave` places the bass (4 = the octave starting at
|
||||||
|
* C4 = middle C; default 4; piano.js note = (octave − 3) * 12 + pc).
|
||||||
|
*
|
||||||
|
* @param {number[]} pcs pitch classes 0–11, first entry = bass
|
||||||
|
* @param {number} [octave] bass octave (scientific pitch, default 4)
|
||||||
|
* @param {{strumMs?: number, durMs?: number, gain?: number}} [opts] as playVoicing
|
||||||
|
* @returns {{ stop: () => void }}
|
||||||
|
*/
|
||||||
|
export function playChord(pcs, octave = 4, opts = {}) {
|
||||||
|
const clean = (Array.isArray(pcs) ? pcs : []).filter(Number.isFinite).map(mod12)
|
||||||
|
if (clean.length === 0) return { stop() {} }
|
||||||
|
|
||||||
|
const base = (octave - 3) * 12
|
||||||
|
const notes = [base + clean[0]]
|
||||||
|
for (let i = 1; i < clean.length; i++) {
|
||||||
|
const prev = notes[i - 1]
|
||||||
|
let n = base + clean[i]
|
||||||
|
while (n <= prev) n += 12 // nearest position strictly above the last voice
|
||||||
|
notes.push(n)
|
||||||
|
}
|
||||||
|
return playVoicing(notes, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stopAll()
|
||||||
|
*
|
||||||
|
* Immediately releases everything currently sounding or scheduled (quick 40 ms
|
||||||
|
* fade to avoid clicks, then hard-stops the oscillators). Safe to call before
|
||||||
|
* the first play (no-op) and repeatedly. Typical UI pattern: stopAll() before
|
||||||
|
* each playVoicing so previews never layer.
|
||||||
|
*/
|
||||||
|
export function stopAll() {
|
||||||
|
if (!ctx) return
|
||||||
|
const now = ctx.currentTime
|
||||||
|
for (const handle of [...active]) releaseHandle(handle, now)
|
||||||
|
active.clear()
|
||||||
|
}
|
||||||
@@ -0,0 +1,417 @@
|
|||||||
|
// ─── Piano voicing resolver (L-10) ────────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// A pure, deterministic module that generates piano voicings from a chord, for
|
||||||
|
// the Jam Guide's piano instrument tab (GOAL G4: "generate piano voicings from
|
||||||
|
// interval recipes rather than data files — root position, inversions, shells
|
||||||
|
// (1-3-7), rootless A (3-5-7-9) / B (7-9-3-5) — choosing the inversion that
|
||||||
|
// minimizes movement from the previous chord").
|
||||||
|
//
|
||||||
|
// Built on the SAME chord model the rest of the app uses: a chord is
|
||||||
|
// { rootPc, quality } where `rootPc` is a pitch class 0–11 and `quality` is a
|
||||||
|
// CHORD_TYPES key (one of the 14: maj, min, dom7, maj7, min7, dim, dim7,
|
||||||
|
// half_dim, aug, sus4, sus2, maj6, min6, add9). This is exactly what
|
||||||
|
// match.js exposes (`chordRootPC` + a quality token) and what KB stations carry
|
||||||
|
// (`degrees[i]` + `qualities[i]`), so a caller maps a station → a voicing with
|
||||||
|
// no string parsing. Intervals come straight from CHORD_TYPES — never redefined.
|
||||||
|
//
|
||||||
|
// No globals, no Date, no random. Same input → same output, always.
|
||||||
|
//
|
||||||
|
// ─── The `notes` reference convention (READ THIS — D-10/L-11 render against it) ─
|
||||||
|
//
|
||||||
|
// `notes` are ABSOLUTE semitone positions for placing keys on a keyboard, NOT
|
||||||
|
// pitch classes. The reference point is:
|
||||||
|
//
|
||||||
|
// 0 = C of the displayed LOW octave.
|
||||||
|
//
|
||||||
|
// So a value of `n` means "the key `n` semitones above that low C". A renderer
|
||||||
|
// drawing ~2–3 octaves (MiniPiano, D-10) maps note value `n` to key index `n`
|
||||||
|
// from the left edge of its low C. Examples in C (rootPc 0):
|
||||||
|
//
|
||||||
|
// C-major root-position triad → notes [0, 4, 7] (C E G, low octave)
|
||||||
|
// Cmaj7 root-position → notes [0, 4, 7, 11] (C E G B)
|
||||||
|
// Cmaj7 shell (R-3-7) → notes [0, 4, 11]
|
||||||
|
// Dm7 rootless A (3-5-7-9) → notes [17, 21, 24, 28] (F A C E, lifted a register)
|
||||||
|
//
|
||||||
|
// Rootless and shell voicings deliberately sit HIGHER than root position so they
|
||||||
|
// read as right-hand comping shapes — the resolver lifts them by one octave (+12)
|
||||||
|
// from the root anchor by default (the LH would supply the root). `bass` is the
|
||||||
|
// lowest sounding note of whatever was produced, so a renderer can mark the LH
|
||||||
|
// anchor distinctly. All note values are ≥ 0 and span ≤ ~3 octaves (0–36), so a
|
||||||
|
// keyboard of 3 octaves always contains every voicing this module emits.
|
||||||
|
//
|
||||||
|
// `pcs` are the pitch classes (0–11) actually sounding — for highlighting which
|
||||||
|
// keys light up in every octave, and for validation.
|
||||||
|
//
|
||||||
|
// ─── The tone-set contract (what counts as a "correct" pc — READ for C-10) ─────
|
||||||
|
//
|
||||||
|
// For root-position and shell voicings, every pc is a strict chord tone:
|
||||||
|
// pcs ⊆ { (rootPc + i) mod 12 | i ∈ CHORD_TYPES[quality].intervals }, and the
|
||||||
|
// defining tones (the 3rd, and the true 7th when the chord has one) are present.
|
||||||
|
//
|
||||||
|
// Rootless A/B voicings additionally carry the **9th** — the defining colour of
|
||||||
|
// a rootless jazz voicing (the "9" in 3-5-7-9 / 7-9-3-5). The 9th (a 2nd up an
|
||||||
|
// octave, pc = rootPc+2) is an EXTENSION, not a member of the bare triad/7th
|
||||||
|
// interval set, so it is a *deliberate, consonant* added tone — never a "wrong
|
||||||
|
// note". The full legitimate tone set for a quality is therefore the chord tones
|
||||||
|
// PLUS the natural 9th, exported as `voicingToneSet(rootPc, quality, style)` so a
|
||||||
|
// validator (C-10) checks `pcs ⊆ voicingToneSet(...)` rather than the bare triad.
|
||||||
|
// No voicing this module emits ever contains a pc outside that set.
|
||||||
|
|
||||||
|
import { CHORD_TYPES, guideTones } from './theory'
|
||||||
|
|
||||||
|
// ─── Internals ────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
const mod12 = (n) => ((n % 12) + 12) % 12
|
||||||
|
|
||||||
|
// Resolve a quality to its CHORD_TYPES entry, defaulting to maj for anything odd.
|
||||||
|
function chordType(quality) {
|
||||||
|
return CHORD_TYPES[quality] ?? CHORD_TYPES.maj
|
||||||
|
}
|
||||||
|
|
||||||
|
// The chord's interval set (semitones from root), e.g. dom7 → [0,4,7,10].
|
||||||
|
function chordIntervals(quality) {
|
||||||
|
return chordType(quality).intervals
|
||||||
|
}
|
||||||
|
|
||||||
|
// Does this quality carry a TRUE 7th (a minor or major 7th — interval 10 or 11)?
|
||||||
|
// This mirrors theory.guideTones' honest `hasSeventh` (NOT "length >= 4": add9
|
||||||
|
// [0,2,4,7] and maj6/min6 [0,4,7,9] are 4-tone chords with no real 7th).
|
||||||
|
function seventhInterval(quality) {
|
||||||
|
return chordIntervals(quality).find((i) => i === 10 || i === 11)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The 3rd interval. CHORD_TYPES index 1 is the 3rd for triad/7th qualities, but
|
||||||
|
// sus2 [0,2,7] / sus4 [0,5,7] have a 2nd/4th there instead — there is no 3rd, so
|
||||||
|
// we report the suspension tone as the "3rd-slot" colour (what the voicing uses
|
||||||
|
// where a 3rd would go). add9's index 1 is its 9th (pc+2), so we pick the actual
|
||||||
|
// major/minor 3rd (interval 3 or 4) when the set has one, else the index-1 tone.
|
||||||
|
function thirdInterval(quality) {
|
||||||
|
const ints = chordIntervals(quality)
|
||||||
|
const real = ints.find((i) => i === 3 || i === 4) // minor or major 3rd
|
||||||
|
if (real !== undefined) return real
|
||||||
|
return ints[1] // sus2 → 2, sus4 → 5 (the suspension stands in for the 3rd)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The 5th interval the chord actually contains: perfect 5th (7) when present,
|
||||||
|
// else the altered 5th (♭5=6 for dim/dim7/half_dim, #5=8 for aug).
|
||||||
|
function fifthInterval(quality) {
|
||||||
|
const ints = chordIntervals(quality)
|
||||||
|
if (ints.includes(7)) return 7
|
||||||
|
if (ints.includes(6)) return 6
|
||||||
|
if (ints.includes(8)) return 8
|
||||||
|
return 7
|
||||||
|
}
|
||||||
|
|
||||||
|
// The 9th colour for rootless voicings: a 9th is a 2nd up an octave (interval 2
|
||||||
|
// or 14). add9 already lists 2; otherwise we synthesize the natural 9th (14)
|
||||||
|
// from the root — rootless A/B want a 9th on top whether or not the chord names
|
||||||
|
// one. (For min6/maj6 we use the 6th as the rootless "colour" instead — see
|
||||||
|
// rootlessColours below.)
|
||||||
|
const NINTH = 14
|
||||||
|
|
||||||
|
// ─── Voicing builders ─────────────────────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// Each builder returns { pcs, intervalsFromRoot, style, label } where
|
||||||
|
// `intervalsFromRoot` are signed semitone offsets from the chord root in the
|
||||||
|
// builder's own register (root position low; shell/rootless lifted +12). The
|
||||||
|
// register is then optimized for voice-leading in placeVoicing().
|
||||||
|
|
||||||
|
// Root position: every chord tone stacked from the root, low register (root @ 0).
|
||||||
|
function buildRoot(rootPc, quality) {
|
||||||
|
const ints = chordIntervals(quality)
|
||||||
|
return {
|
||||||
|
intervalsFromRoot: [...ints],
|
||||||
|
pcs: ints.map((i) => mod12(rootPc + i)),
|
||||||
|
style: 'root',
|
||||||
|
label: `root position (${labelFor(ints)})`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shell: the skeleton a comping pianist plays — root + 3rd + 7th for a 7th chord,
|
||||||
|
// root + 3rd + 5th for a triad (no 7th to thin to). Lifted +12 (RH shape; LH
|
||||||
|
// would double the root). For sus chords the "3rd" is the suspension tone.
|
||||||
|
function buildShell(rootPc, quality) {
|
||||||
|
const seventh = seventhInterval(quality)
|
||||||
|
const third = thirdInterval(quality)
|
||||||
|
let ints
|
||||||
|
let kind
|
||||||
|
if (seventh !== undefined) {
|
||||||
|
ints = [0, third, seventh] // R-3-7 (the true shell)
|
||||||
|
kind = 'R-3-7'
|
||||||
|
} else {
|
||||||
|
ints = [0, third, fifthInterval(quality)] // triad shell R-3-5
|
||||||
|
kind = 'R-3-5'
|
||||||
|
}
|
||||||
|
const lifted = ints.map((i) => i + 12)
|
||||||
|
return {
|
||||||
|
intervalsFromRoot: lifted,
|
||||||
|
pcs: ints.map((i) => mod12(rootPc + i)),
|
||||||
|
style: 'shell',
|
||||||
|
label: `shell (${kind})`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The 3-5-7-9 / 7-9-3-5 colour tones for a rootless voicing.
|
||||||
|
// For a true-7th chord: use 3, 5, the real 7th, and the 9th (14).
|
||||||
|
// For maj6/min6 (no 7th): treat the 6th (9) as the upper colour in the 7-slot —
|
||||||
|
// GOAL: "min6/maj6 treat the 6th as the 13th-ish color or fall back gracefully".
|
||||||
|
// For triads/sus/add9 (no 7th): there is no rootless 3-5-7-9 — degrade to a
|
||||||
|
// 3-5-9 colour shape and SAY SO in the label.
|
||||||
|
function rootlessColours(quality) {
|
||||||
|
const third = thirdInterval(quality)
|
||||||
|
const fifth = fifthInterval(quality)
|
||||||
|
const seventh = seventhInterval(quality)
|
||||||
|
const ints = chordIntervals(quality)
|
||||||
|
|
||||||
|
if (seventh !== undefined) {
|
||||||
|
return { third, fifth, seventh, ninth: NINTH, full: true, note: '3-5-7-9' }
|
||||||
|
}
|
||||||
|
// maj6 / min6 — the 6th (interval 9) stands in for the 7-slot colour.
|
||||||
|
if (ints.includes(9) && (quality === 'maj6' || quality === 'min6')) {
|
||||||
|
return { third, fifth, seventh: 9, ninth: NINTH, full: true, note: '3-5-6-9' }
|
||||||
|
}
|
||||||
|
// triad / sus / add9 — no 7th and no 6th: a 3-5-9 colour shape (no 7-slot).
|
||||||
|
return { third, fifth, seventh: null, ninth: NINTH, full: false, note: '3-5-9' }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rootless A — voiced low-to-high 3-5-7-9 (the standard "A" form). Lifted +12.
|
||||||
|
function buildRootlessA(rootPc, quality) {
|
||||||
|
const c = rootlessColours(quality)
|
||||||
|
const ints = (c.full ? [c.third, c.fifth, c.seventh, c.ninth] : [c.third, c.fifth, c.ninth])
|
||||||
|
.map((i) => i + 12)
|
||||||
|
ints.sort((a, b) => a - b)
|
||||||
|
return {
|
||||||
|
intervalsFromRoot: ints,
|
||||||
|
pcs: ints.map((i) => mod12(rootPc + i)),
|
||||||
|
style: 'rootlessA',
|
||||||
|
label: c.full
|
||||||
|
? `rootless A (${c.note})`
|
||||||
|
: `rootless A — no 7th, ${c.note} colour`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rootless B — voiced 7-9-3-5: the SAME four colour tones, but with the 7th & 9th
|
||||||
|
// in the lower octave and the 3rd & 5th in the upper, so the shape inverts. We
|
||||||
|
// build it by placing 7 & 9 at +12 and 3 & 5 at +24 (a register higher), which
|
||||||
|
// is what makes A and B alternate cleanly down a chain. Falls back like A.
|
||||||
|
function buildRootlessB(rootPc, quality) {
|
||||||
|
const c = rootlessColours(quality)
|
||||||
|
let ints
|
||||||
|
if (c.full) {
|
||||||
|
ints = [c.seventh + 12, c.ninth + 12, c.third + 24, c.fifth + 24]
|
||||||
|
} else {
|
||||||
|
// no true 7th: 9 below, 3 & 5 above — a 9-3-5 inversion of the A fallback.
|
||||||
|
ints = [c.ninth + 12, c.third + 24, c.fifth + 24]
|
||||||
|
}
|
||||||
|
ints.sort((a, b) => a - b)
|
||||||
|
return {
|
||||||
|
intervalsFromRoot: ints,
|
||||||
|
pcs: ints.map((i) => mod12(rootPc + i)),
|
||||||
|
style: 'rootlessB',
|
||||||
|
label: c.full
|
||||||
|
? `rootless B (7-9-3-5)`
|
||||||
|
: `rootless B — no 7th, 9-3-5 colour`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Human label for a root-position interval set, e.g. [0,4,7,10] → "R-3-5-♭7".
|
||||||
|
function labelFor(ints) {
|
||||||
|
const NAME = {
|
||||||
|
0: 'R', 1: '♭9', 2: '9', 3: '♭3', 4: '3', 5: '4', 6: '♭5',
|
||||||
|
7: '5', 8: '♯5', 9: '6', 10: '♭7', 11: '7',
|
||||||
|
}
|
||||||
|
return ints.map((i) => NAME[mod12(i)] ?? `${i}`).join('-')
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Voice-leading placement ──────────────────────────────────────────────────
|
||||||
|
//
|
||||||
|
// Given a voicing's pitch classes and a `prev` notes array, choose the absolute
|
||||||
|
// register (which octave each pc lands in) that MINIMIZES total voice-leading
|
||||||
|
// movement from prev — the sum, over each voice, of the nearest-semitone
|
||||||
|
// distance to its closest prev note.
|
||||||
|
//
|
||||||
|
// ALGORITHM (documented):
|
||||||
|
// 1. The builder gives `intervalsFromRoot` — a register-anchored shape. We keep
|
||||||
|
// that internal voicing SHAPE (its inversion/spread) intact, and only slide
|
||||||
|
// the whole shape up or down by whole octaves to sit nearest to prev. This
|
||||||
|
// preserves the chosen voicing identity (a shell stays a shell) while still
|
||||||
|
// voice-leading the progression smoothly.
|
||||||
|
// 2. For each candidate octave offset k ∈ {-2..+2} (×12), shift every note by
|
||||||
|
// 12k, keep it inside the renderable window [0, 36], and score it: for each
|
||||||
|
// shifted note find min |note − p| over all p in prev (nearest-voice
|
||||||
|
// distance), and sum. Lowest total wins. Ties → the offset closest to the
|
||||||
|
// builder's default register (k nearest 0), keeping output stable/low.
|
||||||
|
// 3. With no prev, we don't shift — the builder's default register is used, so
|
||||||
|
// the FIRST chord of a progression voices at a predictable height and every
|
||||||
|
// subsequent chord threads from it.
|
||||||
|
//
|
||||||
|
// This is per-shape octave optimization, not per-voice re-inversion: it's
|
||||||
|
// deterministic, cheap, and gives the smooth "shape glides to meet the last
|
||||||
|
// chord" motion the design wants without scrambling the voicing's character.
|
||||||
|
|
||||||
|
function placeVoicing(base, rootPc, prev) {
|
||||||
|
// Absolute notes in the builder's default register (anchor: low C = 0).
|
||||||
|
const def = base.intervalsFromRoot.map((i) => mod12(rootPc) + i)
|
||||||
|
|
||||||
|
if (!Array.isArray(prev) || prev.length === 0) {
|
||||||
|
return clampWindow(def)
|
||||||
|
}
|
||||||
|
|
||||||
|
let bestNotes = null
|
||||||
|
let bestCost = Infinity
|
||||||
|
let bestK = 0
|
||||||
|
for (let k = -2; k <= 2; k++) {
|
||||||
|
const shifted = def.map((n) => n + 12 * k)
|
||||||
|
if (shifted.some((n) => n < 0 || n > 36)) continue
|
||||||
|
let cost = 0
|
||||||
|
for (const n of shifted) {
|
||||||
|
let nearest = Infinity
|
||||||
|
for (const p of prev) nearest = Math.min(nearest, Math.abs(n - p))
|
||||||
|
cost += nearest
|
||||||
|
}
|
||||||
|
// Prefer lower cost; tie-break toward the default register (smaller |k|).
|
||||||
|
if (cost < bestCost || (cost === bestCost && Math.abs(k) < Math.abs(bestK))) {
|
||||||
|
bestCost = cost
|
||||||
|
bestNotes = shifted
|
||||||
|
bestK = k
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return clampWindow(bestNotes ?? def)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keep a voicing inside the renderable window [0, 36] (≤3 octaves) by sliding it
|
||||||
|
// by whole octaves if it pokes out — never reshapes, only translates.
|
||||||
|
function clampWindow(notes) {
|
||||||
|
let out = [...notes]
|
||||||
|
while (Math.min(...out) < 0) out = out.map((n) => n + 12)
|
||||||
|
while (Math.max(...out) > 36) out = out.map((n) => n - 12)
|
||||||
|
return out.sort((a, b) => a - b)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Public API ───────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
const BUILDERS = {
|
||||||
|
root: buildRoot,
|
||||||
|
shell: buildShell,
|
||||||
|
rootlessA: buildRootlessA,
|
||||||
|
rootlessB: buildRootlessB,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default voicing style: shells for 7th chords (the comping skeleton), root
|
||||||
|
// position for plain triads / sus / add9 / 6 chords (nothing to thin to a shell).
|
||||||
|
function defaultStyle(quality) {
|
||||||
|
return seventhInterval(quality) !== undefined ? 'shell' : 'root'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pianoVoicing({ rootPc, quality }, opts?) → voicing
|
||||||
|
*
|
||||||
|
* Generates a single piano voicing for a chord.
|
||||||
|
*
|
||||||
|
* @param {{rootPc:number, quality:string}} chord
|
||||||
|
* rootPc 0–11; quality is a CHORD_TYPES key.
|
||||||
|
* @param {{ style?: 'root'|'shell'|'rootlessA'|'rootlessB', prev?: number[] }} [opts]
|
||||||
|
* style — force a voicing type (else default: shell for 7ths, root else).
|
||||||
|
* prev — the previous voicing's `notes`; when given, the register is
|
||||||
|
* chosen to minimize total voice-leading movement from it.
|
||||||
|
*
|
||||||
|
* @returns {{
|
||||||
|
* notes: number[], // absolute key positions (0 = C of low octave; see header)
|
||||||
|
* pcs: number[], // pitch classes 0–11 sounding (subset of chord tones)
|
||||||
|
* bass: number, // lowest sounding note (LH anchor)
|
||||||
|
* style: string, // 'root' | 'shell' | 'rootlessA' | 'rootlessB'
|
||||||
|
* label: string, // e.g. "rootless A (3-5-7-9)"
|
||||||
|
* }}
|
||||||
|
*
|
||||||
|
* Inline sanity (verified):
|
||||||
|
* pianoVoicing({rootPc:0, quality:'maj7'}, {style:'shell'}).pcs → {0,4,11} (C-E-B)
|
||||||
|
* pianoVoicing({rootPc:2, quality:'min7'}, {style:'rootlessA'}).pcs → {5,9,0,4} = F-A-C-E
|
||||||
|
* pianoVoicing({rootPc:7, quality:'dom7'}, {style:'shell'}).pcs → {7,11,5} (G-B-F)
|
||||||
|
* pianoVoicing({rootPc:9, quality:'aug'}).pcs → {9,1,5} (A-C♯-F)
|
||||||
|
* pianoVoicing({rootPc:0, quality:'sus4'}).pcs → {0,5,7} (C-F-G)
|
||||||
|
* pianoVoicing({rootPc:0, quality:'add9'}).pcs → {0,2,4,7} (C-D-E-G)
|
||||||
|
* A ii–V–I threaded with `prev` (Dm7→G7→Cmaj7, all shells) keeps each chord's
|
||||||
|
* octave register near the last → small total semitone motion (voice-led).
|
||||||
|
*/
|
||||||
|
export function pianoVoicing(chord, opts = {}) {
|
||||||
|
const rootPc = mod12(chord?.rootPc ?? 0)
|
||||||
|
const quality = CHORD_TYPES[chord?.quality] ? chord.quality : 'maj'
|
||||||
|
const style = BUILDERS[opts.style] ? opts.style : defaultStyle(quality)
|
||||||
|
|
||||||
|
const base = BUILDERS[style](rootPc, quality)
|
||||||
|
const placed = placeVoicing(base, rootPc, opts.prev)
|
||||||
|
|
||||||
|
// Dedupe ABSOLUTE notes: two voices can collide on one key (e.g. a forced
|
||||||
|
// rootless sus2 lands the suspended-2nd "3rd-slot" tone and the synthesized
|
||||||
|
// 9th on the same absolute key, pc 2 → notes [26,26,31]). A duplicate value
|
||||||
|
// would stack two highlights on one key in the renderer, so we drop the
|
||||||
|
// redundant collided note here — the single point every style/quality flows
|
||||||
|
// through — keeping the first occurrence. A no-op when nothing collides.
|
||||||
|
const notes = [...new Set(placed)]
|
||||||
|
|
||||||
|
// pcs in the voiced order (low→high), deduped — what keys light up.
|
||||||
|
const pcs = [...new Set(notes.map((n) => mod12(n)))]
|
||||||
|
|
||||||
|
return {
|
||||||
|
notes,
|
||||||
|
pcs,
|
||||||
|
bass: Math.min(...notes),
|
||||||
|
style,
|
||||||
|
label: base.label,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pianoVoicingChain(chords, opts?) → voicing[]
|
||||||
|
*
|
||||||
|
* Convenience: voice a whole progression with voice-leading threading. Each
|
||||||
|
* chord after the first is placed to minimize movement from the previous chord's
|
||||||
|
* `notes`, so a ii–V–I (or any loop) glides smoothly. `chords` is an array of
|
||||||
|
* { rootPc, quality }. `opts.style` (optional) forces one style for the chain;
|
||||||
|
* otherwise each chord uses its own default. Returns the voicings in order.
|
||||||
|
*
|
||||||
|
* D-10/L-11 can call this once per loop to lay out a synced row of MiniPianos.
|
||||||
|
*/
|
||||||
|
export function pianoVoicingChain(chords, opts = {}) {
|
||||||
|
if (!Array.isArray(chords)) return []
|
||||||
|
const out = []
|
||||||
|
let prev = null
|
||||||
|
for (const chord of chords) {
|
||||||
|
const v = pianoVoicing(chord, { style: opts.style, prev })
|
||||||
|
out.push(v)
|
||||||
|
prev = v.notes
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// Re-export the chord-model helper the resolver leans on, so a consumer can ask
|
||||||
|
// "does this chord have a true 7th?" without re-importing theory (handy for
|
||||||
|
// MiniPiano deciding whether to offer rootless A/B toggles).
|
||||||
|
export function hasTrueSeventh(quality) {
|
||||||
|
return seventhInterval(quality) !== undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* voicingToneSet({ rootPc, quality }, style?) → Set<number> of legal pitch classes.
|
||||||
|
*
|
||||||
|
* The complete set of pcs a voicing of this chord may legitimately sound — the
|
||||||
|
* correctness reference for validation (C-10). It is the chord's strict tones
|
||||||
|
* (rootPc + each CHORD_TYPES interval); for rootless styles it ALSO includes the
|
||||||
|
* natural 9th (rootPc+2) and, for maj6/min6, the 6th (already a chord tone) used
|
||||||
|
* as the upper colour. Any `pianoVoicing(...).pcs` is guaranteed ⊆ this set.
|
||||||
|
*
|
||||||
|
* Pass `style` to scope it (root/shell never add the 9th); omit `style` to get
|
||||||
|
* the widest legal set (tones + 9th) — handy as a one-shot "no wrong notes" gate.
|
||||||
|
*/
|
||||||
|
export function voicingToneSet({ rootPc, quality } = {}, style) {
|
||||||
|
const r = mod12(rootPc ?? 0)
|
||||||
|
const q = CHORD_TYPES[quality] ? quality : 'maj'
|
||||||
|
const set = new Set(chordIntervals(q).map((i) => mod12(r + i)))
|
||||||
|
const rootless = style === 'rootlessA' || style === 'rootlessB' || style === undefined
|
||||||
|
if (rootless) set.add(mod12(r + 2)) // the rootless 9th extension
|
||||||
|
return set
|
||||||
|
}
|
||||||
|
|
||||||
|
// guideTones is re-exported so a renderer can co-highlight the 3rd/7th targets
|
||||||
|
// on the same keyboard it draws the voicing on, from one import.
|
||||||
|
export { guideTones }
|
||||||
+100
-25
@@ -520,18 +520,60 @@ export function toRomanNumeral(chordName, keyRoot, keyMode) {
|
|||||||
return isMinorQuality ? rn.toLowerCase() : rn
|
return isMinorQuality ? rn.toLowerCase() : rn
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Repeating progression detection ─────────────────────────────────────────
|
// ─── Repeating progression detection ──────────────────────────────────────────
|
||||||
|
|
||||||
// Returns true if arr is made of a shorter repeating unit (e.g. [A,B,A,B] → true)
|
// True if arr has a "weak period" p < arr.length — i.e. arr[i] === arr[i-p] for
|
||||||
function isPeriodicPattern(arr) {
|
// every i ≥ p, meaning arr is a prefix of some p-periodic infinite sequence.
|
||||||
for (let p = 1; p <= Math.floor(arr.length / 2); p++) {
|
// This rejects not only exact repetitions ([A,B,A,B], p=2) but also self-overlap
|
||||||
if (arr.length % p !== 0) continue
|
// fragments/rotations of a shorter loop ([A,B,A], p=2; [C,G,Am,F,C], p=4) that
|
||||||
const unit = arr.slice(0, p)
|
// would otherwise mint ghost candidates out of a short vamp. A genuine loop is
|
||||||
if (arr.every((v, i) => v === unit[i % p])) return true
|
// never weak-periodic: a loop whose tail restates its head would produce an
|
||||||
|
// adjacent duplicate at the cycle seam, which the window collapse removes.
|
||||||
|
function hasShorterPeriod(arr) {
|
||||||
|
for (let p = 1; p < arr.length; p++) {
|
||||||
|
let periodic = true
|
||||||
|
for (let i = p; i < arr.length; i++) {
|
||||||
|
if (arr[i] !== arr[i - p]) { periodic = false; break }
|
||||||
|
}
|
||||||
|
if (periodic) return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Match one occurrence of `cand` in `win` anchored at `start` (the first chord
|
||||||
|
// must match exactly), tolerating at most ONE edit per cycle: a substitution
|
||||||
|
// (one chord misdetected) or an insertion (one foreign chord slipped between two
|
||||||
|
// loop chords). The remainder after the edit must match exactly. Returns
|
||||||
|
// { end, matched, editPos } — `matched` = window indices that matched a loop
|
||||||
|
// chord, `editPos` = window index of the edit (-1 if the occurrence is exact) —
|
||||||
|
// or null if no match.
|
||||||
|
function matchLoopOccurrence(win, start, cand) {
|
||||||
|
if (win[start] !== cand[0]) return null
|
||||||
|
const matched = [start]
|
||||||
|
let i = start + 1
|
||||||
|
for (let j = 1; j < cand.length; j++) {
|
||||||
|
if (i >= win.length) return null
|
||||||
|
if (win[i] === cand[j]) { matched.push(i); i++; continue }
|
||||||
|
|
||||||
|
// First mismatch — the single allowed edit. Fork the two readings; each
|
||||||
|
// requires the rest of the candidate to match exactly from where it lands.
|
||||||
|
const exactFrom = (wi, cj) => {
|
||||||
|
const tail = []
|
||||||
|
for (; cj < cand.length; cj++, wi++) {
|
||||||
|
if (wi >= win.length || win[wi] !== cand[cj]) return null
|
||||||
|
tail.push(wi)
|
||||||
|
}
|
||||||
|
return { end: wi, tail }
|
||||||
|
}
|
||||||
|
const ins = exactFrom(i + 1, j) // win[i] is a foreign inserted chord
|
||||||
|
const sub = exactFrom(i + 1, j + 1) // win[i] is cand[j] misdetected
|
||||||
|
const hit = ins ?? sub // insertion keeps one more matched chord
|
||||||
|
if (!hit) return null
|
||||||
|
return { end: hit.end, matched: [...matched, ...hit.tail], editPos: i }
|
||||||
|
}
|
||||||
|
return { end: i, matched, editPos: -1 }
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the lexicographically smallest rotation so the same loop always
|
// Returns the lexicographically smallest rotation so the same loop always
|
||||||
// produces the same string regardless of where in the cycle we currently are.
|
// produces the same string regardless of where in the cycle we currently are.
|
||||||
function canonicalize(pattern) {
|
function canonicalize(pattern) {
|
||||||
@@ -544,42 +586,75 @@ function canonicalize(pattern) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* detectRepeatingProgression(history) → chord[] or null
|
* detectRepeatingProgression(history) → chord[] or null (task L-30)
|
||||||
*
|
*
|
||||||
* Tests every unique subsequence of every length (not just the tail) so the
|
* Finds the loop the musician is playing NOW in the recent chord history.
|
||||||
* result is stable regardless of where in the loop the musician currently is.
|
* Candidates are contiguous slices (lengths 2–8) of the last-32 window with
|
||||||
* Returns the canonical (rotation-normalised) form of the best pattern found.
|
* consecutive duplicate commits collapsed; candidates that are self-overlaps
|
||||||
|
* of a shorter period are rejected (see hasShorterPeriod). Each candidate is
|
||||||
|
* scored by recency-weighted COVERAGE: non-overlapping occurrences are counted
|
||||||
|
* with at most one substitution or insertion per cycle, every matched chord
|
||||||
|
* adds its recency weight, every edit subtracts the weight at the edit slot.
|
||||||
|
* Linear coverage (not reps × len²) means a ghost pattern straddling noise can
|
||||||
|
* never outscore the true loop, and exponential recency decay means the current
|
||||||
|
* section outscores a longer stale one. Requires ≥2 EXACT occurrences: an
|
||||||
|
* edit-tolerant occurrence corroborates a loop but cannot establish it — a
|
||||||
|
* loop means the sequence came back exactly, and a ghost slice that absorbs a
|
||||||
|
* noise chord into itself rarely recurs exactly (only phase-locked corruption
|
||||||
|
* of the same slot by the same chord can make one recur — and such data is
|
||||||
|
* genuinely periodic at that longer length). Returns the canonical
|
||||||
|
* (rotation-normalised) best pattern.
|
||||||
*/
|
*/
|
||||||
export function detectRepeatingProgression(history) {
|
export function detectRepeatingProgression(history) {
|
||||||
if (!history || history.length < 6) return null
|
if (!history || history.length < 6) return null
|
||||||
|
|
||||||
const win = history.slice(-32)
|
// Collapse consecutive duplicate commits — a chord re-committed back-to-back
|
||||||
let best = null, bestScore = 0
|
// is the same loop slot, not two. Non-adjacent repeats (e.g. Em … Em inside a
|
||||||
|
// 7-chord form) are meaningful and untouched.
|
||||||
|
const raw = history.slice(-32)
|
||||||
|
const win = raw.filter((c, i) => i === 0 || c !== raw[i - 1])
|
||||||
|
const n = win.length
|
||||||
|
if (n < 4) return null // shortest loop (2 chords) × 2 reps
|
||||||
|
|
||||||
for (let len = 2; len <= 6; len++) {
|
// Recency weight per window slot: newest chord weighs 1, each step back
|
||||||
if (len * 2 > win.length) break
|
// decays by 0.9 (half-life ≈ 6.6 chords).
|
||||||
|
const RECENCY = 0.9
|
||||||
|
const weight = Array.from({ length: n }, (_, i) => RECENCY ** (n - 1 - i))
|
||||||
|
|
||||||
|
let best = null
|
||||||
|
let bestScore = 0
|
||||||
|
|
||||||
|
for (let len = 2; len <= 8; len++) {
|
||||||
|
if (len * 2 > n) break
|
||||||
const seen = new Set()
|
const seen = new Set()
|
||||||
|
|
||||||
for (let start = 0; start <= win.length - len; start++) {
|
for (let start = 0; start <= n - len; start++) {
|
||||||
const candidate = win.slice(start, start + len)
|
const candidate = win.slice(start, start + len)
|
||||||
const key = candidate.join('\0')
|
const key = candidate.join('\0')
|
||||||
if (seen.has(key)) continue
|
if (seen.has(key)) continue
|
||||||
seen.add(key)
|
seen.add(key)
|
||||||
|
|
||||||
// A pattern that is itself a repetition of something shorter will be
|
if (hasShorterPeriod(candidate)) continue
|
||||||
// found at that shorter length — skip it here to avoid inflating scores.
|
|
||||||
if (len >= 4 && isPeriodicPattern(candidate)) continue
|
|
||||||
|
|
||||||
let reps = 0, i = 0
|
let exactOccurrences = 0
|
||||||
while (i <= win.length - len) {
|
let score = 0
|
||||||
if (candidate.every((c, j) => c === win[i + j])) { reps++; i += len }
|
let i = 0
|
||||||
else i++
|
while (i < n) {
|
||||||
|
const occ = matchLoopOccurrence(win, i, candidate)
|
||||||
|
// A 2-chord candidate may not take a substitution (1 matched chord is
|
||||||
|
// no evidence); insertions keep matched === len and stay allowed.
|
||||||
|
if (occ && occ.matched.length >= 2) {
|
||||||
|
if (occ.editPos < 0) exactOccurrences++
|
||||||
|
for (const p of occ.matched) score += weight[p]
|
||||||
|
if (occ.editPos >= 0) score -= weight[occ.editPos]
|
||||||
|
i = occ.end
|
||||||
|
} else {
|
||||||
|
i++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reps < 2) continue
|
if (exactOccurrences < 2) continue // implies occurrences ≥ 2
|
||||||
|
|
||||||
const score = reps * len * len // square length — prevents sub-patterns from beating full loop
|
|
||||||
if (score > bestScore) {
|
if (score > bestScore) {
|
||||||
bestScore = score
|
bestScore = score
|
||||||
best = candidate
|
best = candidate
|
||||||
|
|||||||
+36
-2
@@ -52,6 +52,9 @@ const GUITAR_SHAPES = {
|
|||||||
{ label: 'Open Am7', type: 'open', onlyRoot: 9, frets: ['x',0,2,0,1,0], fingers: [0,0,2,0,1,0] },
|
{ label: 'Open Am7', type: 'open', onlyRoot: 9, frets: ['x',0,2,0,1,0], fingers: [0,0,2,0,1,0] },
|
||||||
{ label: 'Open Dm7', type: 'open', onlyRoot: 2, frets: ['x','x',0,2,1,1], fingers: [0,0,0,3,1,2] },
|
{ label: 'Open Dm7', type: 'open', onlyRoot: 2, frets: ['x','x',0,2,1,1], fingers: [0,0,0,3,1,2] },
|
||||||
],
|
],
|
||||||
|
// dim intentionally stays at 2 shapes: in real guitar practice the bare
|
||||||
|
// diminished TRIAD is almost always played as dim7 or m7♭5 (which contain
|
||||||
|
// it) — a third stand-alone triad grip would be contrived. (Task P-62 audit.)
|
||||||
dim: [
|
dim: [
|
||||||
{ label: 'A Barre', type: 'barre', rootStr: 5, offsets: ['x',0,1,2,1,'x'], fingers: [0,1,2,4,3,0] },
|
{ label: 'A Barre', type: 'barre', rootStr: 5, offsets: ['x',0,1,2,1,'x'], fingers: [0,1,2,4,3,0] },
|
||||||
{ label: 'Compact', type: 'barre', rootStr: 4, offsets: ['x','x',0,1,3,1], fingers: [0,0,1,2,4,3] },
|
{ label: 'Compact', type: 'barre', rootStr: 4, offsets: ['x','x',0,1,3,1], fingers: [0,0,1,2,4,3] },
|
||||||
@@ -59,10 +62,16 @@ const GUITAR_SHAPES = {
|
|||||||
dim7: [
|
dim7: [
|
||||||
{ label: 'Movable Box', type: 'barre', rootStr: 5, offsets: ['x',0,1,2,1,2], fingers: [0,1,2,4,3,4] },
|
{ label: 'Movable Box', type: 'barre', rootStr: 5, offsets: ['x',0,1,2,1,2], fingers: [0,1,2,4,3,4] },
|
||||||
{ label: 'Compact', type: 'barre', rootStr: 4, offsets: ['x','x',0,1,0,1], fingers: [0,0,1,2,3,4] },
|
{ label: 'Compact', type: 'barre', rootStr: 4, offsets: ['x','x',0,1,0,1], fingers: [0,0,1,2,3,4] },
|
||||||
|
// P-62: standard drop-3 dim7 with the root on the 6th string (R–♭♭7–♭3–♭5;
|
||||||
|
// e.g. G°7 = 3x232x) — jazzguitar.be diminished-chord chart shape.
|
||||||
|
{ label: 'Drop 3', type: 'barre', rootStr: 6, offsets: [0,'x',-1,0,-1,'x'], fingers: [2,0,1,3,1,0] },
|
||||||
],
|
],
|
||||||
aug: [
|
aug: [
|
||||||
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,3,2,1,1,0], fingers: [1,4,3,2,2,1] },
|
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,3,2,1,1,0], fingers: [1,4,3,2,2,1] },
|
||||||
{ label: 'Compact', type: 'barre', rootStr: 5, offsets: ['x',0,3,2,2,'x'], fingers: [0,1,4,2,3,0] },
|
{ label: 'Compact', type: 'barre', rootStr: 5, offsets: ['x',0,3,2,2,'x'], fingers: [0,1,4,2,3,0] },
|
||||||
|
// P-62: the top-four-string aug grip (R–♯5–R–3; e.g. D+ = xx0332) —
|
||||||
|
// standard chord-dictionary shape, movable like the file's other D shapes.
|
||||||
|
{ label: 'D Shape', type: 'barre', rootStr: 4, offsets: ['x','x',0,3,3,2], fingers: [0,0,1,3,4,2] },
|
||||||
],
|
],
|
||||||
sus4: [
|
sus4: [
|
||||||
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,2,2,2,0,0], fingers: [1,2,3,4,1,1], barre: { fromStr: 1, toStr: 6, fo: 0 } },
|
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,2,2,2,0,0], fingers: [1,2,3,4,1,1], barre: { fromStr: 1, toStr: 6, fo: 0 } },
|
||||||
@@ -81,16 +90,34 @@ const GUITAR_SHAPES = {
|
|||||||
half_dim: [
|
half_dim: [
|
||||||
{ label: 'A Barre', type: 'barre', rootStr: 5, offsets: ['x',0,1,0,1,'x'], fingers: [0,1,2,0,3,0] },
|
{ label: 'A Barre', type: 'barre', rootStr: 5, offsets: ['x',0,1,0,1,'x'], fingers: [0,1,2,0,3,0] },
|
||||||
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,1,2,0,0,'x'], fingers: [1,2,3,1,1,0], barre: { fromStr: 2, toStr: 6, fo: 0 } },
|
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,1,2,0,0,'x'], fingers: [1,2,3,1,1,0], barre: { fromStr: 2, toStr: 6, fo: 0 } },
|
||||||
|
// P-62: standard drop-3 m7♭5 with the root on the 6th string (R–♭7–♭3–♭5;
|
||||||
|
// e.g. Gø7 = 3x332x) — jazzguitar.be m7♭5 chart shape.
|
||||||
|
{ label: 'Drop 3', type: 'barre', rootStr: 6, offsets: [0,'x',0,0,-1,'x'], fingers: [2,0,3,4,1,0] },
|
||||||
|
// P-62: the one-finger-barre m7♭5 (R–♭5–♭7–♭3; e.g. Dø7 = xx0111) —
|
||||||
|
// standard chord-dictionary grip, movable.
|
||||||
|
{ label: 'D Shape', type: 'barre', rootStr: 4, offsets: ['x','x',0,1,1,1], fingers: [0,0,1,3,3,3], barre: { fromStr: 1, toStr: 3, fo: 1 } },
|
||||||
],
|
],
|
||||||
maj6: [
|
maj6: [
|
||||||
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,2,2,1,2,0], fingers: [1,3,4,2,4,1], barre: { fromStr: 1, toStr: 6, fo: 0 } },
|
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,2,2,1,2,0], fingers: [1,3,4,2,4,1], barre: { fromStr: 1, toStr: 6, fo: 0 } },
|
||||||
{ label: 'A Barre', type: 'barre', rootStr: 5, offsets: ['x',0,2,2,2,2], fingers: [0,1,2,3,4,4], barre: { fromStr: 1, toStr: 2, fo: 2 } },
|
{ label: 'A Barre', type: 'barre', rootStr: 5, offsets: ['x',0,2,2,2,2], fingers: [0,1,2,3,4,4], barre: { fromStr: 1, toStr: 2, fo: 2 } },
|
||||||
|
// P-62: the D6 grip (R–5–6–3; e.g. D6 = xx0202) — standard chord-dictionary
|
||||||
|
// shape; the swing/Western-swing four-string 6th, movable.
|
||||||
|
{ label: 'D Shape', type: 'barre', rootStr: 4, offsets: ['x','x',0,2,0,2], fingers: [0,0,1,3,1,4], barre: { fromStr: 2, toStr: 4, fo: 0 } },
|
||||||
],
|
],
|
||||||
min6: [
|
min6: [
|
||||||
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,2,2,0,2,0], fingers: [1,3,4,1,4,1], barre: { fromStr: 1, toStr: 6, fo: 0 } },
|
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,2,2,0,2,0], fingers: [1,3,4,1,4,1], barre: { fromStr: 1, toStr: 6, fo: 0 } },
|
||||||
|
// P-62: the Dm6 grip (R–5–6–♭3; e.g. Dm6 = xx0201) — standard
|
||||||
|
// chord-dictionary shape, movable.
|
||||||
|
{ label: 'D Shape', type: 'barre', rootStr: 4, offsets: ['x','x',0,2,0,1], fingers: [0,0,1,3,1,2], barre: { fromStr: 2, toStr: 4, fo: 0 } },
|
||||||
|
// P-62: the movable open-Am6 shape (R–5–R–♭3–6; x02212 open, e.g.
|
||||||
|
// Bm6 = x24344) — standard barre-chart m6 entry.
|
||||||
|
{ label: 'A Barre', type: 'barre', rootStr: 5, offsets: ['x',0,2,2,1,2], fingers: [0,1,3,3,2,4], barre: { fromStr: 3, toStr: 4, fo: 2 } },
|
||||||
],
|
],
|
||||||
add9: [
|
add9: [
|
||||||
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,2,4,1,0,2], fingers: [1,2,4,3,1,1], barre: { fromStr: 1, toStr: 6, fo: 0 } },
|
{ label: 'E Barre', type: 'barre', rootStr: 6, offsets: [0,2,4,1,0,2], fingers: [1,2,4,3,1,1], barre: { fromStr: 1, toStr: 6, fo: 0 } },
|
||||||
|
// P-62: the movable core of the standard Aadd9 chart grip (x02420 open;
|
||||||
|
// the open high-e doubling doesn't move, so it is muted here): R–5–9–3.
|
||||||
|
{ label: 'A Shape', type: 'barre', rootStr: 5, offsets: ['x',0,2,4,2,'x'], fingers: [0,1,2,4,3,0] },
|
||||||
{ label: 'Open Cadd9', type: 'open', onlyRoot: 0, frets: ['x',3,2,0,3,0], fingers: [0,3,2,0,4,0] },
|
{ label: 'Open Cadd9', type: 'open', onlyRoot: 0, frets: ['x',3,2,0,3,0], fingers: [0,3,2,0,4,0] },
|
||||||
{ label: 'Open Gadd9', type: 'open', onlyRoot: 7, frets: [3,2,0,2,3,3], fingers: [2,1,0,3,4,4] },
|
{ label: 'Open Gadd9', type: 'open', onlyRoot: 7, frets: [3,2,0,2,3,3], fingers: [2,1,0,3,4,4] },
|
||||||
{ label: 'Open Dadd9', type: 'open', onlyRoot: 2, frets: ['x','x',0,2,3,0], fingers: [0,0,0,1,3,0] },
|
{ label: 'Open Dadd9', type: 'open', onlyRoot: 2, frets: ['x','x',0,2,3,0], fingers: [0,0,0,1,3,0] },
|
||||||
@@ -504,8 +531,11 @@ export function getGuitarVoicings(chordName) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// barre shape: compute rootFret on rootStr
|
// barre shape: compute rootFret on rootStr.
|
||||||
const strIdx = shape.rootStr - 1 // 0=s6 … 5=s1
|
// OPEN is ordered [s6 … s1] and rootStr is 1-indexed with 6 = low E,
|
||||||
|
// so string N lives at index 6 - N (same convention as ChordDiagram.jsx
|
||||||
|
// and chordAudio.guitarShapeToNotes).
|
||||||
|
const strIdx = 6 - shape.rootStr // 0=s6 … 5=s1
|
||||||
const openPc = OPEN[strIdx]
|
const openPc = OPEN[strIdx]
|
||||||
let rootFret = (rootPc - openPc + 12) % 12
|
let rootFret = (rootPc - openPc + 12) % 12
|
||||||
|
|
||||||
@@ -561,3 +591,7 @@ export function getPianoTechniques(chordName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export { parseChord }
|
export { parseChord }
|
||||||
|
|
||||||
|
// D-21: expose the raw shape library for the VoicingBrowser (read-only consumer —
|
||||||
|
// it renders shapes via ChordDiagram and plays them via chordAudio.guitarShapeToNotes).
|
||||||
|
export { GUITAR_SHAPES }
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ export default defineConfig({
|
|||||||
plugins: [react(), tailwindcss()],
|
plugins: [react(), tailwindcss()],
|
||||||
base: './', // relative paths so Electron can load files from disk
|
base: './', // relative paths so Electron can load files from disk
|
||||||
server: {
|
server: {
|
||||||
|
// Explicit IPv4 bind: with plain `localhost`, node ≥17 can bind ::1 only,
|
||||||
|
// which browsers/wait-on may fail to reach (seen on Windows + node 24).
|
||||||
|
host: '127.0.0.1',
|
||||||
port: 5173,
|
port: 5173,
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
|||||||
Reference in New Issue
Block a user