{
  "schema": "leumas.docs.page/1",
  "id": "adapter:domain/music-theory",
  "slug": "adapters/domain/music-theory",
  "kind": "capabilities",
  "bucket": "package",
  "title": "music-theory (engines/adapters/domain/music-theory)",
  "name": "music-theory",
  "eyebrow": "engines/adapters/domain/music-theory",
  "chip": null,
  "summary": "Pitch-class / theory capability pack: build scales (major, natural/harmonic/melodic minor, the 7 modes, pentatonic, blues, chromatic), spell chords (triads through 7ths, sus, add9, altered), name the...",
  "keywords": [
    "music-theory",
    "pitch-class",
    "melodic",
    "pentatonic",
    "blues",
    "music theory api",
    "leumas music theory",
    "spell"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# music-theory (`engines/adapters/domain/music-theory`)\n\nPitch-class / music-theory **capability pack**. Net-new pure-JS build — everything is note-name and\ninterval arithmetic mod 12. Zero npm deps, deterministic, one contract\n(`export default { metadata, adapters }`).\n\n## Tools (`adapters`)\n\n| tool | args | result |\n|------|------|--------|\n| `scale` | `{ root, type='major' }` | note list for the scale + semitone intervals |\n| `chord` | `{ root, type='maj' }` | note list + intervals for the chord |\n| `interval` | `{ from, to }` | interval name (e.g. `Perfect 5th`) + semitones |\n| `transpose` | `{ notes:[], semitones }` | notes moved up/down (negative = down) |\n| `keySignature` | `{ key, mode='major' }` | sharp/flat count + accidentals + notes (minor keys resolve via relative major) |\n| `circleOfFifths` | `{}` | the 12 keys — major, relative minor, accidentals |\n| `chordProgression` | `{ key, pattern=['I','IV','V'], mode='major' }` | roman numerals → diatonic chords in key |\n| `romanNumeralAnalysis` | `{ key, chords:[], mode='major' }` | reverse: chord names → roman numerals |\n| `identifyChord` | `{ notes:[] }` | name the chord from a set of notes |\n| `noteInfo` | `{ note }` | pitch class + enharmonic equivalents |\n\n**Scale types:** major, minor (natural), harmonicMinor, melodicMinor, dorian, phrygian, lydian,\nmixolydian, locrian, pentatonicMajor, pentatonicMinor, blues, chromatic (plus `natural`/`harmonic`/\n`melodic` aliases).\n\n**Chord types:** maj, min, dim, aug, sus2, sus4, 6, min6, maj7, min7, dom7 (`7`), dim7, min7b5\n(`m7b5`), aug7, add9, 9, maj9, min9, 5 (power).\n\n### Notes & enharmonics\n\nNotes are represented as names (`C`, `C#`, `Db`, `D`…). Diatonic 7-note scales are spelled with\nproper letter-per-degree accidentals (G major → `F#`, not `Gb`); chords and non-diatonic scales are\nspelled sharp- or flat-biased from the root's own accidental. `noteInfo` returns every enharmonic\nequivalent for a pitch class. Octave digits in a note name are accepted but ignored — this pack is\npitch-class only.\n\n## DRY boundary (who owns what)\n\n- **music-theory vs `hz`** — this pack is **pitch-class / theory only**: note names, intervals,\n scales, chords, keys. **Note<->frequency and note<->MIDI conversions live ONLY in the sibling `hz`\n  pack** (`shared/engines/adapters/domain/hz`): `noteToFreq`, `freqToNote`, `midiToFreq`,\n  `freqToMidi`, `cents`, `harmonics`. Never duplicate the 12-TET frequency/MIDI table here — call\n  `hz` for anything involving Hz or MIDI numbers.\n\n`adapterToServer()` (`@leumas/mcp-kit`) exposes each tool as an MCP tool + API route + form.\n",
  "source": {
    "path": "shared/engines/adapters/domain/music-theory/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 2821,
    "hash": "f6c87adad3d18382f55afe49b4b79ceca0f8a0d9"
  },
  "urls": {
    "html": "/p/adapters/domain/music-theory",
    "json": "/docs/adapters/domain/music-theory.json",
    "md": "/docs/adapters/domain/music-theory.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  }
}
