docs: jam knowledgebase plan, backlog, curricula + /kb-expand loop skill

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
vadimwit
2026-06-12 12:31:45 +01:00
parent f583979b3e
commit fdb2ce8175
6 changed files with 727 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
---
name: kb-expand
description: Expand the JamBuddy jam knowledgebase by exactly one style × instrument cell — research, author, validate, commit. Run repeatedly (or via /loop) to fill the backlog in docs/kb-backlog.md.
---
# KB Expand — one cell per session
You are expanding JamBuddy's jam knowledgebase: intermediate-level standard progressions and ways to play them, per style × instrument. **Do exactly one cell, end to end.** Small, validated, committed.
## Steps
### 1. Orient (always, every session)
Read, in this order:
- `docs/kb-plan.md` — architecture, schema conventions, quality gates, success criteria
- `docs/kb-backlog.md` — the queue
- `src/data/kb/SCHEMA.md` and the gold standard `src/data/kb/jazz/guitar.js`**if they exist**
- `docs/progression-repertoire.md` §1 — cross-check progressions for the style
- `docs/learn-curriculum.md` — the intermediate level definition for the instrument
### 2. Claim a cell
Take the **first `todo` cell** in the backlog (respect the order: bootstrap → guitar → piano → bass). Mark it `in-progress` in `docs/kb-backlog.md`.
**If the foundation doesn't exist yet (no `src/data/kb/`), this session is Session 0:** build `src/data/kb/` with `index.js` registry, `SCHEMA.md` (formats from kb-plan.md §1, one fully-worked example, the musician checklist from §2), `scripts/validate-kb.mjs` (all mechanical checks from kb-plan.md §2 — especially the pitch-class verification of guitar shapes against chord qualities from `src/lib/theory.js` CHORD_TYPES), and the **jazz/guitar** cell as the gold standard. That is one full session; stop after it.
### 3. Research
Dispatch 1-2 web-research subagents for the claimed style × instrument:
- the style's standard progressions (verify against `docs/progression-repertoire.md`; add style-specific ones with named sources)
- 2-3 genuinely different intermediate ways to play each progression on this instrument (voicings with exact frets/fingerings for guitar, degree recipes for piano, line patterns for bass)
- comping rhythm(s) characteristic of the style, improv guidance (scales over each chord, target notes, 1-2 licks)
- require named sources/URLs in the agent's report
### 4. Author
Write `src/data/kb/<style>/progressions.js` (if new style) and `src/data/kb/<style>/<instrument>.js` per SCHEMA.md. Key-agnostic only: degrees and movable shapes (`rootStr` + `offsets`), open shapes with `onlyRoot`. Qualities must be keys of `CHORD_TYPES` in `src/lib/theory.js`. Register the style in `src/data/kb/index.js`.
### 5. Validate — hard gate
- `node scripts/validate-kb.mjs` must pass. Fix content, don't weaken the validator.
- Run the musician checklist in SCHEMA.md; cut or fix anything that fails it.
- `npm run build` must pass.
### 6. Record and commit
- Backlog: mark the cell `done (YYYY-MM-DD, N progressions × M plays)`.
- Commit on the current branch: `kb: add <style> <instrument> pack` (or `kb: bootstrap foundation + jazz guitar gold standard`). Do not push unless asked.
### 7. Report
Tell the user: what was added (progressions, plays, sources), validator result, and **the next cell in the queue**. If a UI milestone in the backlog just became unblocked (e.g. Jam Guide MVP after cell 0), say so explicitly.
## Rules
- One cell per invocation. Never start a second cell, even if the first went quickly.
- Never commit content that fails the validator; never relax a validator rule to make content pass — flag the conflict to the user instead.
- Intermediate level: no 5+ fret stretches, no advanced-only voicings without an intermediate alternative in the same play set.
- Plays per progression must be idiomatically different (register/density/technique), not transpositions of each other.
+110
View File
@@ -0,0 +1,110 @@
# GOAL — From Detection to Direction
WhatTheFlat already solves the hard live problem: **knowing what key and chords people are playing in a jam, in real time.** This document defines the next level, in two parts:
1. **Chord progressions** — make it easier to work with *different* progressions: a bigger genre repertoire, clearer "1-5-4"-style readout of the detected loop, a builder where you place chords yourself, and alternative voicings for every chord in a progression.
2. **Learn** — expand the education section for the player who already knows the basics and is confident enough to jam, but wants to go next level.
Supporting research and full repertoires live in:
- [`docs/progression-repertoire.md`](docs/progression-repertoire.md) — genre-by-genre progression tables, substitution rules, voicing data sources, UX patterns from existing tools
- [`docs/learn-curriculum.md`](docs/learn-curriculum.md) — intermediate training methods for guitar, piano, and bass, with drills and how app features map onto them
- [`docs/kb-plan.md`](docs/kb-plan.md) — the **jam knowledgebase**: styles × instruments × progressions × voicings, the `/kb-expand` session loop that grows it ([`docs/kb-backlog.md`](docs/kb-backlog.md)), and the **Jam Guide** panel that renders it live at the bottom of the app
---
## Part 1 — Chord progressions
### Where we are
- `PROGRESSIONS` in `src/lib/theory.js` holds **14 hardcoded progressions across 7 genres** (Pop, Blues, Folk, Jazz, Rock, '50s, Flamenco). These drive `ProgressionSuggestions.jsx`.
- `detectRepeatingProgression()` finds the repeating loop in chord history; `ProgressionBanner.jsx` already shows it with Roman numerals (IVIV) via `toRomanNumeral()`.
- `EducationPanel.jsx` + `src/lib/education.js` carry 15 famous progressions with substitutions and style variations.
- `src/lib/voicings.js` has ~50 guitar shapes (open + barre) across 14 chord types; no inversions, no triad string-sets, thin piano coverage.
- There is **no way to enter or arrange a progression manually** — everything is detection-driven.
### Goals
**G1 — Expanded genre repertoire (data, not code).**
Grow `PROGRESSIONS` from 7 to ~12 genres using the researched tables in `docs/progression-repertoire.md`: Funk (Dorian i7IV7 vamps), Reggae (two-chord skanks), Country (V/V secondary dominant moves), R&B/Neo-soul (iiiviiiV, 6-2-5-1), Gospel (chained 2-5-1s), plus blues variants (quick-change, minor blues) and the J-pop "Royal Road" (IVViiivi). Progressions stay in the existing `{ name, rn, degrees }` format so suggestions, Roman numerals and key mapping keep working unchanged.
**G2 — Numeral clarity ("is this 1-5-4?").**
The loop banner already shows Roman numerals; add a **Nashville-number display option** (1-5-4 instead of I-V-IV) since that is how musicians call changes at a jam. One formatting layer over `toRomanNumeral`, toggled in Settings.
**G3 — Progression Builder (drag and drop).**
A panel where the user assembles a progression by hand:
- A **key-relative chord palette** (Hookpad's best idea): the diatonic chords of the current detected/locked key, one tap to add, with borrowed-chord palette (iv, ♭VII, ♭VI, V/V…) one level deeper.
- Slots that can be **reordered by drag and drop**, with live Roman/Nashville numerals under each chord.
- Tap any slot → **alternative voicings** for that chord (G4).
- Seeded from the detected loop ("send loop to builder") so a jam can be captured, edited, and varied.
- Variation buttons per chord powered by the substitution taxonomy (diatonic swap, borrow, secondary dominant, 7th/sus/add9 color) — the rules are in `docs/progression-repertoire.md` §2.
**G4 — Alternative voicings per progression chord.**
- **Guitar:** extend `voicings.js` with CAGED positions and triads on string-sets (top-3 / middle-3), or adopt the MIT-licensed [`tombatossals/chords-db`](https://github.com/tombatossals/chords-db) dataset (multiple positions per chord, JSON, with a companion React SVG renderer).
- **Piano:** generate 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 (voice-leading distance).
- Surface these in the Builder (G3) and in `CurrentJamPanel` voicing strips.
---
## Part 2 — Learn: basics → jam-ready next level
### Audience
Not step one. The target player already knows open/barre chords (guitar), triads and simple lead sheets (piano), roots and simple scales (bass) — and is confident enough to show up at a jam. The Learn section's job is to take them **from "can survive a jam" to "makes the jam better."**
### What the research says (full detail in `docs/learn-curriculum.md`)
Across guitar, piano, and bass pedagogy (Berklee methods, Justin Guitar grades 46, Tomo Fujita, Mark Levine, Open Studio, PianoGroove, Scott's Bass Lessons, TalkingBass, Ed Friedland), the intermediate-to-advanced jump converges on four pillars:
| Pillar | Guitar | Piano | Bass |
|---|---|---|---|
| **Fretboard/keyboard liberation** | CAGED, triads on string sets, connecting pentatonic boxes | Inversions in all keys, voice leading | Neck zones, chord-tone arpeggios everywhere |
| **Playing the changes** | Chord-tone targeting, guide tones (3rds & 7ths) | Shell + rootless voicings, sus/add9 colors | Walking lines, chromatic approach notes |
| **Ensemble skills** | Small voicings, register discipline, comping | Comping rhythms (Charleston…), "rule of 1", staying out of the bass lane | Pocket/drummer lock, ghost notes, subdivision switching |
| **Functional ears** | Hearing I-IV-V / vi-IV-I-V by bass line | Nashville numbers, 12-key transposition | Singing root movement, predicting the V |
### Goals
**L1 — Practice drills tab.**
Add a drills library to the Learn section: per instrument, per pillar, the concrete drills from the curriculum doc (e.g. "first note after every chord change = the 3rd", "Charleston comping ladder", "W|H|H chromatic walkup"). Keyed to the *current detected key and loop* so every drill is in today's jam context, not abstract C major.
**L2 — Detection-powered feedback (the unfair advantage).**
No practice app can hear the player; this one can. Phased:
- **Target-note highlighting:** on each detected chord change, highlight the new chord's 3rd/7th on the fretboard/piano for a beat (drill scaffold — uses existing tier rendering).
- **Next-chord preview tier:** when a loop is detected, show the *upcoming* chord's root and its chromatic approach notes (the bassist's walking-line scaffold).
- **Chord-tone hit rate:** classify detected notes against the current chord (chord tone / scale tone / outside) and show a session score.
- **Pocket report:** extend the onset/BPM pipeline to show timing drift against the established grid.
**L3 — Ear training from your own jam.**
A quiz mode that hides the chord banner and asks the user to name the progression in numbers before revealing — using the *user's own chord history* as the corpus. Converts the existing detection + `toRomanNumeral` into the functional ear training every method prescribes.
**L4 — Mode-difference teaching.**
When the user manually switches mode (the documented K-S limitation — by design), briefly highlight the *difference notes* (e.g. the raised 6th going minor → Dorian) on the instrument views. Turns a limitation into a lesson.
---
## What we need to go next level — priorities
| # | Item | Effort | Why first |
|---|---|---|---|
| 1 | **G1** Genre repertoire expansion | S (data only) | Immediate value, zero architectural risk |
| 2 | **G2** Nashville number toggle | S | Directly answers "is it 1-5-4", jam-native language |
| 3 | **G3** Progression Builder MVP (palette + reorder + numerals) | M | The single most-requested workflow gap |
| 4 | **L1** Drills tab seeded from curriculum doc | M (content + UI) | Makes Learn level-appropriate |
| 5 | **G4** Voicing alternatives (guitar string-sets + piano recipes) | M | Feeds both Builder and Learn |
| 6 | **L2** Target-note highlighting + next-chord preview | M | First detection-powered trainer, reuses tier rendering |
| 7 | **L3** Ear-training quiz on own history | M | High pedagogical value, small surface |
| 8 | **L2** Hit-rate scoring + pocket report | L | Needs tuning of pitch/onset classification |
| 9 | **G3** Builder phase 2: borrowed palette, variation buttons, loop import | L | Builds on MVP + substitution rules |
| 10 | **KB** Knowledgebase + Jam Guide panel (see `docs/kb-plan.md`) | L, but looped in S-sized sessions via `/kb-expand` | The style × instrument playbook that powers improv learning |
### How we execute
Knowledgebase work runs as **looped sessions**: `/kb-expand` does exactly one style × instrument cell (research → author → validate → commit), driven by the queue in `docs/kb-backlog.md`. Tranches run on a dedicated branch — e.g. an hourly `/loop /kb-expand` for a working day — and **end with a pull request** so a whole tranche is reviewed in one place. First tranche (started 2026-06-12, branch `kb-expansion`): Session 0 bootstrap + the first guitar style cells, hourly for 8 hours, PR to `main` at the end.
### Definition of "next level" (success criteria)
- A jammer can glance at the app and call the loop in numbers ("it's a 1-5-4").
- Suggestions cover the genres people actually jam (funk/reggae/R&B/gospel included), not just pop/blues.
- A user can lay out their own progression, drag chords around, and see 3+ ways to voice every chord on their instrument.
- The Learn section gives an intermediate guitarist, pianist, or bassist a *specific* next drill in the key they're jamming in right now — and at least one drill where the app verifies them by listening.
+65
View File
@@ -0,0 +1,65 @@
# KB Expansion Backlog
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)`.
## Phase 0 — Foundation (must be first)
| # | Cell | Status |
|---|---|---|
| 0 | Bootstrap: `src/data/kb/` + `SCHEMA.md` + `scripts/validate-kb.mjs` + `kb/index.js` + **jazz/guitar gold standard** | todo |
## Guitar
| # | Style | Status |
|---|---|---|
| 1 | Jazz (part of bootstrap) | todo |
| 2 | Blues | todo |
| 3 | Rock | todo |
| 4 | Bossa Nova | todo |
| 5 | Funk | todo |
| 6 | Reggae | todo |
| 7 | Country / Folk | todo |
| 8 | R&B / Neo-soul | todo |
| 9 | Gospel | todo |
| 10 | Pop | todo |
## Piano
| # | Style | Status |
|---|---|---|
| 11 | Jazz | todo |
| 12 | Blues | todo |
| 13 | Bossa Nova | todo |
| 14 | Gospel | todo |
| 15 | R&B / Neo-soul | todo |
| 16 | Pop | todo |
| 17 | Rock | todo |
| 18 | Funk | todo |
| 19 | Country / Folk | todo |
| 20 | Reggae | todo |
## Bass
| # | Style | Status |
|---|---|---|
| 21 | Blues | todo |
| 22 | Jazz | todo |
| 23 | Funk | todo |
| 24 | Reggae | todo |
| 25 | Rock | todo |
| 26 | Bossa Nova | todo |
| 27 | R&B / Neo-soul | todo |
| 28 | Country / Folk | todo |
| 29 | Gospel | todo |
| 30 | Pop | todo |
## UI milestones (interleave when their data exists)
| Milestone | Depends on | Status |
|---|---|---|
| Jam Guide MVP (panel, matching, `ChordDiagram.jsx`, live sync) | cell 0 | todo |
| `MiniPiano.jsx` + recipe resolver | cell 11 | todo |
| Bass pattern renderer | cell 21 | todo |
| Improv layer (licks/tabs display) | a few guitar cells | todo |
> 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.
+223
View File
@@ -0,0 +1,223 @@
# Knowledgebase Plan — Styles × Instruments × Progressions × Voicings
The plan for building JamBuddy's **jam knowledgebase**: an intermediate guide to the standard progressions of each style (Jazz, Blues, Rock, Bossa Nova, …) and the different ways to *play* them per instrument (guitar first, then piano, then bass) — expandable one session at a time via a repeatable loop, and rendered live in a large **Jam Guide** panel at the bottom of the app.
Three principles drive everything:
1. **Key-agnostic data.** Everything is stored as scale degrees and movable shapes, never absolute chords. The app detects the key; one KB entry renders in all 12 keys. This is the same convention `PROGRESSIONS.degrees` and the movable shapes in `voicings.js` already use.
2. **Machine-verifiable quality.** A validator proves every voicing actually contains the chord's tones before content lands. That's what makes agent-generated content trustworthy over many loop iterations.
3. **One bounded cell per session.** Each expansion session completes exactly one style × instrument cell (researched, authored, validated, committed). Small enough to review, big enough to matter.
---
## 1. Architecture
```
src/data/kb/
index.js — registry aggregating all styles (UI reads only this)
SCHEMA.md — the authoring contract (formats below, with one full example)
jazz/
meta.js — { id, label, feel, tempoRange, character }
progressions.js — the style's standard progressions (instrument-independent)
guitar.js — guitar pack: plays + comping + improv
piano.js — piano pack
bass.js — bass pack
blues/ … — same shape per style
scripts/
validate-kb.mjs — quality gate, run with `node scripts/validate-kb.mjs`
docs/
kb-backlog.md — the cell matrix with statuses (the loop's queue)
```
`index.js` imports whatever style folders exist — the Jam Guide's style tabs grow automatically as the loop fills cells. A style is usable for one instrument before the others exist (guitar-first rollout).
### Progression entry (per style)
```js
// kb/jazz/progressions.js
export default [
{
id: 'jazz-251-major',
name: 'iiVI',
rn: ['ii7', 'V7', 'Imaj7'],
degrees: [2, 7, 0], // semitone offsets from key root
qualities: ['min7', 'dom7', 'maj7'], // keys of CHORD_TYPES in theory.js
bars: [1, 1, 2],
mode: 'major',
songs: ['Autumn Leaves', 'All The Things You Are'],
tip: 'The 7th of each chord resolves down a half-step to the 3rd of the next.',
},
// … 4-8 progressions per style (see docs/progression-repertoire.md §1 for the lists)
]
```
### Instrument pack — guitar
```js
// kb/jazz/guitar.js
export default {
styleIntro: '2-3 sentences on the guitarist's role in this style.',
comping: [{ label: 'Four-to-the-bar (Freddie Green)', rhythm: ' ', description: '' }],
plays: {
'jazz-251-major': [ // ≥2 "ways to play" per progression
{
label: 'Shell voicings',
level: 'intermediate',
chords: [ // one entry per progression step
{ shape: { rootStr: 5, offsets: ['x', 0, 'x', 0, 1, 'x'], fingers: [0,1,0,2,3,0] },
note: 'root73' },
// …
],
tips: 'Stay light; the 3rds and 7ths do all the work.',
},
{ label: 'Drop-2 on top four strings', /* … */ },
],
},
improv: {
scales: [{ over: 'ii7', scale: 'dorian', why: '' }],
targetNotes: 'Land the 3rd of each chord on beat 1.',
licks: [{ tab: 'e|---', description: '', over: 'jazz-251-major' }],
},
}
```
**Shape format** follows the existing `voicings.js` convention so the renderer is shared: movable shapes use `rootStr` + `offsets` relative to the root fret (renders in any key); open shapes use absolute `frets` + `onlyRoot` (pitch class) and only render when the key matches. Strings are arrays of 6, low-E first, `'x'` = muted.
### Instrument pack — piano
Voicings are **interval recipes** resolved per chord quality (no fingering data needed):
```js
plays: {
'jazz-251-major': [
{
label: 'Rootless A/B alternation',
level: 'intermediate',
chords: [
{ recipe: { LH: ['3', '5', '7', '9'] }, note: 'Type A' }, // ii7
{ recipe: { LH: ['7', '9', '3', '13'] }, note: 'Type B' }, // V7
{ recipe: { LH: ['3', '5', '7', '9'] }, note: 'Type A' }, // Imaj7
],
register: 'top note between C4 and C5',
tips: 'Alternate types so inner voices barely move.',
},
],
}
```
Degrees are chord-degree strings (`'1' '3' 'b7' '9' '13'`); the resolver maps them through the chord quality's intervals (which `theory.js` chord templates already encode).
### Instrument pack — bass
Line patterns per progression step, in degrees plus approach annotations:
```js
plays: {
'blues-12bar': [
{
label: 'Walking, chromatic approach',
level: 'intermediate',
bars: [{ beats: ['R', '3', '5', 'chrom→next'] } /* … per bar */],
tips: 'Beat 1 is always the new root; beat 4 walks into it.',
},
],
}
```
---
## 2. Quality gates
### Mechanical — `scripts/validate-kb.mjs` (must pass before any commit)
- ids unique; every `plays` key references an existing progression id; `chords`/`bars` length matches the progression length
- `degrees` ∈ 011; `qualities` are keys of `CHORD_TYPES`; `mode` is a known mode
- guitar shapes: 6 entries per array, frets 015, **fret span ≤ 4** (intermediate hands), and — the strong check — the shape's computed pitch classes (standard tuning EADGBE) must contain the chord's root and defining tones (3rd/7th or quality equivalent) and contain **no out-of-chord tones**
- piano recipes: every degree resolvable for that chord quality
- coverage per cell: ≥ 4 progressions, ≥ 2 plays per progression, improv section present (guitar/piano), styleIntro present
### Musician checklist (human/agent self-review, in SCHEMA.md)
- Are the plays *idiomatically different* (register, density, difficulty), not just transpositions of each other?
- Is each play genuinely intermediate — no 5-fret stretches, no 2-octave rootless clusters?
- Does the style actually sound like the style (bossa ≠ jazz with different labels: distinct rhythm descriptions)?
- Do tips teach a *transferable* idea (voice leading, register, space), not just "play this"?
---
## 3. The expansion loop
### The queue
`docs/kb-backlog.md` holds the matrix of cells with statuses (`todo` / `in-progress` / `done` + date + coverage). Order: **all guitar cells first** (most voicing complexity — it sets the quality bar), then piano, then bass. Style priority within each instrument: jazz → blues → rock → bossa → funk → reggae → country/folk → R&B/neo-soul → gospel → pop.
### The session protocol (encoded as the `/kb-expand` project skill)
Each session:
1. **Orient** — read this plan, `SCHEMA.md`, the backlog, and the gold-standard cell (`kb/jazz/guitar.js`, the first one built).
2. **Claim** — take the first `todo` cell, mark it `in-progress`.
3. **Research** — dispatch web-research agent(s) for that style × instrument: the style's standard progressions (cross-check against `docs/progression-repertoire.md`), the 2-3 idiomatic intermediate ways to play each, comping rhythms, improv approach. Named sources required.
4. **Author** — write `progressions.js` (if the style is new) and the instrument pack, conforming to SCHEMA.md.
5. **Validate** — run `node scripts/validate-kb.mjs`; fix until green; run the musician checklist.
6. **Integrate** — register the style in `kb/index.js`; `npm run build` must pass.
7. **Record** — mark the cell `done` with date + coverage stats in the backlog; commit (`kb: add <style> <instrument> pack`).
8. **Report** — summarize what was added and name the next cell.
**Session 0 (bootstrap):** if `src/data/kb/`, `SCHEMA.md`, or the validator don't exist yet, the first session builds them *plus* the jazz/guitar gold-standard cell. Every later session imitates that exemplar.
### How to run it
- One session: type **`/kb-expand`** — does exactly one cell.
- Several in a row: `/loop /kb-expand` and let it self-pace, or run `/kb-expand` whenever there's time.
- Review cadence: cells are individual commits on a branch — review/merge per instrument tranche if preferred.
30 cells ≈ 30 short sessions; guitar's 10 cells deliver user-visible value immediately because the Jam Guide reads whatever exists.
---
## 4. The Jam Guide panel (UI)
A large panel at the **bottom of the main scroll** — while jamming you scroll down and the current progression's playbook is laid out to fit the screen.
```
┌─ JAM GUIDE ─────────────────────────────── [Guitar|Piano|Bass] [Jazz][Blues][Rock][Bossa]… ─┐
│ Matched: iiVI in G major your loop: Am7 → D7 → Gmaj7 │
│ │
│ Am7 (ii7) D7 (V7) Gmaj7 (Imaj7) │
│ ▼ playing now │
│ Shells [diagram] [diagram] [diagram] root37, four-to-the-bar │
│ Drop-2 [diagram] [diagram] [diagram] top-4 strings, stays high │
│ Triads 1-3 [diagram] [diagram] [diagram] fills between vocal lines │
│ ───────────────────────────────────────────────────────────────────────────── │
│ IMPROV D dorian → G mixo → G major · target the 3rds: C → F# → B · lick ▸ tab… │
└──────────────────────────────────────────────────────────────────────────────────────────────┘
```
- **Component:** `JamGuide.jsx`, mounted last in `App.jsx`; collapsed header always visible, expands to ~70vh.
- **Inputs:** `keyInfo`, `detectedProgression`, `currentChord` — plus instrument + style selection (persisted in settings; style tabs are generated from `kb/index.js`, so the panel grows as the loop runs).
- **Matching:** convert the detected loop to degrees relative to the key root, match against the selected style's progressions **rotation-invariantly** (same canonicalization idea as `detectRepeatingProgression`). No match → fallback: per-chord voicing alternatives from `voicings.js`, so the panel is never empty.
- **Live sync:** the active chord column highlights using the loop-position logic in `ProgressionBanner.jsx` (`findLoopPosition` — extract it to a shared util). The player reads the *next* voicing in time, in rhythm with the band.
- **Diagrams:** new small renderers — `ChordDiagram.jsx` (6-string × 5-fret SVG grid, consumes the shape format), `MiniPiano.jsx` (~2-octave SVG, highlights resolved recipe notes), bass patterns as degree badges (R · 3 · 5 · ♭7) over a mini string diagram. Reuse design tokens (`bg-panel`, `border-border`, accent purple for chord tones).
- **Smart fit:** CSS grid — columns = progression chords (46), rows = plays; rows beyond what fits collapse behind "more ways ▾"; diagrams scale to column width; on narrow windows the grid flips to one play per row, chords scrolling horizontally.
- **Key-aware rendering:** movable shapes get their fret position computed from the detected key; open shapes appear only when the chord's root matches; piano recipes resolve through the chord quality. All 12 keys for free, per principle 1.
---
## 5. Phases
| Phase | What | Outcome |
|---|---|---|
| 0 | Foundation: `kb/` dirs, `SCHEMA.md`, validator, backlog, `/kb-expand` skill, jazz/guitar gold standard | The loop exists and has an exemplar |
| 1 | Jam Guide MVP: panel + matching + guitar `ChordDiagram` + live sync | jazz/guitar visible in the app while jamming |
| 2 | Loop guitar cells: blues, rock, bossa, funk, reggae, country, R&B, gospel, pop | Full guitar guide across styles |
| 3 | Piano: `MiniPiano` renderer + recipe resolver, loop piano cells | Second instrument live |
| 4 | Bass: pattern renderer, loop bass cells | Third instrument live |
| 5 | Polish: improv layer with tabs/licks, Progression Builder integration (GOAL G3), ToneGym-style tap-to-hear | Guide ↔ Builder round-trip |
### Success criteria
- During a jam, scrolling to the Jam Guide shows ≥ 3 ways to play the detected progression on the selected instrument, in the detected key, with the active chord highlighted in time.
- `/kb-expand` completes a cell in one session with the validator green, no hand-holding.
- A new style added by the loop appears in the UI with **zero code changes** (data + registry only).
- An intermediate player can switch Jazz → Bossa over the same iiVI and see *genuinely different* voicings and rhythm guidance.
+129
View File
@@ -0,0 +1,129 @@
# Learn Curriculum — Intermediate, Jam-Ready Players
Research-backed training repertoire for the Learn section. Companion to [`GOAL.md`](../GOAL.md) Part 2. Audience: players who know the basics and can survive a jam — the goal is making them better *in* the jam. Not beginner material.
Across guitar, piano, and bass pedagogy the intermediate→advanced jump converges on four pillars: **instrument liberation** (play anything anywhere), **playing the changes** (chord-tone awareness), **ensemble skills** (space, register, pocket), and **functional ears** (hearing 1-5-6-4). The per-instrument curricula below feed both the Learn UI and the knowledgebase (see `docs/kb-plan.md`).
---
## Guitar
### Skill taxonomy (rough order)
**Tier A — Fretboard liberation**
1. CAGED system fluency — locate any chord in 5 places instantly (Fretboard Logic, Pickup Music)
2. Triads on string sets — major/minor triads + inversions on strings 1-3, 2-4, 3-5 (Justin Guitar Grade 5, Leavitt Vol. 2)
3. Connecting pentatonic boxes — the box 2↔3 seam is the documented weak point
4. Scale-over-chord mapping — seeing the chord *inside* the scale shape
**Tier B — Playing the changes**
5. Chord-tone / target-note soloing — land on a chord tone on beat 1 of each change
6. Guide tones (3rds & 7ths) — the 7th of one chord resolves to the 3rd of the next
7. Phrasing across positions
**Tier C — Ensemble skills**
8. Comping with small triad voicings — stay out of the vocalist's/keys' register
9. Internal time — metronome on beats 2 & 4, then no click (Tomo Fujita's core emphasis)
10. Ear-led playing — "let your ears lead you instead of your eyes" (Fujita)
**Tier D — Functional ears**
11. Progression recognition by ear — track the bass line first
12. Modal awareness — how Dorian/Mixolydian overlap shapes you already know
13. Transcribing & daily riff-writing — the recurring plateau fix
### Top drills
1. **Triad voice-leading over 12-bar blues** — only close triads on one string set; on every change move each finger to the *nearest* note of the next triad. Forces inversions + minimal-motion voice leading at once.
2. **One-CAGED-position soloing** — improvise using only one grip's chord tones + surrounding scale notes; shift position each chorus. Welds chord, arpeggio, and scale into one visual unit.
3. **Target-note drill** — first note after each chord change must be the 3rd (then 7ths, then 7th→3rd resolutions); pentatonic filler in between. Pure pentatonic playing suddenly "follows the changes".
4. **Pentatonic seam drill** — ascend box 1, exit through a named seam note into box 2, etc. Shifts become melodic destinations.
5. **Metronome on 2 & 4** — click as the snare backbeat; progress to click once per bar, then none.
6. **Comping ladder** — comp behind a recorded soloist using only 3-string triads above fret 5, varying rhythm/dynamics, never register-clashing.
7. **Daily progression dictation** — 10-15 min naming I-IV-V vs vi-IV-I-V vs ii-V-I from songs, bass line first.
### Sources
Fretboard Logic (Bill Edwards) · Justin Guitar Grades 46 · Tomo Fujita *Accelerate Your Guitar Playing* (Berklee) · Leavitt *A Modern Method for Guitar* Vol. 2 · Absolutely Understand Guitar · Pickup Music CAGED pathway · fundamental-changes.com (guide tones) · TrueFire (box connection, plateaus) · Premier Guitar "Rhythm Rules" · zotzinguitarlessons.com (triads in 12 keys) · ToneGym / tonedear.com · stringshock.com & jazzguitartoday.com (jam etiquette)
---
## Piano / Keys
### Skill taxonomy (rough order)
**Tier 1 — Harmonic vocabulary**
1. Triad inversions in all 12 keys — grab any chord near the current hand position
2. Voice leading — minimum-distance inversion choice; the biggest "amateur → pro" jump
3. Shell voicings (root37) — light, clear, gateway to comping (Open Studio, PianoGroove)
4. Sus2/sus4/add9 colors and slash chords — pop/worship vocabulary
5. Rootless voicings — Type A (3-5-7-9), Type B (7-9-3-5); top note between C4C5
**Tier 2 — Rhythm & ensemble role**
6. Comping rhythms — Charleston, reverse Charleston, Red Garland pattern, anticipations
7. Register discipline — LH stays above ~G3 when a bassist is present
8. Density discipline ("rule of 1") — in a 5-piece band, play 1/5 of the music
9. Hand-role splitting — LH harmony/groove anchor, RH color and answers
**Tier 3 — Functional/ear skills**
10. Thinking in numbers (Nashville Number System / Roman numerals)
11. Progression recognition by ear — bass line + emotional flow of each degree
12. Transposition fluency — known songs in all 12 keys via the number method
13. Sight-comping — realize an unfamiliar lead sheet at tempo (Berklee keyboard method)
**Tier 4 — Bandstand**
14. Form-keeping under pressure — never lose bar 1
15. Improvising over changes — chord tones → pentatonics → scale tones
16. Repertoire in 2-3 keys from memory
### Top drills
1. **Voice-led progression loop in 12 keys** — IVviIV with minimum hand movement (C → G/B → Am → F/A), through the circle of fifths. Self-grading: you can see and hear when you jump.
2. **Shell iiVI cycle** — root+3+7 through all keys, alternating types so 3rds/7ths swap and resolve by half-step. The core voice-leading mechanic made physical.
3. **Charleston metronome ladder** — one syncopation pattern to automaticity at 80→160 BPM; comping failure in jams is usually rhythmic, not harmonic.
4. **Backing-track subtraction** — chorus 1 whole notes only; chorus 2 LH only above G3, no roots; chorus 3 RH colors only; chorus 4 two hits per bar. Simulates bandmates occupying frequency space.
5. **Bass-line ear training** — hum the bass note of each chord in a pop song, convert to numbers, play it.
6. **One song, twelve keys** — number-chart a known song, new key daily.
7. **Cold lead-sheet sight-comping** — slow metronome, once through the form, never stopping. Rehearses the actual jam failure mode.
### Sources
Berklee Online Keyboard Method · Mark Levine *The Jazz Piano Book* · Open Studio Piano Pathway · PianoGroove (rootless voicings, comping) · The Jazz Piano Site (jam prep) · Piano With Jonny (voicings, transposing) · Jens Larsen (comping rhythms) · Pianote (band guide, NNS) · Worship Online / Musicademy / Sweetwater (band role) · ToneDear / ToneGym / Musical U / trainear.com (ear training)
---
## Bass
### Skill taxonomy (rough order)
1. Fretboard zone mastery — every note to fret 12, lines through each zone (Friedland)
2. Root-fifth-octave vocabulary — the "safe but musical" jam fallback
3. Chord-tone fluency — R-3-5-7 of maj/min/dom/m7♭5 anywhere (TalkingBass: chord tones *before* scales)
4. Scale-tone vs chord-tone discrimination — outline on strong beats, connect on weak
5. Approach-note technique — chromatic from above/below, W|H|H walkup, dominant approach
6. Walking bass construction — root on 1, chord tones on 1 & 3, approach into the next root on 4
7. Subdivision command — straight 8ths / swing / shuffle / 16th funk, switching mid-groove
8. Pocket / drummer lock — kick matching, ghost notes, dynamic mirroring
9. Functional ear training — root movement, I/IV/V/vi by function
10. Real-time harmonic prediction — the V "pushes home", reacting within one pass of the form
11. Dynamics, touch, space — most cited intermediate→pro separator
12. Fills and form awareness — fills at bars 4/8 phrase boundaries
### Top drills
1. **Root-only song stripping** — play only the root of each change by ear; add 5ths and octaves on later passes. Strips songs to harmonic skeleton.
2. **Arpeggiate the progression** — R-3-5(-7) over I-V-vi-IV in several keys, then inversions, then other neck zones.
3. **W|H|H chromatic walkup** — between chords a 4th apart: root, whole, half, half (C-D-E♭-E→F). Formulaic forward motion that telegraphs the next chord.
4. **Walking 12-bar / 1-6-2-5 loop** — a decision every beat about chord vs passing tone (Friedland, SBL 5-step formula).
5. **2-bar loop challenge** — one groove for 5+ minutes changing only tone/dynamics/note length. Pocket training; exposes drift.
6. **Subdivision switching** — 2 bars 8ths / 2 bars 16ths at 60-80 BPM; click on 2&4 only; mute the click 4 bars and check.
7. **Sing-then-play root movement** — sing the roots before touching the bass, then 3rds/5ths/7ths.
### Sources
Scott's Bass Lessons (Players Path, Groove Trainer) · TalkingBass Chord Tone Essentials · Ed Friedland *Building Walking Bass Lines* · Hal Leonard Bass Method · Berklee Practice Method: Bass · Bass Musician Magazine (drummer lock) · Premier Guitar (jam survival) · StudyBass · Learn Jazz Standards · Jazz Night School (chromatic 4) · onlinebasscourses.com · Functional Ear Trainer
---
## How the app supports this (detection-powered training)
These map to GOAL.md L1L4; the app's unfair advantage is that it *hears* the player.
1. **Target-note highlighting** — on each detected chord change, flash the new chord's 3rd/7th on the fretboard/piano (guitar drill 3, piano drill 2). Later: score whether the first detected note after the change was a chord tone.
2. **Voice-leading coach (piano view)** — highlight the *nearest inversion* to the previous chord, common tones marked "hold"; score total semitone travel per progression.
3. **Next-chord preview tier (bass)** — when a loop is detected, highlight the upcoming chord's root plus its chromatic approach notes a half-step above/below — the walking-line scaffold, one beat ahead.
4. **Progression ear-trainer on your own jam** — hide the chord banner, ask for the numbers (vi-IV-I-V), reveal. Uses chord history + `toRomanNumeral`; contextual beats abstract drills.
5. **Pocket report** — extend the onset/BPM histogram to show beat-phase drift (rushing/dragging), plus a 2-&-4-only click synced to the detected tempo.
6. **Mode-difference teaching** — when the user manually switches mode (the K-S limitation), briefly highlight the difference notes (minor → Dorian = raised 6th).
+149
View File
@@ -0,0 +1,149 @@
# Chord Progression Repertoire
Research-backed reference for expanding the progression features. Companion to [`GOAL.md`](../GOAL.md) Part 1. Notation: uppercase = major, lowercase = minor, ° = diminished, 7 = dominant unless marked maj7/m7.
How this maps to code today:
- `PROGRESSIONS` in `src/lib/theory.js``{ name, rn, degrees }` per progression; `degrees` are semitone offsets from the key root. This is the format new entries should use.
- `getSuggestedProgressions(root, mode)` maps degrees → chord names in key; `toRomanNumeral()` converts any chord back to a numeral.
- `FAMOUS_PROGRESSIONS` in `src/lib/education.js` — richer entries (songs, tips, style variations) for the Learn side.
## 1. Genre-by-genre progression tables
### Pop
| Progression | Name / notes |
|---|---|
| IVviIV | "Axis of Awesome" — #1 in Hooktheory's corpus of 75k+ analyzed songs |
| viIVIV | Same loop rotated to start on vi ("pessimistic axis") |
| IviIVV | "Doo-wop" / "'50s progression" |
| IIVviV | Common variant (Africa chorus) |
| IVViiivi | "Royal Road" — J-pop/anime staple, spreading into Western pop |
### Rock
| Progression | Name / notes |
|---|---|
| IIVV | Foundation of rock/blues/country |
| I–♭VIIIV(I) | Mixolydian rock cliché (Sweet Home Alabama as VIVI rotation) |
| i–♭VII–♭VI(V) | Andalusian-derived minor loop; with V = full Andalusian cadence |
| I–♭IIIIV | Blues-rock riff progression (borrowed ♭III) |
### Blues (12-bar family)
| Progression | Name / notes |
|---|---|
| I7×4 / IV7×2, I7×2 / V7, IV7, I7, V7 | Standard 12-bar |
| Bar 2 → IV7 | "Quick change" / "quick four" |
| ii7V7 in bars 910, turnaround IVI7iiV7 | Jazz blues |
| i7iv7i7 … ♭VI7V7i7 | Minor blues (The Thrill Is Gone) |
| IVIVIVIVIV | 8-bar blues (Key to the Highway) |
### Jazz
| Progression | Name / notes |
|---|---|
| ii7V7Imaj7 | The fundamental cadence |
| IviiiV (also iiiviiiV) | Rhythm changes A / turnaround |
| III7VI7II7V7 | Rhythm changes bridge (circle of dominants) |
| iim7♭5V7♭9i | Minor iiVi |
| ii7–♭II7Imaj7 | Tritone-sub cadence |
| ivm7–♭VII7Imaj7 | "Backdoor" progression |
### Folk / Country
| Progression | Name / notes |
|---|---|
| IIVV(I) | Core of both genres |
| IVIIV | Two/three-chord verse pattern |
| i–♭VII–♭VI | Minor folk descent (AmGF) |
| IVviiiiIVIIVV | Pachelbel progression |
| III7VI | Classic country secondary-dominant (V/V) move |
### Funk
| Progression | Name / notes |
|---|---|
| I7 vamp | James Brown static dominant, voiced as 9th |
| i7IV7 | Dorian two-chord vamp — the most common funk pair |
| i7 / m11 vamp | Minor one-chord groove |
| ii7V7 loop | Funk/disco vamp |
Design insight: funk needs few *progressions* but rich *chord qualities* (9, 7♯9, m11, 13sus) — colour lives in the voicing, not the changes.
### Reggae
| Progression | Name / notes |
|---|---|
| IV or IIV | Two-chord skank vamps |
| IVviIV | No Woman No Cry |
| i–♭VII(–♭VI) | Minor roots-reggae vamp |
| IIVV | Ska/rocksteady standard |
### R&B / Neo-soul
| Progression | Name / notes |
|---|---|
| ii7V7Imaj7 (with 9/11/13 extensions) | Core cadence |
| iii7vi7ii7V7 | Circle movement from the mediant — neo-soul staple |
| viiiVI | "6-2-5-1" cyclical soul loop |
| Imaj7IVmaj7 / Imaj7iii7 | Two-chord vamps |
| i7iv7 | Dorian D'Angelo-style minor vamp |
### Gospel
| Progression | Name / notes |
|---|---|
| ii7V7I | The gospel "2-5-1", often chained: 6-2-5-1, 3-6-2-5-1 |
| II7IV | Tonicizing IV (V7/IV "amen" setup) |
| IVivI | Plagal with borrowed iv |
| I–♯i°–ii | Chromatic passing-diminished walk-up |
## 2. Substitution / variation taxonomy
Progression "families" relate through a small set of transforms — these are the generation rules for variation buttons and the Builder:
1. **Rotation** — any loop can start on any chord (IVviIV ≡ viIVIV). Treat loops as cyclic equivalence classes; display the rotation matching the user's tonic emphasis. (`detectRepeatingProgression` already canonicalizes rotations.)
2. **Diatonic (function) substitution** — chords sharing two notes swap: I↔vi↔iii (tonic), IV↔ii (subdominant), V↔vii° (dominant).
3. **Modal interchange / borrowing** — take a chord from the parallel mode: iv, ♭VI, ♭VII, ♭III, iim7♭5 in major; major IV (Dorian) in minor.
4. **Secondary dominants** — precede any diatonic target with its V7: V/V = II7, V/vi = III7, V/IV = I7, V/ii = VI7.
5. **Tritone substitution** — replace any dominant with the dominant a tritone away (V7 → ♭II7). Jazz flavour flag.
6. **Backdoor dominant** — ♭VII7 resolving to I, usually as ivm7–♭VII7I.
7. **Quality embellishment** — same root, richer colour: triad → 7th → 9/11/13, sus2/4, add9. The main axis distinguishing genres (pop = triads/sus, jazz/neo-soul/gospel = extensions, funk = dominant 9/♯9). Already partially covered by `CHORD_SUBSTITUTIONS` in `education.js`.
8. **Passing/approach chords** — chromatic passing diminished (I–♯i°–ii), bass-line inversions (slash chords).
## 3. UX patterns worth copying
- **Hookpad (Hooktheory)** — *key-relative chord palette*: only the diatonic chords of the current key, colour-coded consistently per scale degree (key-agnostic colours). Borrowed chords live in expandable secondary palettes. *Magic Chord* suggests the statistically likeliest next chord. Drag-and-drop onto a timeline. → Direct model for the Progression Builder (GOAL G3).
- **Hooktheory TheoryTab** — progressions ranked by real-song frequency; each links to songs using it. "You're playing the Creep progression" is a strong engagement hook (partially exists via `FAMOUS_PROGRESSIONS` song lists).
- **Scaler 2/3** — three-zone vertical flow: detection area (top) → suggested chords/scales (middle) → user-built progression (bottom). Maps directly onto this app: live detection → suggestions → builder.
- **iReal Pro** — one-tap transposition; per-genre rendering of the same progression.
- **ToneGym** — instant audio preview when tapping any chord/progression.
## 4. Voicing data
### Guitar
Best option found: [`tombatossals/chords-db`](https://github.com/tombatossals/chords-db) (MIT, npm `@tombatossals/chords-db`, prebuilt `lib/guitar.json`):
- All 12 keys × large suffix list, **multiple positions per chord** (open + barre + higher CAGED positions).
- Per position: `frets` (per string, `x` = mute, low-E first), `fingers`, optional `barres`, `baseFret`. Example: `{ frets: '55775x', fingers: '114310', barres: 5 }`.
- Companion renderer: [`tombatossals/react-chords`](https://github.com/tombatossals/react-chords) (React SVG diagrams consuming this format).
Triads on string-sets (top-3 / middle-3) are *not* in chords-db but are cheap to generate: for each inversion of the triad, map the 3 chord tones onto a chosen string set within a 4-fret window. This complements the existing `GUITAR_SHAPES` in `src/lib/voicings.js`.
### Piano
No canonical open dataset exists. The sane model is **interval recipes resolved per chord quality** (the chord templates in `theory.js` already encode quality → semitone mapping):
```js
// voicing = named recipe of chord degrees, resolved per chord quality
{
shell: { LH: ['1', '7'], RH: ['3'] },
rootPosition: { LH: ['1'], RH: ['1', '3', '5', '7'] },
rootlessA: { LH: ['3', '5', '7', '9'] }, // Type A: 3rd on bottom
rootlessB: { LH: ['7', '9', '3', '5'] }, // Type B: 7th on bottom
guideTones: { LH: ['3', '7'] },
}
```
Conventions to encode: rootless voicings keep the top note between C4C5; alternate Type A/B through a progression so inner voices barely move — i.e. pick the voicing minimizing semitone travel from the previous chord (simple voice-leading distance minimization).
## 5. Sources
- Hooktheory corpus & blog: hooktheory.com/blog/i-analyzed-the-chords-of-1300-popular-songs-for-patterns-this-is-what-i-found/ ; hooktheory.com/blog/jazz-chord-progressions/
- 12-bar variants: en.wikipedia.org/wiki/Twelve-bar_blues ; happybluesman.com/common-variations-12-bar-blues/
- Named progressions: en.wikipedia.org/wiki/%2750s_progression ; piano.org/chord-progressions/ ; supersimplepiano.com/learn/chord-progressions/royal-road
- Substitutions: learnjazzstandards.com (chord substitution) ; hub.yamaha.com (beyond diatonic) ; hubguitar.com (tritone subs)
- Gospel: gospelmaps.com/top-gospel-chord-progressions/ ; gospel.hearandplay.com (2-5-1)
- Genre vamps: orphiq.com (reggae) ; guitar-chord.org/articles/funk.html ; orangecandymusic.com & pickupmusic.com (R&B/neo-soul)
- Tools: producelikeapro.com (Scaler review) ; hooktheory.com/hookpad
- Voicing data: github.com/tombatossals/chords-db ; github.com/tombatossals/react-chords ; voicinglab.com & pianowithjonny.com & thejazzpianosite.com (rootless voicings)