# Music staff notation catalogue

**Status:** live seed (R4+)  
**Page:** [labs/music-staff.html](../labs/music-staff.html) · pretty `/music-staff`  
**Data:** `data/music-staff/index.json` · `entries.json`  
**API:** `js/staff-catalogue.js` · `window.__kbatchStaff`  
**MG:** hotpipe `keyboard-beats.js` · `data/staff-catalogue-seed.json` · TOOLS → **Staff cat**

## Why this expands the future

KBatch already maps **text → path → notes → MIDI**. The missing half was a **dictionary of music itself** — symbols, scales, intervals, chords, meter, dynamics, and short public-domain motif seeds — so AI, learners, and Memory Glass Beats share one catalogue plane.

Parallel to the word dictionary:

| Word plane | Staff plane |
|------------|-------------|
| orthography / slivers | scales / modes / world approx |
| layouts · shadows | intervals · chords · voicings |
| registers · slang | articulations · dynamics |
| PD living books | PD motif seeds (short phrases) |
| honor-lang gate | rights: theory-pd + motif-seed only |

## Seed inventory (~183 entries)

| Kind | Role |
|------|------|
| clef | Treble, bass, alto, tenor, percussion |
| key-signature | Circle-of-fifths majors |
| time-signature | Common meters including odd meters |
| scale | Western modes, pentatonics, blues, whole-tone, chromatic, octatonic, world approx (Hijaz, Japanese In/Yo, Chinese Gong, raga-like, pelog/slendro ET approx) |
| interval | P1–P12 (+9ths/10ths) |
| chord | Triads, 7ths, sus, extensions, quartal |
| rhythm | Cells (swing approx, clave feel, waltz, 6/8) |
| motif | Short PD seeds (Ode to Joy, Twinkle, Bach C prelude arpeggio, Sakura, …) |
| articulation / dynamic | Catalogue tokens with demo triads |
| solfege | Pitch-class ↔ syllable |
| geometry-bridge | C major ↔ white-key / float-kb jam |

## Client API

```js
import {
  loadStaffEntries, searchStaff, entryToNotes,
  renderStaffCanvas, playStaffNotes, downloadEntryMidi,
  pushToMgBeats, textToStaffBridge,
} from "./js/staff-catalogue.js";

await loadStaffEntries();
const ionian = searchStaff({ kind: "scale", q: "ionian" })[0];
const pack = entryToNotes(ionian);
renderStaffCanvas(canvas, pack);
playStaffNotes(pack);
downloadEntryMidi(ionian);
pushToMgBeats(ionian);           // Memory Glass Beats
textToStaffBridge("shadow live"); // path notes → nearest scale
```

### Memory Glass console

```js
__mgKeyboardBeats.loadCatalogueId("scale-c-ionian")
__mgKeyboardBeats.loadCatalogueId("motif-ode-joy")
__mgKeyboardBeats.loadCatalogueSeed(r => console.log(r))
```

## Rights doctrine (honor the music axis)

- **Theory facts** (interval names, scale degree sets, clef identities) are not copyrightable as pure facts.
- **Motif seeds** are short educational phrases only — never full commercial scores.
- **No commercial lyric text** in this catalogue (see `data/music-rights/index.json`).
- World systems marked `approx` use equal-temperament stand-ins — real microtonal packs are a future lane.

## Future expansion (keep climbing)

1. MusicXML / ABC PD corpus harvest (batch import → packs)
2. Microtonal / maqam / raga packs beyond 12-TET approx
3. Staff → reverse search against word path packs
4. Live MG session annotation → catalogue contributions
5. Learn stair skills for staff literacy (CEFR-like music grades)
6. Chart title-path packs auto-tagged with nearest scale from catalogue

## Deploy

Pages dist includes `data/music-staff/` via `scripts/deploy-pages.sh`.  
MG seed: `experiments/memory-glass/hotpipe/data/staff-catalogue-seed.json` (~77 entries).
