# Writing Tabu songs: the authoring guide

This guide is for people and AI agents who want to write complete, valid `.tabu` guitar songs: chords, lyrics, strum patterns, tab riffs and solos. It stands alone. Read it top to bottom once, then use sections 9 and 10 as a checklist.

- Canonical URL: https://tabutabu.app/guide.md
- Full specification: https://tabutabu.app/spec.md (this guide is the friendly subset)
- Format version covered: `Tabu: 0.1` (a draft; details may still change before 1.0)

## 1. What Tabu is

Tabu is a plain-text format for guitar songs. A file looks like the chord sheets and ASCII tab guitarists already write, plus a few exact rules (a count ruler over tab, `|` bar marks in lyrics) that let the app play the song, scroll it in time, loop it and transpose it. Open the same file in any text editor and it is still a readable chord sheet.

- Extension: `.tabu`
- Encoding: UTF-8 plain text (a BOM is tolerated; LF or CRLF line endings)
- The first line must be exactly `Tabu: 0.1`
- Use a monospace font and spaces, never tab characters, in tab and chord-over-lyric lines. Alignment is meaning.

## 2. Quick start (60 seconds)

The smallest useful song is headers, one section, and chords with lyrics:

```tabu
Tabu: 0.1
Title: Down in the Valley
Artist: Traditional
Key: G
Time: 3/4
Tempo: 100
Rights: traditional
Source: Traditional American folk song; words as commonly sung.

# Verse 1
Down in the [G]valley, the valley so [D7]low,
Hang your head [D7]over, hear the wind [G]blow.
```

What happened here:

1. `Tabu: 0.1` is the magic first line. Then `Key: value` header lines.
2. `# Verse 1` starts a section. Everything until the next `#` belongs to it.
3. `[G]` puts the chord G right before the next letter. That is the whole chord-and-lyrics notation in its simplest form.

Chords like `G` and `D7` are looked up in a built-in dictionary. You only need `Chord:` lines for unusual voicings (section 5.5). Everything beyond this (bars, strumming, tab) is optional and can be layered on later.

## 3. Headers

Headers are `Key: value` lines at the top, right after `Tabu: 0.1`, starting in column 0. Keys are case-insensitive. Values are literal text: no quotes, no escaping (`Title: 1979` and `Title: We're #1` mean exactly what they say). A blank line or `//` comment line may appear between headers. The header ends at the first line that is not a header (normally the first `# Section`).

Do not write `Key: value` lines in the body: they are treated as lyrics.

| Key | Required? | Example | Notes |
|---|---|---|---|
| `Tabu` | yes, first line | `0.1` | Format version. |
| `Title` | yes (for upload) | `Amazing Grace` | |
| `Artist` | yes (for upload) | `Traditional` | Performer this version is associated with. |
| `Rights` | yes (for upload) | `public-domain` | See section 11. |
| `Explicit` | yes (for upload) | `no` | `yes` or `no`. Whether the lyrics are explicit. |
| `Subtitle`, `Album`, `Year` | no | `1997` | |
| `Composer`, `Lyricist`, `Arranger` | no | `John Newton` | `Arranger` is whoever made this arrangement or transcription. |
| `Composed` | no | `1779` | Earliest publication year the rights claim relies on. |
| `Source` | for public-domain / traditional / cc | free text with URLs | Where the words, tune or chords came from. |
| `License` | no | `CC0-1.0`, `CC-BY-4.0`, `CC-BY-SA-4.0` | Licence for this file's own contribution. |
| `Origin` | recommended | `human`, `llm-assisted` | Provenance. Use `llm-assisted` if an AI produced the file. |
| `Key` | no | `A`, `F#m`, `D dorian` | The sounding (concert) key. |
| `Capo` | no | `2` | Capo fret. Chords and tab frets are shapes relative to the capo (fret 0 is the capo). |
| `Time` | no (default `4/4`) | `3/4`, `6/8`, `12/8`, `7/8 (2+2+3)` | Initial meter. |
| `Tempo` | no (default `100`) | `84`, `q=84`, `q.=60`, `h=72` | A bare number is beats per minute of the meter's beat (a dotted quarter in 6/8). |
| `Feel` | no | `straight`, `swing` | Playback only. |
| `Tuning` | no (default `standard`) | `standard`, `drop-d`, `dadgad`, `open-g`, `open-d`, `half-step-down`, or pitches low to high such as `E2 A2 D3 G3 B3 E4` | The string count comes from the tuning. |
| `Chord` | no, repeatable | `G = 320003 fingers=210003` | Chord voicing (section 5.5). |
| `Pattern` | no, repeatable | `waltz = B . D U D U` | One-line strum or pick pattern (section 6). |
| `Groove` | no | `rock`, `shaker`, `off` | Optional drum backing (section 8). |
| `Form` | no | `Intro, Verse 1, Chorus x2, Outro` | Play order (section 4). |
| `CountIn` | no | `1 bar`, `2 beats` | |
| `Difficulty` | no | `2/5` | |
| `Tags` | no | `folk, fingerstyle, 90s` | Comma-separated. |
| `Lang` | no | `en` | Lyric language code. |
| `Links` | no | a URL | Where to listen or buy. |
| `Part` | no, repeatable | `lead "Lead guitar" tuning=standard capo=0` | Extra instrument parts; advanced, see the spec. |
| `X-anything` | no | `X-MyApp: 1` | Keys starting with `X-` are reserved for tools and never warned about. |

Unknown keys are kept but draw a warning in the reference validator. A repeated non-repeatable key keeps the last value and draws a warning.

Header lines may end with a trailing comment: `Capo: 2    // shapes in G, sounds in A`.

## 4. Sections, play order, notes and comments

### Sections

```tabu
# Intro
# Verse 1
# Chorus
# Verse 2 < Verse 1
# Bridge {bars=8}
## Riff A
```

- `# Name` starts a section that runs to the next heading. Common names: `Intro`, `Verse 1`, `Pre-Chorus`, `Chorus`, `Bridge`, `Solo`, `Interlude`, `Instrumental`, `Outro`. Any name works.
- `# Chorus x2` plays the section twice in a row wherever it occurs.
- `# Verse 2 < Verse 1` is **inheritance**: Verse 2 reuses Verse 1's bars and strum setting. You write only the new lyrics, and chordless lines take the chords and timing of the matching line in Verse 1 (line 1 to line 1, line 2 to line 2). A line count that differs from the parent is a warning. The parent must exist, or the parser warns "Unknown parent".
- `## Riff A` (two hashes) is a **named block**: a riff or fill that is defined but not played where it is written. It plays only through `@play` or `Form:`.
- `{bars=N}` gives an estimated length for lyrics with no bar marks.

### Play order

- With a `Form:` header, play order is that comma-separated list: `Form: Intro, Verse 1, Chorus x2, Outro`. Each item names a section or block, optionally with `xN`.
- Without `Form:`, sections play in document order. A `#` heading with an empty body whose name matches an earlier section replays it ("Chorus, as above"):

```tabu
# Chorus
Oh! Su[C]sanna, oh don't you | [G]cry for [D7]me,

# Verse 2
I had [G]a dream the other night,

# Chorus
```

- `@play Name` inside a section inserts that section's or block's bars at that point. `@play Intro x2` repeats it; `@play Intro bars=1-3` inserts written bars 1 to 3.

### Directives you can use

A directive is a body line starting with `@`. The ones this guide uses:

| Directive | Meaning |
|---|---|
| `@strum NAME` / `@strum off` | Apply a pattern to chart and lyric bars from here on (section 6). |
| `@pattern NAME = ...` or `@pattern NAME` plus a grid | Define a pattern (section 6). |
| `@play Name [xN] [bars=A-B]` | Insert another section's bars. |
| `@tempo 84`, `@time 6/8`, `@key Bm`, `@capo 4` | Change song state from the next bar line. |
| `@hold 3` | The next bar is extended by 3 beats and its last event is held (a measured fermata). |
| `@mark "name"` | Name a loop point at the next bar. |
| `@groove NAME` / `@groove off`, `@fill`, `@drums NAME` | Drum backing (section 8). |

The spec defines more directives (`@pickup`, `@free`, `@repeat`, `@tuning`, `@feel`, `@grid`, `@ring`, `@part`, `@chord`). The current reference parser does not recognise those yet and warns about them, so see section 10 before using them.

### Notes and comments

- `> text` is a performance note shown as a callout. Consecutive `>` lines form one note. It has no timing.
- `// text` as a whole line is a comment, ignored everywhere (also inside tab systems and between header lines).
- `text // comment` after content is a trailing comment on header, heading, directive and chart lines. Do not put trailing `//` comments on lyric or tab lines (a lyric may contain `//`, for example in a URL).
- Start a body line with `\` to force it to be a lyric line (`\| not a chart`, `\# 1 fan`, `\A E` as words). The backslash is dropped.

## 5. Chords and lyrics

You can write chords and lyrics in two interchangeable ways, even mixed from line to line within a section.

### 5.1 Inline chords

```tabu
# Verse 1
'Twas [G]grace that [G7]taught my [C]heart to [G]fear,
```

`[X]` places chord X right before the next character. This form survives chat apps, copy-paste and proportional fonts. A bracket that is not a chord (`[sic]`) is an error or warning; write `\[` for a literal bracket.

### 5.2 Chord line over a lyric line

```tabu
# Verse 1
  G      G7          C         G
A-mazing grace! (how sweet the sound)
     G                   D    D7
That sav'd a wretch like me!
```

Each chord lands at the **column where it starts**, so line it up over the syllable. A chord placed past the end of the lyric is held over the last syllable. A line counts as a chord line only when **every** word on it is a chord symbol (`G`, `Am7`, `D/F#`, `Cadd9`, `N.C.`). A chord line followed by a blank line (or anything that is not a lyric) is an instrumental line.

### 5.3 Bar marks `|` in lyrics (the timing form)

A `|` inside a lyric line starts a new bar at that position. This is how a plain lyric sheet becomes a timed song with no separate chart:

```tabu
# Verse 1
@strum waltz
Down in the [G]valley, | the valley so | [D7]low, |
Hang your head | [D7]over, | hear the wind | [G]blow. |
```

- The `|` itself is not shown. `rose|[G]mary` displays as one word, "rosemary".
- A `|` at the very end of a line closes the last bar and does not start a new one. Two marks in a row (`| |`) make an empty bar in which the chord continues.
- A bar's slots are its chords. A bar with one chord sounds that chord all bar; two chords split the bar evenly. If the words before a bar's first chord come first, the chord carried from the previous bar sounds at the bar start. In 3/4 a bar cannot have exactly 2 chord slots (see the slot rule below); in 4/4 it can have 1, 2, 4 or 8.
- **Pickups:** text before a line's first chord or first `|` is a pickup, sung at the end of the bar before. In `I come [G]from Alabama with my | banjo on my [D7]knee,` the words "I come" are a pickup.

Without any `|` marks and without a chart, the file is still valid: timing is estimated as one bar per chord. Add marks when you want exact timing.

### 5.4 Chord-only bar charts

A line that **starts with a barline** is a chart line: bars of chords, one bar between each pair of `|`.

```tabu
# Verse 1
| G    | G7   | C    | G    |
|: G | Cadd9 | Em7 | Dsus4 D :|
| G . D/F# . | Em7 | Cadd9 | G . (D/F# Em7) . |
| Am7 | Cadd9 | Am7 | ^D |
```

| Token in a bar | Meaning |
|---|---|
| `G` | This chord starts at this slot. |
| `.` | Continue the previous chord for this slot. A leading `.` continues the previous bar's chord. |
| `(C D)` | Split one slot evenly between the listed chords. |
| `^D` | Push: the chord lands one subdivision early (usually crossing the previous barline). |
| `N.C.` | No chord (silence). |
| `%` | As the only token in a bar: repeat the previous bar. |
| empty bar `\|   \|` | Continue the previous chord for the whole bar. |
| `"text"` | Annotation. It takes no time. |
| `\|: ... :\|` | Repeat (two passes). `:\|x3` gives three passes (no space before `x3`). |
| `[1`, `[2` | First token of a bar: that bar belongs to ending 1 or 2 of a repeat. |
| `\|\|`, `\|]` | Double and final barline (visual). |
| `[2/4]` | First token: this one bar is in 2/4 (a one-bar meter change). |

**The slot rule.** The tokens in a bar divide it into that many equal slots. For a meter with B beats per bar, the slot count N is valid if N = 1, or N divides B, or N is B times 2, 4, 8 and so on (eighths, sixteenths).

| Meter | Valid slot counts per bar |
|---|---|
| 4/4 | 1, 2, 4, 8, 16 (not 3, 5 or 6) |
| 3/4 | 1, 3, 6, 12 (not 2) |
| 2/4 | 1, 2, 4, 8 |
| 6/8 | 1, 2, 6, 12 (`\| G C \|` is two dotted-quarter beats and is fine) |
| 12/8 | 1, 2, 4, 12 |

A chart bar always lasts exactly its meter. A bare `/` in a chart is not allowed; use `.`.

A chart line can sit in a section above chordless or chord-bearing lyrics; the lyrics then bind to the chart's bars. Lines that start with a barline are charts, so escape a lyric that must start with `|` as `\| ...`.

### 5.5 Chord definitions

Standard chords need no definition. Define a chord when you want a specific voicing or a diagram:

```tabu
Tabu: 0.1
Title: Chord definition demo
Chord: G = 320003 fingers=210003
Chord: G@rock = 320033 fingers=210034
Chord: D7 = xx0212 fingers=xx0213 | x57575 fingers=x13141 barre=5
Chord: E = x-7-9-9-9-7 base=7
Chord: Bm = x(14)(16)(16)(15)(14) base=14
Chord: C = 332010 bass=5/6

# Verse 1
[G]La la [D7]la
```

- Frets run **low string to high string**, one character per string: `x` is muted, `0` to `9` is a fret. For frets 10 and above use parentheses `(12)`, or use the dashed form `x-12-11-12-12-x`. Frets are absolute and relative to the capo.
- `fingers=` has one character per string: `x`, `0` or `-` means no finger, `1` to `4` are fingers, `T` is the thumb.
- `barre=F` draws a barre at fret F. `base=F` sets the first fret shown in the diagram. `name="..."` sets a display name.
- A voicing after `|` on the same line is an alternate (`@2`, `@3`). `G@rock` defines a named alternate; use it in the song as `[G@rock]` or `G@rock` in a chart.
- `bass=6/4` names the strings (1 is the highest) used for the bass `B` and alternate bass `b` of a pattern, when the default choice is wrong.
- Chord definitions are file-wide. They live in the header (`Chord:` lines).

**Chord symbols** accepted: root `A`-`G` with optional `#` or `b`; qualities `m`, `min`, `maj`, `M`, `dim`, `aug`, `+`, `sus2`, `sus4`, `add9`, `no3`; numbers `5 6 7 9 11 13`, `maj7`, `6/9`; alterations `b5 #5 b9 #9 #11 b13`; slash bass `D/F#`; and `N.C.` for no chord. `C6/9` is a six-nine chord, not C over 9.

## 6. Rhythm: strum patterns and picking patterns

### 6.1 One-line patterns

Define a pattern in the header (or with `@pattern NAME = ...` in the body), then switch it on with `@strum NAME`:

```tabu
Tabu: 0.1
Title: Pattern demo
Time: 4/4
Pattern: island  = D . D U . U D U
Pattern: waltz   = B . D U D U
Pattern: travis  = B 3 b 2 B 3 b 2
Pattern: pinch   = B+1 3 b 2 B+1 3 b 2
Pattern: twobar  = D . D U . U D U | D . . . D U D U
Pattern: compact = D.DU.UDU

# Verse 1
@strum island
| G | C | G | D |
```

Each token is one equal slot of the bar (the slot rule from section 5.4 applies to the pattern's own bar: an 8-slot pattern in 4/4 is eighths; a 6-slot pattern in 3/4 is eighths).

| Token | Meaning |
|---|---|
| `D` / `U` | Downstroke / upstroke across the chord's strings. |
| `d` / `u` | Light stroke on the top three or four strings. |
| `x` | Muted strum ("chuck"). |
| `B` / `b` | Bass note / alternate bass note of the current chord. |
| `1` to `9` | Pluck that string of the chord voicing (1 is the highest string). |
| `B+1`, `2+3` | Notes played together (a pinch). |
| `>` prefix | Accent, for example `>D`. |
| `.` or `-` | No stroke. The hand keeps moving and the strings keep ringing. |
| `!` | Rest: stop all ringing strings. |

- A pattern bar written without spaces (`D.DU.UDU`) is read one character per token. It cannot contain `+` or `>`.
- `|` separates the bars of a multi-bar pattern. The pattern cycles and restarts at each section start.
- `.` never stops sound; `!` always does.
- `@strum NAME` applies the pattern to every chart bar, bar-marked lyric bar and instrumental chord-line bar until `@strum off` or another `@strum`. A chord change replaces the voicing at its exact slot. Tab and other grid systems are always played exactly as written; patterns never apply to them.
- Without any `@strum`, playback strikes one downstroke at each chord onset.
- Triplet patterns need an explicit grid: `Pattern: shuffle = D . U D . U D . U D . U grid=1/8t`.

### 6.2 Pattern blocks and the `T|` ruler (fingerpicking and strum grids)

`@pattern NAME` with no `=` defines the pattern from the lines directly after it. Those lines are a **definition, not bars**. They contain a `T|` count ruler and either an `S|` strum lane or string lines of pattern cells:

```tabu
Tabu: 0.1
Title: Pattern block demo
Time: 3/4

@pattern arp
T| 1 + 2 + 3 + |
e|-------o-----|
B|-----o---o---|
G|---o-------o-|
D|-------------|
A|-------------|
E|-B-----------|

@pattern island
T| 1 + 2 + 3 + 4 + |
S| D   D U   U D U |

# Verse 1
@strum arp
| Am | G | C | Am |
```

| Cell in a pattern block | Meaning |
|---|---|
| `o` | Play this string as fretted in the current chord voicing (a muted string in the voicing stays silent). |
| `B` / `b` | The chord's bass / alternate bass, whatever string that is. By convention written on the lowest row. |
| `0`-`24` | A literal fret on that string. |
| `x` | Dead note. |
| `-` | Nothing. |
| `!` | Stop this string. |

`o` and `B` mean "how to play", not "which notes", so one pattern serves every chord in a song. Cells must start directly under a ruler token. The `S|` lane puts `D`/`U`/`x`/`.` under ruler tokens, the same as a one-line pattern with explicit timing.

## 7. Tab: riffs, intros and solos

### 7.1 Anatomy of a tab system

```tabu
# Intro
> Open strings ringing.
   G             G7
T| 1 + 2 + 3 + | 1 + 2 + 3 + |
e|-------------|-------1-----|
B|-------0---0-|---------0---|
G|-----0---0---|-----0-----0-|
D|---0---------|---0---------|
A|-------------|-------------|
E|-3-----------|-3-----------|
```

From the top: an optional **chord lane** (chords over the ruler), the **`T|` ruler**, then six **string lines** `e B G D A E` from highest to lowest. A *system* is a run of consecutive lines; a blank line ends it. Bars continue from one system to the next in a section.

Rules:

- Write exactly as many string lines as the tuning has strings (six for standard guitar), top line highest pitch. Strings are matched by order, not by label. Use labels `e B G D A E` for standard tuning.
- Barlines `|` must sit in the same column on every line of the system, including the ruler.
- Use `||`, `|]` (final), `|:` and `:|` for double, final and repeat barlines. Do not put repeat counts (`:|x3`) or voltas (`|1.`) inside a staff: a digit there reads as a fret. Put `x3` or `[1` in a chord lane, or use `@repeat`.
- Use `-` to fill. `.` is not used in staff lines.

### 7.2 The `T|` count ruler and how timing works

The ruler is the count line teachers write over a riff. **A note starts at the ruler token directly above its first character.** Spacing is free: use two columns per slot for single-digit frets, three if you need two-digit frets or technique letters between notes. Only token positions matter.

| Ruler token | Simple meters (4/4, 3/4, 2/4) | Compound meters (6/8, 12/8) |
|---|---|---|
| `1`, `2`, `3`... | beat number | beat number (dotted beat; or count eighths `1 2 3 4 5 6`) |
| `+` or `&` | halfway through the beat | one third of the way |
| `e` | quarter of the beat (sixteenths: `1 e + a`) | not allowed |
| `a` | three quarters of the beat | two thirds of the beat |
| `trip`, `let` | triplet positions (`1 trip let`) | not allowed |
| `.` | placeholder position | placeholder |
| `[p/q]` | first token only: one-bar meter change | same |

Tokens are positional by name. `1   a` means the fourth sixteenth of beat 1, with no need to write the gaps. In a beat with `.` placeholders, the beat's tokens divide it evenly.

Bar rules (each violation is an error):

- Beat numbers in a bar count up consecutively, and the first token of each bar is a beat number.
- Every bar must be a **full bar** of the meter: it must end on the last beat. In 4/4 the ruler runs `1 + 2 + 3 + 4 +` (or `1 2 3 4`).
- Exception 1: the **first bar of a section** may start late. That makes it a pickup: `T| 3 + | 1 + 2 + 3 + |` in 3/4 starts the section with a one-beat pickup of beat 3 and its "and".
- Exception 2: the last bar of the whole song may end early.
- Every note must start exactly under a ruler token.

Triplets in a simple meter: write `1 trip let 2 trip let ...`. Sixteenths: `1 e + a 2 e + a ...`. 6/8 counted in eighths: `1 2 3 4 5 6`; counted in dotted beats: `1 + a 2 + a`.

### 7.3 Techniques

Technique letters sit between fret numbers in the gaps and do not take up time. The onset of a note is the column of its first fret digit.

| Technique | Write | Notes |
|---|---|---|
| Fretted note | `0` to `24` | At most two digits, so `1-2` needs a separator, not `12`. |
| Dead (muted) note | `x` | |
| Ghost note | `(5)` | |
| Natural harmonic | `<12>` | Onset at `<`. |
| Artificial harmonic | `5<17>` | Fretted at 5, touched at 17. |
| Hammer-on | `5h7` | 7 sounds under its own ruler token. `h7` alone is a hammer-on from nowhere. |
| Pull-off | `7p5` | |
| Legato slide | `5/7`, `7\5` | The target is not picked. |
| Shift slide | `5s7` | The target is picked. |
| Slide in | `/7`, `\7` | |
| Slide out | `7\-`, `7/-` | |
| Bend | `7b9`, `7b(1/2)`, `7b(full)`, `7b(1.5)` | A fret target names the pitch reached; an amount in parentheses is in tones. |
| Bend and release | `7b9~~~r7` | |
| Pre-bend | `7pb9` | Picked already bent. |
| Pre-bend and release | `8pb10--r8` | |
| Vibrato | `7~~~` | Over the columns it covers. |
| Tapping | `t12`, `5h8t12p5` | |
| Trill | `5tr7` | |
| Stop (cut the string) | `!` | |
| Tie mark | `_` | Notation only. |

A connector (`h p / \ s t b r`) links the nearest note on its left and right on the same string within the same bar. To link across a barline, put the connector directly before the barline and start the next bar with the target: `7-/|9--`.

**Effect lanes** are unlabelled lines above or below the string lines. They carry techniques that span columns. The reference parser recognises these tokens on a line directly above the ruler or chord lane:

| Token | Meaning |
|---|---|
| `PM----` | Palm mute over the dashed span. |
| `LR----` | Let ring over the span. |
| `>` | Accent at that column. |
| `arp` | Arpeggiated (rolled) chord at that column. |
| `p i m a` | Picking-hand finger letters at those columns. |

The full spec also defines `PH`, `TH`, `AH`, `NH`, `TP`, `WV`, `vib`, `rake`, `v`, `^`, `fermata` and quoted text.

Example with chord, picking-finger and palm-mute lanes, a hammer-on, a bend and an accent lane:

```tabu
Tabu: 0.1
Title: Technique demo
Time: 4/4

# Solo
   Em
   p i m a
   PM------           >
T| 1 + 2 + 3 + 4 + |
e|-------7b9~~~----|
B|-3h5---------0---|
G|-----------------|
D|-----------------|
A|-----------------|
E|-0---------------|
```

Annotation lanes (chords, finger letters, `PM`, `>`) sit above the ruler and start in columns directly over ruler tokens.

### 7.4 Untimed tab

If a tab system has **no `T|` ruler**, it is **untimed**: each bar lasts one bar of the meter, and the notes in it are spaced evenly in column order. This is what pasted ASCII tab becomes. It is valid, and shows a note that it is untimed, but it cannot give exact playback or scroll timing. Prefer adding a ruler.

## 8. Drums (optional)

Drums are an optional backing groove for playback. They are not drum notation. A file without any is complete.

Use a built-in style, or define your own grid with `@drums`:

```tabu
Tabu: 0.1
Title: Groove demo
Time: 4/4
Groove: rock

@drums verse
    T| 1 + 2 + 3 + 4 + |
  hat| x x x x x x x x |
  rim| - - x - - - x - |
 kick| x - - - x x - - |

# Verse 1
@groove verse
| G | C | G | D |

# Chorus
@groove rock
@fill end
| C | G | D | G |
```

- `Groove: NAME` (header) sets the starting backing; `@groove NAME` changes it from the next bar; `@groove off` stops it. `@fill` replaces one bar with a fill (`@fill end` fills the last bar of the section).
- Built-in styles: `rock`, `halftime`, `disco`, `shuffle`, `train`, `waltz`, `ballad`, `bossa`, `onedrop`, `shaker`, `fill`. Each picks its own variant for the meter.
- A drum grid is `@drums NAME` followed directly (no blank line) by one `T|` ruler and drum lanes `voice|`. Each step must sit under a ruler token. Steps: `x` hit, `X` accented hit, `g` ghost note, `o` open hi-hat (on a `hat` lane), `f`/`F` flam, `!` choke, `-` no hit.
- Voices: `kick`, `snare`, `rim`, `clap`, `hat`, `ohat`, `pedal`, `ride`, `bell`, `crash`, `tom1`, `tom2`, `tom3`, `floor`, `tamb`, `cowbell`, `shaker` (plus short aliases like `bd`, `sd`, `hh`).
- Drums never change the bars of the song. They play under every bar, tab included.

## 9. Common mistakes and fixes

| Mistake | Symptom | Fix |
|---|---|---|
| Tab with no `T\|` ruler | System is labelled untimed; no exact timing | Add a ruler line and put each note under a ruler token. |
| Note not under a ruler token | Timing error | Move the fret digit to the column of the token. For two-digit frets the **first** digit is the onset column. |
| Bar too short or too long under the ruler | Bar error | Every bar must be a full meter: `1 + 2 + 3 + 4 +` in 4/4. Only a section's first bar (pickup) and the song's last bar may be short. |
| Wrong number of string lines | Error | Exactly one line per string (six in standard tuning). |
| Barlines misaligned between lines | Error | Every `|` in the same column on ruler, strings and `S|`. Use a monospace editor. |
| Tab characters in tab or chord-over-lyric lines | Alignment error | Use spaces only. |
| Chord used but never defined and not in the dictionary | No diagram shown (info) | Add `Chord: Name = frets` (section 5.5). Check spelling and case: `Am7`, not `am7`. |
| Chord symbol typo in a chart or `[ ]` | Error or warning | Use valid symbols (section 5.5). `[sic]` is not a chord; write `\[sic\]` for brackets in lyrics. |
| Lyric line read as a chord line | Words missing, treated as chords | A line made only of words like `A`, `Am`, `Add`, `Dim`, `Cm` is a chord line. Prefix with `\` to force a lyric: `\Add to that`. |
| Chord line misread because of a stray word | The chord line is shown as lyrics | Every word on a chord line must be a chord. Move comments to a `//` line or a `>` note. |
| Chord line separated from its lyric by a blank line | Chords become an instrumental line | Remove the blank line. |
| Chart line with a bad slot count (3 slots in 4/4, 2 in 3/4) | Slot-rule error | Use `.` to make the count valid (`\| G . C . \|`), or use 1, 2 or 4 slots in 4/4. |
| `Key: value` in the body | Treated as a lyric | Move it to the header. |
| `@strum NAME` with an undefined pattern | No strumming | Define it with `Pattern:` or `@pattern`. |
| Unknown directive (typo, or a spec directive the parser lacks) | Warning "unrecognized directive" | Fix the spelling, or remove it. |
| Child section whose parent is missing (`# Verse 2 < Verse 9`) | "Unknown parent" | Name an existing section exactly. |
| Trailing `//` comment on a lyric or tab line | Comment becomes content | Put the comment on its own line. |
| Repeat count or volta inside a staff | Error | Put `x3` or `[1` in a chord lane, or use `@repeat`. |
| Two adjacent two-digit frets with no gap (`1213`) | Error | Separate notes: `12-13`. |

## 10. For AI agents

You are asked to turn a song the user provides into a valid `.tabu` file. Follow these steps in order.

### 10.1 Before you write

1. **Rights check.** Only produce chords, lyrics and tab of material the user supplied or has the right to share. Do not reproduce song lyrics or tab from memory for copyrighted songs. If the user did not supply the words, either write an original song, use a public-domain song, or write a chords-and-form chart with no lyrics (`Rights: skeleton`). Never invent the rights status: set `Rights:` honestly (section 11).
2. **Set `Origin: llm-assisted`** unless a human wrote the content.
3. Use only the notation in this guide. Do not use the spec-only directives that the reference parser does not recognise (see 10.3).

### 10.2 Checklist

1. **Headers first.** `Tabu: 0.1` on line 1, then `Title`, `Artist`, `Rights`, `Explicit`, `Origin`, and `Source` where required. Add `Key`, `Time`, `Tempo`, `Capo`, `Tuning` when known. Put `Chord:` and `Pattern:` lines in the header.
2. **Structure.** List the sections the song has (`Intro`, `Verse 1`, `Chorus`, ...). Use `# Verse 2 < Verse 1` when verses share a chord progression and bar layout. Add a `Form:` header if the play order is not the document order.
3. **Chords per bar.** Write each section's progression as bars: either lyric lines with `|` bar marks and `[Chord]` inline chords, or `| G | C | D | G |` chart lines. Count the slots in every bar against the slot rule (section 5.4).
4. **Strum pattern.** Add `Pattern:` and `@strum NAME` in the sections where the player strums or picks. The pattern's slot count must fit the meter.
5. **Tab for riffs.** For intros, riffs and solos, write a tab system with a `T|` ruler. Rules to check:
   - exactly six string lines in standard tuning (`e B G D A E`), highest first
   - every `|` in the same column on every line
   - every bar full under the ruler (only a section's first bar and the song's last bar may be short)
   - every fret digit starts exactly under a ruler token
   - no `:|x3` or `|1.` inside a staff
6. **Verify chords.** List every chord used anywhere in the file. Each must be a valid symbol, and either be a standard chord or have a `Chord:` line. A chord with a specific voicing needs a definition.
7. **Verify tab.** Re-read every tab system: count the string lines, check the ruler, then check each bar.
8. **Output only the file.** Reply with the complete `.tabu` text and nothing else (no commentary, no code fence unless the user asks for one).

### 10.3 What the reference parser accepts today

The reference parser is the Dart package `tabulation_core`. It is lenient: it reads every well-formed line and reports **warnings** for: an unrecognised directive and an unknown parent in an inherited section. Recognised directives today: `@pattern`, `@strum`, `@play`, `@hold`, `@mark`, `@groove`, `@drums`, `@fill`, `@tempo`, `@time`, `@voicing`, `@key`, `@capo`. Other spec directives (`@pickup`, `@free`, `@repeat`, `@tuning`, `@feel`, `@grid`, `@ring`, `@part`, `@chord`) produce a warning for now; prefer the header equivalents (`Chord:`, `Tuning:`, `Feel:`), or leave them out.

The parser does **not** yet check alignment against the ruler, slot counts, bar lengths or chord spelling. Those are in the spec and in the validator that is coming, so you must check them yourself with the checklist above.

### 10.4 Validating with the reference parser

There is no command-line tool yet. A **hosted validator is coming**; until then, use this tiny script. Save it as `check.dart` inside `packages/tabulation_core/` of the Tabulation repository:

```dart
import 'dart:io';
import 'package:tabulation_core/tabulation_core.dart';

void main(List<String> args) {
  final song = parseSong(File(args.first).readAsStringSync());
  print('title: ${song.title}  sections: ${song.sections.length}');
  for (final w in song.warnings) {
    print('warning: $w');
  }
  exit(song.headers['tabu'] == '0.1' && song.warnings.isEmpty ? 0 : 1);
}
```

Run it from that directory:

```
cd packages/tabulation_core
dart run check.dart /path/to/song.tabu
```

Exit code 0 means: first line is `Tabu: 0.1` and there are no warnings. Fix every reported warning and re-run. A clean result is necessary but not sufficient, because of the limits in 10.3: finish by re-checking the ruler, the string lines and the chord list by hand.

## 11. Rights and uploading

- You can upload songs to the TabuTabu library. **The uploader is responsible for having the right to share what they post.**
- Rights holders can file a takedown notice at https://tabutabu.app/dmca. Uploaded songs may be removed after a valid notice.
- Public-domain songs and your own original songs are always welcome.
- The format never restricts content. `Rights:` is a declaration that libraries check against their own policy.

`Rights:` values:

| Value | Use it when | Notes |
|---|---|---|
| `public-domain` | The words and music are in the public domain. | Give `Source` and a `Composed` year (US public-domain cutoff: published in 1930 or earlier, as of 2026). |
| `traditional` | A traditional song from a printed source. | Give `Source` citing the print source. |
| `cc` | Under a Creative Commons licence. | Give `License` and a `Source` URL. "No derivatives" licences are not accepted. |
| `original` | Your own song. | |
| `permission` | Used with the rights holder's permission. | Keep the contact on file. |
| `user-submitted` | Your own transcription or arrangement of a song whose rights you do not hold. | Accepted by the TabuTabu upload library under its upload terms and takedown process. Not accepted by the open GitHub library. |
| `skeleton` | A chords-and-form chart with no lyrics, melody or riffs. | The label is checked: no lyric lines, no literal-fret tab. If it fails, relabel the file instead of deleting your work. |

Also set `Explicit: yes` or `no`, `Title` and `Artist` (all required for upload). `Source` is where the words, tune and chords came from. `Origin: llm-assisted` tells the library an AI helped, and uploads may require the uploader to confirm the content.

## 12. Complete annotated example

This is a public-domain song ("Oh! Susanna", Stephen Foster, 1848), shortened to one verse and the chorus, with an intro and a short break. Every feature in it is explained below the file.

```tabu
Tabu: 0.1
Title: Oh! Susanna
Artist: Stephen Foster
Composer: Stephen C. Foster
Lyricist: Stephen C. Foster
Composed: 1848
Arranger: Tabulation guide example
Rights: public-domain
License: CC0-1.0
Source: Words and music: Stephen C. Foster, "Oh! Susanna" (Cincinnati: W. C. Peters, 1848), public domain. Intro, accompaniment and break are original to this file.
Origin: human
Explicit: no
Lang: en
Key: G
Time: 4/4
Tempo: 116
Tuning: standard
Capo: 0
Difficulty: 2/5
Tags: folk, americana, singalong, flatpicking
Form: Intro, Verse 1, Chorus, Break, Chorus, Outro
Chord: G = 320003 fingers=210003
Chord: C = x32010 fingers=x32010
Chord: D7 = xx0212 fingers=xx0213
Pattern: boomchick = B . D U b . D U      // bass, strum, alternate bass, strum

# Intro
> The last line of the chorus as a melody. The hammer-on is open G to A on the G string.
         G                 D7      G
T| 4 + | 1 + 2 + 3 + 4 + | 1 + 2 + 3 + 4 + | 1 + 2 + 3 + 4 + |
e|-----|-------0---------|-----------------|-----3-------3---|
B|-----|-0-3-3---3-0-----|-0-0-------------|-----0-------0---|
G|-0h2-|-------------0h2-|-----2-2-0-------|-----0-------0---|
D|-----|-----------------|-0---------------|---------0-------|
A|-----|-----------------|-----------------|-----------------|
E|-----|-3---------------|---------3-------|-3---------------|

# Verse 1
@strum boomchick
// Each | starts a bar; a chord after words changes on its beat.
I come [G]from Alabama with my | banjo on my [D7]knee,
I'm going [G]to Louisiana, my | [D7]true love for to [G]see.

# Chorus
Oh! Su[C]sanna, oh don't you | [G]cry for [D7]me,
For I come [G]from Alabama with my | [D7]banjo on my [G]knee.

# Break
> Flatpicked break over the verse chords. Bar 3 bends the B-flat up a half step.
   G                 G       D7        G
T| 1 + 2 + 3 + 4 + | 1 + 2 + 3 + 4 + | 1 + 2 + 3 + 4 + |
e|-----------0-----|-----------------|-----------------|
B|-3---0-1p0---3-0-|---------1---1p0-|-----0---3---0---|
G|-----------------|-2-0-----2-------|-3b4~~-------2p0-|
D|-----------------|-----2-0-0-------|-----------------|
A|-----------------|-----------------|-----------------|
E|-3---------------|-3---------------|-3---------------|

# Outro
@hold 3
   G
   arp
T| 1 + 2 + 3 + 4 + |]
e|-3---------------|]
B|-0---------------|]
G|-0---------------|]
D|-0---------------|]
A|-2---------------|]
E|-3---------------|]
```

What each part is doing:

- **Headers.** `Rights: public-domain` plus `Source` and `Composed` document why the song may be shared. `Explicit` is required for upload. `Form` lists the play order, which plays the Chorus again after the Break and ends with the Outro. `Chord:` lines give voicings. `Pattern:` defines a one-bar "boom-chick" with eight slots: `B` bass, `D`/`U` strums, `b` alternate bass.
- **`# Intro`.** A `>` note, a chord lane (`G`, `D7`, `G`), the `T|` ruler and six string lines. The first bar `T| 4 + |` is a pickup: it holds only beats 4 and "and", then full bars follow. Notes sit directly under ruler tokens; `0h2` is a hammer-on where the `2` sounds on the next token.
- **`# Verse 1`.** `@strum boomchick` strums every bar of the section. Each `|` starts a bar; `[G]`, `[D7]` are inline chords. "I come" before the first chord is a pickup.
- **`# Chorus`.** A section with no `@strum` of its own continues the pattern in force (document order). A `# Chorus` heading with an empty body later (or a `Form` entry) replays it.
- **`# Break`.** A solo with techniques: `1p0` is a pull-off, `3b4~~` is a bend to fret 4 with vibrato, `2p0` another pull-off. Notes of the solo are exact; the strum pattern does not apply to tab.
- **`# Outro`.** `@hold 3` extends the final bar by three beats. The `arp` token rolls the chord, and `|]` closes the song with a final barline.

## 13. Spec features not covered here

These exist in the spec but are left out of this guide because the reference parser does not recognise them yet, or because they are not meant for hand-writing: `@pickup`, `@free`, `@repeat`, `@tuning`, `@feel`, `@grid`, `@ring`, `@part` and `@chord` directives; column-mode and `Grid:` timing for ruler-less tab; multi-part tab with `part:` prefixes; `L|` lyric lanes and `N|` token lanes; chord-over-lyric "chart over lyric" layout; tempo ramps (`@tempo 84->96 4`); Nashville chord names; ChordPro, ASCII tab and Guitar Pro import. See https://tabutabu.app/spec.md.
