Guitar
Guitar fretboard, shapes, patterns, and sequences
The tonal-guitar package provides pure functions for working with guitar fretboard geometry, scale/chord shapes, melodic patterns, and output formatting. It integrates deeply with Tonal's Scale, Chord, Mode, and Key modules.
Core Workflow
The typical workflow is:
- Choose a shape from the built-in registry (CAGED, 3NPS, pentatonic) or define your own
- Build a fretted scale by applying the shape to a root note and tuning
- Generate a pattern (thirds, fourths, groupings, custom sequences)
- Walk the pattern through the fretted scale to get concrete notes
- Output as ASCII tab or AlphaTeX notation
Built-in Shape Systems
The package ships with 32 shapes registered at import time:
| System | Count | Shapes |
|---|---|---|
| CAGED Scales | 5 | E, D, C, A, G shapes |
| Minor CAGED Scales | 5 | Dm, Cm, Am, Gm, Em shapes |
| CAGED Chords | 5 | E, D, C, A, G shapes (with fingerings and barres) |
| 3NPS | 7 | Patterns 1-7 (one per mode) |
| Pentatonic | 5 | Boxes 1-5 |
| Minor Pentatonic | 5 | Boxes 1-5 Minor |
Package Sections
- Fretboard -- Fretboard math and note lookups
- Shapes -- Scale and chord shape registry
- Patterns -- Melodic pattern generators and walker
- Sequences -- Sequence engine for incremental exercises
- Output -- AlphaTeX and ASCII tab formatters
- Integration -- Tonal.js Scale, Chord, Mode, and Key integration
- Arpeggios & Chord Detection -- Arpeggio derivation, shape inference, and voicing data