# Tabu: plain-text format for guitar songs and tablature

**Specification v0.1 (draft), 2026-11-27.** Format identifier `Tabu: 0.1`. File extension `.tabu`.

This spec merges the three format proposals in `docs/proposals/`, following the two judges' verdicts:

- **Base:** rhythm-first's skeleton and engine. That covers flat `Key: value` headers, `#` sections, `@` directives, blank-line systems with no block delimiters, the exact rational timeline, performance-bar addresses, stable diagnostic codes and validation levels.
- **From markdown-native:** the surface notation. That covers chord-over-lyric lines, the count ruler that times ordinary-looking ASCII tab, pattern tabs that use `o`, `(C D)` beat splits, `@voicing` selectors and the Markdown embedding story.
- **From chordpro-plus:** the on-ramps. That covers inline `[Am]` chords as a first-class form, layered timing levels L0 to L3, line-parallel inheritance for chordless verses, the push `^`, ChordPro import/export and the sniffing cascade.

§27 lists every fatal flaw the judges found and how this spec resolves it. The three files in `examples/` are normative illustrations, and each one parses under §19.

Keywords: **MUST**, **SHOULD** and **MAY** are used in the RFC 2119 sense. "Error" means the file is invalid at the given validation level (§20). "Warning" means it is valid but suspicious. "Info" is advisory.

---

## 0. Status

- Everything in this draft may still change before `Tabu: 1.0`. Files declare `Tabu: 0.1`. The formatter (`tabu fmt`) rewrites the version line when the spec moves.
- **The conformance corpus is the spec of record** (§28). Where this prose and the corpus disagree, the corpus wins and the prose gets fixed.
- Out of scope for 0.1, reserved for later minor versions: grace notes, two-voice notation (independent stems), D.S./coda navigation, standard-notation hints, slap/pop, whammy-bar curves, and chord-diagram fingering for the picking hand.
- **Not planned for the format at all:** full drum notation (drum tab, a written-out drum part per bar). The format has only the small, optional groove feature of §11.5 to §11.12, for backing playback and MIDI export. Full scores go out through MusicXML or Guitar Pro export (§25.4).
- **Rights are not a format rule.** Every construct in this spec, lyrics included, is valid in every file whatever its `Rights` value. Which songs a given library or host publishes, and in what form, is publishing policy, checked by optional linter profiles (§22).

---

## 1. Identity

| Item | Value |
|---|---|
| Format name | **Tabu**, short for Tabulation. The app and the project are "Tabulation". |
| Extension | **`.tabu`**. It is the only native extension. Searches found no existing file format using it; the nearest hits were the LaTeX `tabu` package, which ships `.sty`, and the PASSOLO `.tbu` bundle. |
| Encoding | UTF-8. A BOM is tolerated. Line endings may be LF or CRLF. |
| MIME | `text/vnd.tabulation.tabu; charset=utf-8`, to be registered in the IANA vendor tree. Until registration, servers send `text/plain; charset=utf-8` so that browsers display the file instead of downloading it. |
| Apple UTI | Exported `<owned-reverse-dns>.tabu`, conforming to `public.utf8-plain-text`. Tags: `public.filename-extension = tabu` and the MIME type above. |
| Windows | MSIX `file_extension: .tabu`, ProgID `Tabulation.Song`, `PerceivedType=text`. |
| Android | Intent filters for the MIME type, `text/plain` and `application/octet-stream`, followed by content sniffing. |
| Magic | The first non-empty line, after an optional BOM and an optional opening `---` line, matches `^Tabu:\s*\d+(\.\d+)?\s*$`. That line also declares the version. |

**Optional `---` wrapper.** A file MAY wrap its magic line and header in `---` lines so that Obsidian and GitHub show them as properties:

```tabu
---
Tabu: 0.1
Title: Amazing Grace
---
```

The wrapper does not make the header YAML. The rules in §5 apply unchanged. Note that tools which *do* parse the block as YAML may misread values such as `Title: 1979`; this is the reason the wrapper is optional and the formatter does not add it by default.

**Sniffing cascade**, used on every platform and required on Android, where `content://` URIs often arrive without a name. It runs on the first 4 KB:

1. The magic line, optionally inside `---`, means Tabu.
2. `{title:`, `{t:`, `{start_of_` or `{sov` means ChordPro, which goes to the importer (§25.1).
3. Three or more lines matching `^\s*[A-Ga-g1-9][#b]?\s?\|[-0-9]` mean ASCII tab, which goes to the importer (§25.2).
4. Anything else is plain text, imported as lyrics.

**Other extensions.** The app registers only as an *alternate* opener for `.tab`, `.txt`, `.cho`, `.chopro`, `.crd`, `.gp*`, `.musicxml`, `.mxl` and `.mid`, and routes each one to an importer. It never claims `.tab` (MapInfo and Typinator use it) or `.md`.

**Markdown hosting.** Markdown is a *host*, not the file type. A song is embedded in any `.md` file as a ```` ```tabu ```` fenced block. The block contains either a whole file (with its magic line) or a **fragment** with no magic line, which is parsed with default header values (§24.2). "Copy as Markdown" in the app and on the site produces exactly this.

---

## 2. Design principles

1. **It reads like what guitarists already write.** That means chord-over-lyric sheets, `| G | C |` charts, `D . D U` strums and six-line ASCII tab. This spec gives each convention one exact meaning; it does not invent new notation where an old one works.
2. **The text is the score.** Nothing exists only in the rendered view. A monospace printout is a usable chart.
3. **Time is exact and rational.** Every event lowers to `(onset, duration)` as fractions of a whole note. Seconds come only from the tempo map. Two conforming parsers MUST produce identical timelines (§17).
4. **Timing is layered and optional.** A bare chord sheet is valid (level L0). Bar charts, strum patterns and timed tab raise the level (L1 to L3, §20.2). No timing layer is ever required, including in the library.
5. **One meaning per glyph, scoped by lane.** `b` is a flat in a chord, a bend in a staff and an alternate bass in a pattern. `.` never stops sound and `!` always does (§12.9).
6. **Nothing can swallow the file.** There are no start/end pairs. Blank lines separate systems, so an error stays inside its system (§21).
7. **Deterministic structure.** Play order, repeat passes, the state at every bar and bar addresses are all computable from the file alone. A/B loops, practice statistics and audio sync depend on this.
8. **Lenient in, strict out.** One spec has three validation levels. Importers and the live editor accept messy input and report every assumption they make.
9. **Rights and provenance travel with the file.** `Rights`, `Source`, `License` and `Origin` are headers. Publishing linters check them against each home's policy (§22). They never change what the file may contain.

---

## 3. A short tour

```tabu
Tabu: 0.1
Title: Down in the Valley
Artist: Traditional
Key: G
Time: 3/4
Tempo: 100
Pattern: waltz = B . D U D U

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

# Turnaround
T| 1 + 2 + 3 + | 1 + 2 + 3 + |
e|-------------|-------------|
B|-------------|-0-----------|
G|-0---2---4---|-------------|
D|-------------|-------------|
A|-------------|-------------|
E|-------------|-3-----------|
```

- A plain text editor shows a chord sheet followed by an ordinary tab.
- The app shows a timed song. Each `|` in the lyrics starts a bar. The waltz pattern strums each bar. The ruler (`T|`) gives every tab note an exact beat.

---

## 4. File structure

### 4.1 Lines and columns

- A file is a sequence of lines. **Whitespace-only lines are blank.**
- **Columns** count Unicode grapheme clusters. East Asian Wide and Fullwidth characters count as 2 (UAX #11).
- **Column-sensitive lines** are staff lines, `T|`, `S|`, `L|` and `N|` lanes, drum lanes (§11.6), chord and effect lanes, chord lines and chart lines placed over lyrics. Staff, ruler, strum, drum and token lanes MUST be ASCII.
- **Tab characters** (U+0009) in column-sensitive lines are error E100 in strict mode. In lenient mode they expand to the next multiple of 4, and `tabu fmt` rewrites them.

### 4.2 Comments, notes and escapes

| Syntax | Where | Meaning |
|---|---|---|
| `// text` as the whole line | anywhere in the body or header | Comment. It is ignored by the parser and does not break a system (§4.5). |
| ` // text` after content, with at least one space before it | header, heading, directive, chart and chord lines | Trailing comment. It is not allowed on staff, lane or lyric lines, where `//` can be content (for example a URL in a lyric). |
| `> text` | body | Performance note, rendered as a callout. Consecutive `>` lines form one note. It carries no timing. |
| `\` at the start of a body line | body | Forces the line to be a lyric line. The backslash is dropped (`\| not a chart`, `\# 1 fan`, `\A E` as lyrics). |
| `\[`, `\]`, `\|`, `\\` | lyric lines | Literal characters. |
| `\//` | header values | A literal `//`. |

### 4.3 Header

The header is the magic line followed by the **leading run of header lines**. Blank lines and comment lines MAY appear inside the run. The header ends at the first line that is none of these (normally the first `#` heading).

- A header line is `Key: value`, starting in column 0. The key matches `[A-Za-z][A-Za-z0-9-]*` and is case-insensitive. The value is the rest of the line after `:` and any whitespace, up to an optional trailing comment.
- **Values are literal text.** There is no quoting, no type coercion and no nesting. `Title: 1979`, `Title: We're #1`, `Title: Re: Your Brains` and `Title: True` all mean exactly what they say. Quote characters are part of the value.
- Repeatable keys (`Chord`, `Pattern`, `Part`, `Links`) accumulate. For any other key, a duplicate is warning W211 and the last one wins.
- Unknown keys are preserved and round-tripped. They draw warning W201, except keys starting with `X-`, which are silent (§23).
- A `Key: value` line *in the body* whose key is a known header key is a lyric line with warning W200 ("header key in body; move it into the header").

### 4.4 Body line kinds

Each body line is classified by the **first matching rule**:

| # | Kind | Test |
|---|---|---|
| 1 | blank | whitespace only |
| 2 | fence marker | three or more backticks at the start of the line (up to 3 spaces of indent), plus an optional info string. Ignored, so a pasted Markdown fence does no harm. |
| 3 | comment | first non-space characters are `//` |
| 4 | heading | `^#{1,2}\s` |
| 5 | directive | `^@[a-z]` |
| 6 | note | `^>` |
| 7 | escaped lyric | `^\\` |
| 8 | labelled lane | `^\s*(part:)?LABEL\|` where LABEL is a string label (`A`–`G`, `a`–`g`, optional `#`/`b`, or a digit `1`–`9`) or one of the lane labels `T` (ruler), `S` (strum), `L` (lyric lane) or `N` (token lane); or `^\s*VOICE\|` where VOICE is a drum voice label from the fixed table in §11.7 (case-insensitive, no part prefix). A lyric line that happens to start with `kick|` or `hat|` needs the `\` escape. |
| 9 | chart line | first non-space token is a barline: `\|`, `\|\|` or `\|:` |
| 10 | chord line | every whitespace-separated token (after removing a trailing comment) is a chord token: a chord symbol with an optional `^`, `N.C.`, or `\|` |
| 11 | lyric line | anything else |

Inside a grid system (§4.5), rules 9 to 11 are replaced by the grid-lane rules in §12.2.

### 4.5 Systems

A **system** is a maximal run of consecutive lines of kinds 7 to 11. Comment lines inside a run are transparent: they do not end it. Blank lines, headings, directives and notes do end it.

| System kind | Contains | Timing |
|---|---|---|
| **Grid system** | at least one staff line, `T\|`, `S\|` or `L\|` lane | ruler, grid columns or untimed (§12) |
| **Token system** | at least one `N\|` lane and no staff line | explicit durations (§18) |
| **Text system** | chart lines, chord lines and lyric lines only | §9 and §10 |

A **drum grid** is a grid system made of one `T|` ruler and drum lanes, written directly after `@drums NAME` (§11.6). Like a pattern block (§11.3), it is a definition and contributes no bars.

Bars continue from one system to the next within a section. A system boundary is a line break in the printout, not a musical event.

---

## 5. Header keys

| Key | Example | Meaning |
|---|---|---|
| `Tabu` | `0.1` | **Required, first line.** Format version (§23). |
| `Title`, `Subtitle` | `Amazing Grace` | |
| `Artist` | `Traditional` | The performer this version is associated with. |
| `Composer`, `Lyricist` | `John Newton` | Credits that matter for rights. |
| `Arranger` | `J. Doe` | Who made this arrangement or transcription. |
| `Album`, `Year` | `1997` | Recording facts. |
| `Composed` | `1779` | Earliest publication year the rights claim relies on. Used for the public-domain check (§22). |
| `Key` | `A`, `F#m`, `D dorian` | **The sounding (concert) key.** |
| `Capo` | `2` | Capo fret. **Chord names and tab frets are shapes relative to the capo**, so fret `0` is the capo. With `Key: A` and `Capo: 2`, chords are written as G shapes. The app shows both the shapes and the sounding names. |
| `Time` | `4/4`, `6/8`, `12/8`, `7/8 (2+2+3)` | Initial meter. A grouping in parentheses makes the meter additive (§16.1). Default `4/4`. |
| `Tempo` | `84`, `q=84`, `q.=60`, `h=72`, `e=180` | A bare number is beats per minute of the meter's beat (§16.1). The prefixed forms name the note value explicitly. Default `100`. |
| `Feel` | `straight`, `swing`, `swing 1/8 3:2`, `swing 1/16` | Playback only (§16.5). Default `straight`. |
| `Tuning` | `standard`, `drop-d`, `dadgad`, `open-g`, `open-d`, `half-step-down`, `E2 A2 D3 G3 B3 E4`, `G4 C4 E4 A4` | Strings from low to high, as a preset name or as scientific pitches. The string count comes from the tuning. Default `standard`. |
| `Grid` | `1/16`, `1/8`, `1/8t`, `auto` | Opt-in column timing for tab systems that have no ruler (§12.5). There is no default, so ruler-less tab is untimed. |
| `Ring` | `on` (default), `off` | Default sustain policy for tab notes (§12.8). |
| `CountIn` | `1 bar`, `2 beats` | Suggested count-in. |
| `Form` | `Intro, Verse 1, Chorus x2, Outro` | Play order (§6.3). |
| `Chord` | `G = 320003 fingers=210003` | Chord voicing (§8.2). Repeatable. |
| `Pattern` | `waltz = B . D U D U` | One-line strum or pick pattern (§11). Repeatable. |
| `Groove` | `rock`, `shaker`, `verse`, `off` | Optional drum backing at the start of the song: a built-in style (§11.11) or a drum grid defined in the file (§11.6). Default: none, so no drums. |
| `Part` | `lead "Lead guitar" tuning=standard capo=0 sound=steel` | Instrument part (§15). Repeatable. |
| `ChordNames` | `letters` (default), `nashville` | Whether chord symbols are letters or Nashville numbers (§8.1). |
| `Frets` | `20` | Highest fret, used for validation. Default `24`. |
| `Spread` | `18ms` | Strum spread between strings for playback. Default `18ms`. |
| `Difficulty` | `2/5` | |
| `Tags` | `folk, fingerstyle, 90s` | Comma-separated. |
| `Lang` | `en` | BCP-47 code for the lyric language. |
| `Explicit` | `yes`, `no` | Whether the lyrics are explicit. Used by store age ratings and content filters. Required by the `upload` linter profile (§22). |
| `Rights` | `public-domain`, `traditional`, `cc`, `original`, `permission`, `user-submitted`, `skeleton`, `licensed` | Declares the rights basis for publishing the file. Required by the `library` and `upload` linter profiles, which check it against each home's policy (§22). It never limits what the file may contain. |
| `License` | `CC0-1.0`, `CC-BY-4.0`, `CC-BY-SA-4.0` | SPDX id for *this file's* contribution (the arrangement or transcription). |
| `Source` | free text with URLs | Where the words, tune or chords came from. Required for `public-domain`, `traditional` and `cc`. |
| `Origin` | `human`, `import(chordpro)`, `import(ascii)`, `import(gp)`, `llm-assisted` | Provenance. AI-only output is not copyrightable, so it is tagged. |
| `Links` | URL | Where to listen or buy. Never used to sync with a streaming service. |
| `Transcriber`, `Contributors`, `Version`, `Updated` | | Library bookkeeping. |

---

## 6. Sections, form and play order

### 6.1 Headings

```tabu
# Verse 1
# Chorus x2                    // play this section twice in a row wherever it occurs
# Verse 2 < Verse 1            // inherit Verse 1's bars and directives (§6.4)
# Bridge {bars=8}              // estimated length for untimed lyrics (§10.6)
## Riff A                      // a named block: played only by @play or Form (§6.2)
```

- **`#` starts a section**, which runs to the next heading. The section *type* comes from the first word of the name, case-insensitive: `intro`, `verse`, `pre-chorus` (or `pre`, `prechorus`), `chorus`, `post-chorus`, `bridge`, `solo`, `interlude`, `instrumental`, `break`, `breakdown`, `riff`, `tag`, `coda`, `outro` or `ending`. Any other first word gives the type `custom`. The attribute `{type=...}` overrides this.
- **Names** are matched case-insensitively with whitespace collapsed. Attributes in braces are `bars=N` and `type=NAME`. Unknown attributes draw warning W212.
- **`xN`** at the end of a heading plays the section N times in a row each time it occurs.
- **There are no tempo, time or key attributes on headings.** Use directives (§7), so that all state lives in one mechanism.
- **Preamble.** Between the header and the first heading, the body MAY contain directives (definitions and state), pattern-block systems (§11.3), drum grids (§11.6), comments and notes. Bar-producing content there (chart, lyric, grid or token systems) is E200.
- **Definitions are file-wide.** `Chord:`, `Pattern:`, `@chord`, `@pattern` and `@drums` can be referenced from anywhere in the file, including before the point where they are defined. A second definition with the same name replaces the first, with warning W216. Named chord alternates (`G@rock`) are additions, not duplicates.

### 6.2 Named blocks (`##`)

A `##` heading starts a **named block**: a riff, fill or turnaround that is *defined* but not played in document order. It is played by `@play Name` or by naming it in `Form:`. Directives inside a block affect only that block (§7.2). Practice tracking and loops can address a block like a section.

### 6.3 Play order

- **With `Form:`**, play order is the comma-separated list. Each item names a section or block, optionally with `xN`. If several sections share a name, the item refers to the last one in the file (W210 warns about the duplicate). Sections not named in the Form are not played, and strict mode reports them as info I320.
- **Without `Form:`**, the `#` sections play in document order. A `#` heading with an **empty body** whose name matches an earlier section *replays* that section ("Chorus, as above"). The renderer shows it collapsed.
- **`@play Name [xN] [bars=A-B]`** inside a section inserts the named section's or block's bars at that point, optionally repeated or restricted to written bars A to B.

### 6.4 Inheritance (`<`)

`# Verse 2 < Verse 1` makes Verse 2 a copy of Verse 1's **bars**: its chart bars, bar-marked lyric bars, grid and token systems, and its **in-section directives**, which are replayed at the start of the child (§7.2). The child supplies only its own lyric lines and optionally its own directives, which apply after the replayed ones.

- Lyric lines in the child are timed against the inherited bars (§10.5). Chordless lines are timed **line-parallel**: line *i* of the child takes the time span of line *i* of the parent.
- Inheritance chains are allowed (`Verse 6 < Verse 5 < Verse 1`). A cycle is error E132. An unknown parent is error E131.
- A child that also writes its own chart lines or grid systems is warning W213. Its own bars replace the inherited bars.

### 6.5 Repeats inside a section

These tokens appear in **chart lines and chord lanes** only, never in staff lines (§12.3):

| Token | Meaning |
|---|---|
| `\|:` … `:\|` | Repeat; two passes in total. |
| `:\|x3` | End repeat, three passes in total. The `xN` must follow `:\|` directly, with no space. |
| `:\|:` | End one repeat and start another. |
| `[1`, `[2`, `[1,3` | Ending (volta). It is written as the first token of a bar, and the bar belongs to the listed passes. |
| `\|\|`, `\|]` | Double barline and final barline. Visual only. |
| `@repeat N` | Pass count for the next `:\|`, usable for staff-only riffs. |

Repeats do not nest (E130). An end repeat without a start repeats from the start of the section. A repeat may span several chart lines within a section.

### 6.6 Unrolling and addresses

Unrolling is deterministic:

```
order = Form items, or document order with replays
for each item (and each of its xN times):
    occurrence[item.name] += 1
    expand written bars: |: :| passes, [n endings selected by pass, @play inserts
    for each resulting bar:
        emit PerformanceBar {
            index,                                  // absolute, 0-based
            address = "<Name>#<occurrence>:<writtenBar>[.p<pass>]",
            onset, duration, meter, tempo state, chord state, pattern state, sourceSpan }
```

`writtenBar` is the 1-based index of the bar in the section's written bars. Bars inside an inserted `@play` keep the inserted section's own address. So the second time through bar 3 of a chorus is `Chorus#2:3`, and the second pass of a repeated bar 5 is `Verse 1#1:5.p2`. Loops, practice statistics and sync anchors store the address plus the index, which keeps them stable when the file is edited elsewhere.

---

## 7. Directives and the state model

### 7.1 Directive reference

A directive is a body line starting with `@`. State directives take effect **at the next barline** after the point where they appear.

| Directive | Kind | Example | Effect |
|---|---|---|---|
| `@tempo` | state | `@tempo 84`, `@tempo 84->96 4` | Set the tempo, or ramp it over N bars (§16.2). |
| `@time` | state | `@time 6/8` | Change the meter. |
| `@key` | state | `@key Bm` | Change the sounding key, which affects transpose display and Nashville numbers. |
| `@capo` | state | `@capo 4` | Change the capo. |
| `@tuning` | state | `@tuning drop-d` | Change the tuning of the default part. |
| `@feel` | state | `@feel swing` | Change the swing setting. |
| `@grid` | state | `@grid 1/16` | Column timing for ruler-less tab that follows (§12.5). |
| `@ring` | state | `@ring off` | Sustain policy (§12.8). |
| `@part` | state | `@part lead` | Default part for unprefixed staff lines. |
| `@strum` | state | `@strum waltz`, `@strum off` | Apply a pattern to chart, lyric and instrumental bars (§11.4). |
| `@pattern` | definition | `@pattern island = D . D U . U D U`, or `@pattern travis` followed by a system | Define a pattern (§11). |
| `@chord` | definition | `@chord F = xx3211` | Same as the `Chord:` header key. |
| `@drums` | definition | `@drums verse` followed by a drum grid | Define a groove (§11.6). |
| `@groove` | state | `@groove verse`, `@groove halftime`, `@groove off` | Change the drum backing (§11.9). Same values as the `Groove:` header key. |
| `@fill` | next bar or section end | `@fill`, `@fill lift`, `@fill lift end` | Replace the groove for one bar with a fill (§11.10). |
| `@pickup` | next bar | `@pickup 1/4` | The next bar is a partial bar of that length (§16.3). |
| `@hold` | next bar | `@hold 2` | Measured fermata: the next bar is extended by N beats, and its last event is held (§16.4). |
| `@free` | next bar | `@free` | The next bar is unmeasured. Auto-scroll waits for a tap (§16.4). |
| `@mark` | next bar | `@mark "bend lick"` | Named loop point. |
| `@repeat` | next `:\|` | `@repeat 3` | Pass count. |
| `@play` | insert | `@play Riff A x2`, `@play Intro bars=1-3` | Insert bars (§6.3). |

Unknown directives are preserved and draw warning W220. Directives starting with `@x-` are silent (§23).

### 7.2 State is resolved by document position

The play order can differ from the document order because of Form, replays and `@play`. To keep every bar's state computable on its own, which isolated A/B loops need:

1. The **initial state** comes from the header.
2. The **start state of a `#` section** is the state after applying every state directive that appears *before its heading in document order*, skipping named blocks.
3. Within a section, a state directive applies from the next barline onward. It persists forward in document order into later `#` sections.
4. **Named blocks** (`##`) start from their document-position state. Their own directives do not leak out.
5. A **replay**, a Form repeat or an `@play` insert uses the *target section's* own document-position state and in-section directives. After an inserted block, the state returns to what it was at the `@play` line.
6. **Inheritance** replays the parent's in-section directives (recursively, for chains) at the child's start, and then applies the child's own directives.

---

## 8. Chords

### 8.1 Chord symbols

A chord symbol is a root, an optional quality, an optional degree, any number of alterations, an optional parenthesised group, an optional slash bass and an optional voicing selector. The full PEG is in §19.6.

- **Roots:** `A`–`G`, optionally followed by `#`, `b`, `♯` or `♭`.
- **Qualities:** `m`, `min`, `mi`, `-`, `maj`, `ma`, `M`, `Δ`, `dim`, `°`, `aug`, `+`, `ø`.
- **Degrees:** `2 4 5 6 7 9 11 13`, `maj7`/`M7`/`Δ7` and so on, and `6/9` or `69`.
- **Alterations:** `b5 #5 b9 #9 #11 b13`, `add2 add4 add9 add11 add13`, `sus`, `sus2`, `sus4`, `no3`, `alt`.
- **Groups:** `C7(b9,#5)`, `Cm(maj7)`, `C(add9)`.
- **Slash bass:** `D/F#`, `C/G`. Because a degree is tried before a slash, `C6/9` is a six-nine chord, not C over 9.
- **Voicing selector:** `G@2`, `G@rock` picks a defined alternate voicing for display and playback (§8.3).
- **Also accepted:** `N.C.` (no chord) and `%` (repeat the previous bar; chart lines only).
- With `ChordNames: nashville`, the root is a scale degree `1`–`7` with an optional `b` or `#` prefix (`1 4 5m 6m b7 4/1`). Such symbols transpose for free.
- Symbols that do not parse are error E110 in chart lines and chord lanes. In lenient mode they are kept as text with warning W110. A symbol that parses but has no definition and is not in the bundled chord dictionary is info I111, and no diagram is drawn.

Appendix A is the torture list. Every row in it is a conformance case.

### 8.2 Chord definitions

```tabu
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
```

- **Frets** run from low to high, one entry per string of the part. The compact form uses one character per string: `x` for muted, or `0`–`9`. A fret of 10 or more is written in parentheses, `(12)`. The dashed form `x-12-11-12-12-x` is also accepted. **Frets are always absolute**, and like tab frets they are relative to the capo (§5).
- **`fingers=`**: one character per string. `x`, `0` or `-` means no finger, `1`–`4` are fingers and `T` is the thumb.
- **`barre=F`** draws a barre at fret F. **`base=F`** sets the first fret shown in the diagram window. **`name="..."`** sets the display name.
- **`bass=S/A`** names the strings used for the bass `B` and alternate bass `b` in patterns, numbered with 1 as the highest string. The default rule: `B` is the lowest sounding string that plays the chord root, or failing that the lowest sounding string. `b` is the next-lowest sounding string that does not play the root, or failing that the string above `B`.
- **Alternates.** A voicing after `|` on the same line is an alternate, auto-named `@2`, `@3` and so on. A separate line with `NAME@label` adds a named alternate. The voicing defined without `@` is the default. In the example above, `C = 332010 bass=5/6` gives a Travis-style C whose alternate bass is the G on string 6.
- An undefined chord falls back to the bundled chord dictionary (chords-db, MIT). File definitions always win.

### 8.3 Display and transposition

- Diagrams, the voicing picker and playback use the selected voicing: an explicit `@voicing` in the token, otherwise the user's local preference, otherwise the default. **The user's choice is never written back into the file.**
- **Transpose** changes the sounding key and the chord symbols. **Capo shift** changes `Capo` and re-names shapes so the sounding pitch is kept. **Tab frets are never transposed implicitly**; "re-fret" is a separate, explicit editor action.
- **Left-handed mode** is a render option only. It mirrors diagrams and, optionally, the tab display.

---

## 9. Chart lines

A chart line gives bars and chord changes per beat:

```tabu
| G    | G7   | C    | G    |
|: G | Cadd9 | Em7 | Dsus4 D :|
| G . D/F# . | Em7 | Cadd9 | G . (D/F# Em7) . |
| Am7 | Cadd9 | Am7 | ^D |
|  Em7 | Dsus4 | Cadd9 |[1 Cadd9 :|[2 D ||
| Em7 | Dsus4 | [2/4] Cadd9 | D "build" |
```

### 9.1 Slots and the slot rule

The tokens in a bar are **slots** that divide the bar into **N equal parts**:

| Token | Meaning |
|---|---|
| chord symbol | This chord starts at this slot. |
| `^CHORD` | Push: the chord starts one subdivision early (§9.3). |
| `.` | Continue: no change for this slot. A leading `.` continues the previous bar's chord, so `\| . . C . \|` keeps the old chord for beats 1 and 2. |
| `(C D)` | Split one slot evenly between the listed chords. |
| `N.C.` | No chord (silence) from this slot. |
| `%` | As the **only** token in a bar: repeat the previous bar's slots. |
| empty bar `\|   \|` | Continue the previous chord for the whole bar. |
| `"text"` | Positional annotation. It is zero-length and **does not count as a slot**. It attaches to the following slot, or to the end of the bar if it comes last. |
| `[1` | Volta, first token only. Not a slot. |
| `[2/4]` | One-bar meter change, first token (after any volta) only. It applies to this bar only, unlike `@time`. Not a slot. |
| bare `/` | **Not allowed** (E114). In lenient mode it is read as `.` with a warning. This keeps ChordPro grid import exact, because in ChordPro a `/` means "strike again" (§25.1). |

**The slot rule** (normative, shared with patterns in §11.2). Let the meter have B beats per bar and S subdivisions per beat (§16.1). A bar with N slots is valid if:

- N = 1, **or**
- N divides B (equal groups of beats), **or**
- N = B × S × 2^j for some j ≥ 0 (beats, eighths, sixteenths and so on).

Any other N is error E103. Examples:

| Meter | B, S | Valid N | Notes |
|---|---|---|---|
| 4/4 | 4, 2 | 1, 2, 4, 8, 16, 32 | 3, 5 and 6 are errors. Triplet slots in charts need a ruler or a grid system. |
| 3/4 | 3, 2 | 1, 3, 6, 12, 24 | **2 is an error**: "half a 3/4 bar" is ambiguous. |
| 2/4 | 2, 2 | 1, 2, 4, 8, 16 | |
| 6/8 | 2, 3 | 1, 2, 6, 12, 24 | `\| G C \|` is two dotted quarters and is **valid**. |
| 12/8 | 4, 3 | 1, 2, 4, 12, 24 | `\| G C D Em \|` is four dotted quarters and is valid. `\| G C D \|` is an error. |
| 9/8 | 3, 3 | 1, 3, 9, 18 | |
| 7/8 (2+2+3) | 3 groups | 1, 3 (the groups, of unequal length), 7, 14 | Additive meter (§16.1). |

The *beat count* of a chart bar is never guessed. A bar always lasts exactly its meter (or its `[p/q]` meter), unless `@pickup`, `@hold` or `@free` says otherwise.

### 9.2 Repeats, endings and annotations

These follow §6.5. A chart line SHOULD end with a barline; a missing final barline is warning W214, and the bar is still closed at the end of the line.

### 9.3 Push

`^G` in a chart slot, `[^G]` inline in a lyric, or `^G` in a chord line all mean the same thing: **G starts one subdivision before the slot it is written in.** The subdivision is one slot of the active pattern (§11), or one eighth note if no pattern is active (info I331 reports this default). A push may cross a barline backwards, which is the usual case (`| Am7 | ^D |` lands D on the "and" of 4 of the previous bar). A push never moves a bar's start or length. Export to formats that have no push (ChordPro) writes the chord without the `^`.

### 9.4 What a chart bar plays

- **With an active pattern** (`@strum`), the pattern is laid over the bar (§11.4).
- **Without one**, playback strikes one downstroke at each chord onset and at the start of each bar.
- `N.C.` stops all strings.

---

## 10. Lyrics with chords

### 10.1 Two first-class forms

Lyrics and chords can be written in either of two forms, and a section may mix them line by line. `tabu fmt --lyrics=over|inline` converts between them losslessly.

**(a) Chord over lyric.** A chord line directly above a lyric line. This is the canonical display form.

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

- Each chord applies at the **grapheme column where its token starts**. A chord placed past the end of the lyric is held over: it is anchored after the last syllable.
- A chord line followed by a blank line, or by anything other than a lyric line, is an **instrumental line** (§10.7).

**(b) Inline chords.** These are robust under proportional fonts, copy-paste and chat apps.

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

`[X]` places chord X right before the next character. If the bracket content is not a chord symbol, it is error E110 (in lenient mode it is literal text with W110). Use `\[` for a literal bracket.

### 10.2 Bar marks

A `|` inside a lyric line, or inside a chord line that does not start with a barline, is a **bar mark**: a new bar starts at that position.

```tabu
[Am]"O, where are you | going?" "To | [G]Scarborough | [Am]fair,"
[C]Savoury sage, | rose|[G]mary, and | [Am]thyme;
```

- The mark itself is not displayed. Whitespace around it is kept as written, so `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. An empty segment between two marks (`fair, | |`) is a bar with no words, in which the chord continues.

### 10.3 Pickups

**Text before a line's first chord or first bar mark is a pickup**, sung at the end of the bar *before* the line starts. That is the previous line's last bar, or the last bar of the previous section. In `"Re[C]member me | …` the syllable `"Re` is a pickup. Display hangs pickups to the left of the line start. Their exact syllable timing is approximate and is placed in the last beat before the line start. This rule removes the cross-line pickup problem found in all three proposals.

### 10.4 Chart over lyric (optional precise layout)

A **chart line** directly above one or more lyric lines also times them. The column of each barline marks where that bar's words begin, so every lyric fragment belongs to exactly one bar. Text left of the first barline column is a pickup (§10.3). Several stacked lyric lines under one chart line are the **successive passes** of a repeat (the hymnal layout). This form is never required; it is useful for hymnals and printouts.

### 10.5 The lyric timing chain

Each lyric line is timed by the **first rule that applies**:

| Rule | Applies when | Result |
|---|---|---|
| **T1 Lyric bars** | The section has **no chart lines and does not inherit** (`<`), and the line has bar marks (in itself or in its chord line). | The line *is* the chart. Its bars join the section's grid and token bars in document order. The line's first bar starts at its first chord or first mark, whichever comes first, and each mark starts a new bar. A segment's slots are its chords; when the segment has words before its first chord, or has no chord at all, the chord carried from before counts as the first slot. Slots split the bar by the slot rule (§9.1). A count the rule forbids is E103 ("use a chart line for this bar"). |
| **T2 Chart over lyric** | The line is directly under a chart line. | §10.4. |
| **T3 Chord binding** | The line has chords, and the section has chart-line bars of its own or inherits bars from a parent. | Bind the line to those bars, per line (algorithm below). |
| **T4 Line-parallel** | The section inherits (`<`) and the line has no chords. | Line *i* takes the time span of the parent's line *i*. Bar marks, if present, pin syllables to the bars of that span; a mark count different from the span's bar count is W303. A line count different from the parent's is W304, and the extra lines become estimated. |
| **T5 Estimated** | The section has `{bars=N}`; or it has no chart and the line has chords but no marks. | With `{bars=N}`: the N bars are spread across the lines in proportion to syllables. Without it: **one bar per chord**, the common chord-sheet convention. Either way it is reported as estimated (I300). |
| **T6 Untimed** | None of the above (a chordless, unmarked line in a section that neither inherits nor has a chart). | The line counts as **2 estimated bars** that hold the current chord (or no chord), so the timeline, auto-scroll and loops stay defined. Reported as untimed (I300). |

**T3 binding algorithm** (normative):

1. Build the section's **chart event list**: for every unrolled bar, one event at the bar start (carrying the chord sounding at that moment) and one event at every mid-bar chord change. Repeated chords are **not** collapsed.
2. Keep a cursor at the last bound event, starting before the first event.
3. For each lyric line, and for each chord *c* in it in order: bind *c* to the **first event after the cursor** whose chord equals *c* (comparing names without `^` and without `@voicing`), then move the cursor there. Skipping events whose chord equals the currently sounding chord is silent. Skipping an event that is a real chord change is W302 ("line skips the chart change to D at bar 7").
4. If no event matches, report W301. That line and every later line in the section fall back to T5.
5. A line's start time is the time of its first chord's event. Its end is the next line's start, or the end of the section. Syllables inside the line are interpolated between bound chords, for display only.

Binding is per line and never collapses across line boundaries. So a line that starts with the same chord the previous line ended on still binds to a *new* event, and every line keeps its anchor. That anchor is what auto-scroll needs.

When chords appear in both a chart and the lyrics, the lyric chords are *binding keys* and display. They are not a second source of timing. For a single source of truth, use T1 (the lyrics are the chart) or a chart plus chordless lyric lines (T4 for inheriting sections, or T3 with chords only where they help).

### 10.6 Estimated timing is not an error

T5 and T6 timing produces info diagnostics only. A bare Ultimate-Guitar-style chord sheet is a valid file at every validation level, including `library`. Its timing level is L0 (§20.2).

### 10.7 Instrumental chord lines

A chord line with no lyric line below it contributes bars:

- If it contains bar marks, the segments between the marks are bars, as in T1.
- Otherwise there is one bar per chord, reported as estimated (I300).

In a section without chart lines, T1, T5 and T6 lyric bars, instrumental chord-line bars, and grid and token bars all join the section's written bars in document order.

A line that starts with a barline is a chart line, not an instrumental chord line.

---

## 11. Strum patterns, picking patterns and grooves

### 11.1 One-line patterns

These are defined with the header key `Pattern:` or the directive `@pattern NAME = …`:

```tabu
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
Pattern: shuffle = D . U D . U D . U D . U grid=1/8t
```

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

- **Compact form:** a pattern bar with no spaces is read one character per token. It cannot contain `+` or `>`.
- `|` separates the bars of a multi-bar pattern. Pattern bars cycle, and the cycle restarts at each section start.

### 11.2 Pattern grids

The slot count of each pattern bar MUST satisfy the slot rule (§9.1) for the meter at the definition's document position. Otherwise it is error E104. Triplet grids are never inferred; they need `grid=1/8t` (or `1/4t`, `1/16t`), and then the slot count MUST equal the bar length divided by that value.

### 11.3 Pattern blocks and pattern tabs

`@pattern NAME`, with no `=`, defines the pattern from the **system that follows it**. That system is a definition, not bars. It contains a `T|` ruler (§12.4) and either an `S|` strum lane or staff lines made of **pattern cells**:

```tabu
@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 |
```

| Cell | Meaning in a pattern block |
|---|---|
| `o` | Play this string as fretted in the current chord voicing. A muted string in the voicing makes the cell silent. |
| `B` / `b` | The chord's bass / alternate bass (§8.2), whatever string that is. The row a `B` sits on is ignored for pitch; by convention it is written on the lowest row. |
| `0`–`24` | A literal fret on this string. A file using these cannot carry the optional `skeleton` label (§22). |
| `x` | Dead note on this string. |
| `-` | Nothing. |
| `!` | Stop this string. |

The ruler supplies the timing. Cells MUST start under ruler tokens. Pattern blocks with `o` and `B`/`b` encode **how to play, not a melody**. That keeps them compatible with the optional `skeleton` label (§22), and it lets one Travis pattern serve any progression.

### 11.4 Applying patterns

`@strum NAME` applies a pattern to every bar that comes from a **chart line, a T1 lyric line or an instrumental chord line**, until `@strum off` or another `@strum`. It is state, resolved by document position (§7.2).

- Chords come from the chart. A chord change replaces the voicing at its exact slot. A push (§9.3) moves the change one pattern slot earlier.
- The pattern is laid out from each bar's start. A bar shorter than the pattern bar (for example a `[2/4]` bar) uses the start of the pattern. A longer bar continues into the next pattern bar.
- **Grid and token systems are always played exactly as written.** Patterns never apply to them, and chord lanes inside them are labels for display and the harmony track.

### 11.5 Grooves (optional drum backing)

A **groove** is an optional drum backing: a small step grid with one lane per drum voice, timed by the same `T|` ruler as pattern blocks. It gives playback, practice and MIDI export a drummer. **It is not drum notation.** There are no rolls, stickings, drum durations or per-bar drum parts. A full drum score belongs in MusicXML or Guitar Pro export (§25.4), not in this format (§0).

Grooves are entirely optional. A file without them is complete. **Groove constructs never create, remove or change bars** (§11.12).

| Piece | Syntax | Kind | Works like |
|---|---|---|---|
| Drum grid | `@drums NAME`, followed by a drum grid system | definition, file-wide | `@pattern NAME` followed by a pattern block (§11.3) |
| Song default | `Groove: NAME` | header: initial state | `Tempo:`, `Feel:` |
| Change | `@groove NAME`, `@groove off` | state, resolved by document position | `@strum` (§11.4) |
| Fill | `@fill`, `@fill NAME`, `@fill [NAME] end` | bar mark | `@hold` (§16.4) |

`NAME` is a drum grid defined in the file or a built-in style (§11.11). A file definition wins over a built-in style with the same name, just as file chord definitions win over the chord dictionary (§8.2). `Groove:` and `@groove` take the same values, as `Tempo:` and `@tempo` do.

### 11.6 Drum grids (`@drums`)

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

- **Definition.** `@drums NAME` defines a groove from the system that directly follows it, with no blank line in between. That system is a definition, not bars. It may appear in the preamble, in a section or in a named block. Wherever it appears, the name is file-wide (§6.1), and a second definition with the same name replaces the first (W216).
- **Content.** A drum grid has exactly one `T|` ruler and one or more drum lanes. Comment lines are allowed. A grid with no ruler, or with any other lane (staff, `S|`, `L|`, `N|`, chord or effect lane), is E161.
- **Drum lanes.** A drum lane is `VOICE|` followed by steps, where `VOICE` is a label from §11.7. Labels are case-insensitive and take no part prefix. Write them right-aligned with leading spaces; `tabu fmt` does this. The `|` after each label is the opening barline: it MUST be in the same column as the ruler's `|`, and so MUST every later barline (E101). Drum grids use the plain `|` barline only. Repeat signs and voltas in a grid are E161.
- **Timing comes from the ruler** (§12.4), and every ruler rule applies: positional token names, E105, E107 and W204. **Each step glyph (§11.8) MUST sit directly under a ruler token** (E106; lenient mode snaps it to the nearest token with a warning). The columns between tokens hold spaces, `-` or `.`.
- **Bars and cycles.** Every bar of a grid MUST be a full bar of the grid's meter (E108). There are no pickup bars in a grid. The grid's meter is the meter in force at the `@drums` line's document position, unless the grid bar starts with a `[p/q]` ruler token. A grid with several bars is a **cycle**: bar 1, bar 2, and so on, then bar 1 again.
- **One lane per voice.** A second lane for the same voice, including through an alias, is merged into the first with W231. Inside a drum grid, any line shaped `word|` (a letter, then letters or digits) is a drum lane, so a misspelt voice is not mistaken for an effect lane: a label not in §11.7 is W230, and the lane is kept and displayed, but it is silent.
- **Misplaced lanes.** A drum lane in any system that does not directly follow `@drums` is E160. In lenient mode that system is kept as a display-only grid. `@drums NAME` with no drum grid directly after it is E163. In lenient mode it is read as `@groove NAME`, because writing `@drums` for `@groove` is the likely slip, and the autofix rewrites it.
- **Names** match `GrooveName` (§19.10). `off`, `none` and `end` are reserved and cannot be defined (E164).

### 11.7 Drum voices

The voice set is small and fixed. Each voice maps to a General MIDI percussion key (channel 10), which is what playback and MIDI export use (§25.5).

| Voice | Aliases | GM key | GM sound |
|---|---|---|---|
| `kick` | `bd`, `kik` | 36 | Bass Drum 1 |
| `snare` | `sd`, `sn` | 38 | Acoustic Snare |
| `rim` | `ss`, `stick`, `xstick` | 37 | Side Stick (cross-stick) |
| `clap` | `cp`, `hc` | 39 | Hand Clap |
| `hat` | `hh`, `chh` | 42 | Closed Hi-Hat; with `o` or `O`, 46 Open Hi-Hat (§11.8) |
| `ohat` | `oh`, `ohh` | 46 | Open Hi-Hat |
| `pedal` | `phh` | 44 | Pedal Hi-Hat |
| `ride` | `rd` | 51 | Ride Cymbal 1 |
| `bell` | `rb` | 53 | Ride Bell |
| `crash` | `cr`, `cy` | 49 | Crash Cymbal 1 |
| `tom1` | `ht` | 50 | High Tom |
| `tom2` | `mt`, `tom`, `tm` | 47 | Low-Mid Tom |
| `tom3` | `lt` | 45 | Low Tom |
| `floor` | `ft` | 43 | High Floor Tom |
| `tamb` | `tb` | 54 | Tambourine |
| `cowbell` | `cow` | 56 | Cowbell |
| `shaker` | `sh`, `shk` | 82 | Shaker (GM2 and GS). For a GM Level 1 target, export substitutes 70, Maracas. |
| `gmNN` | | NN, 27–87 | Any other GM or GM2 percussion key, for example `gm57` for Crash Cymbal 2. |

- `hat`, `ohat` and `pedal` form the **hi-hat choke group**: any hit in the group, or `!` on any of its lanes, stops a ringing open hat.
- **No voice name or alias has the shape of a string label** (`[A-Ga-g][#b]?` or a digit), so line classification stays unambiguous. That is why cowbell is not `cb`: `cb` is the label of a C♭ string.
- New voices may be added in minor versions (§23). Existing mappings never change.

### 11.8 Step glyphs

| Glyph | Meaning | Timeline `dyn` |
|---|---|---|
| `x` | Hit. | `normal` |
| `o` | Hit, as drum tab writes it on drums. **On a `hat` lane, `o` is an open hi-hat** (key 46), as in drum tab. | `normal` |
| `X`, `O` | Accented hit. `O` on a `hat` lane is an accented open hi-hat. | `accent` |
| `g` | Ghost note: a soft hit. | `ghost` |
| `f`, `F` | Flam: a grace stroke just before the hit; `F` is accented. Optional to render: a reader MAY play a flam as a plain hit. | `normal` or `accent`, with `flam` |
| `!` | Choke: stop this voice ringing (an open hat, a cymbal). `!` on a hi-hat lane chokes the whole group. | `choke` |
| `-`, `.`, space | No hit. Anything already ringing keeps ringing. | |

Any other character in a drum lane is E162. In lenient mode it is read as no hit, with the warning. The glyphs keep the rule of §12.9: `.` never stops sound, and `!` always does.

A two-bar groove with a crash, accents, ghosts and a flam:

```tabu
@drums chorus
    T| 1 e + a 2 e + a 3 e + a 4 e + a | 1 e + a 2 e + a 3 e + a 4 e + a |
crash| X - - - - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |
 ride| - - x - x - x - x - x - x - x - | x - x - x - x - x - x - x - x - |
snare| - - - - X - - g - - - - X - - - | - - - - X - - g - - g - F - - - |
 kick| x - - - - - x - x - x - - - - - | x - - - - - x - x - x - - - - x |
```

### 11.9 Applying grooves (`Groove:`, `@groove`)

- **State.** `Groove: NAME` sets the drum backing at the start of the song. `@groove NAME` changes it from the next barline, and `@groove off` stops it. `Groove: off` and `Groove: none` say "no drums" explicitly; with no `Groove:` there are none. Both forms are state resolved by document position (§7.2). The groove persists forward into later `#` sections; a named block's `@groove` does not leak out; a replay, a Form repeat or an `@play` insert uses the target's own state; and an inheriting section replays its parent's `@groove` (§6.4). An unknown name is E131, and the bars it would cover have no drums.
- **It applies to every performance bar, whatever produced the bar:** chart lines, lyric bars (T1 to T6), instrumental chord lines, grid systems and token systems. This differs from `@strum` on purpose, because the drummer keeps playing under the tab solo. Over estimated or untimed bars the drums follow guessed bar lengths, which is info I340.
- **Cycle position.** Bar *k* of a multi-bar groove plays on the *k*-th performance bar (modulo the cycle length), counted from where the groove took effect in the current section occurrence. The count **restarts** at every section occurrence (each Form item, each `xN` time, each replay) and at every `@groove`. It **continues** through repeat passes and endings, and through fill bars. Bars inserted by `@play` run on the inserted block's own state and do not advance the outer count.
- **Bars of other lengths.** A bar shorter than the groove bar (a `[2/4]` bar, or a last bar that ends early) plays the start of the groove bar, as patterns do (§11.4). A **pickup bar** (a section's first bar that starts late, by ruler or `@pickup`) plays the *end* of the groove bar, aligned to its last beat. A longer bar continues into the next bar of the cycle. An `@hold N` bar plays its nominal length and the held beats are silent. An `@free` bar has no drums.
- **Meter changes.** When the running meter (`Time`, `@time`) differs from a grid's meter, the same truncate-or-continue rule applies, and W232 reports it once per run of bars. One-bar `[p/q]` meters, pickups and holds never warn. A built-in style picks its variant for the meter (§11.11); if it has none, those bars have no drums (W233).
- **Swing.** `Feel` and `@feel` remap drum onsets exactly as they remap strums and notes (§16.5).
- **Chords do not matter.** A groove does not read the chord chart, and `N.C.` does not silence the drums. To stop the drums, use `@groove off`, or a fill that chokes (§11.10).
- **Viewer choices stay out of the file.** Muting the drums, picking a kit, or the app's "auto drums" for a file with no groove are local settings. They are never written into the file (compare §8.3).

### 11.10 Fills (`@fill`)

`@fill [NAME] [end]` replaces the groove for one bar with the **first bar** of drum grid `NAME`. With no name it uses the built-in `fill` for that bar's meter (Appendix C).

- **Which bar.** Without `end`, the fill applies to the next written bar, as `@hold` does. To fill one bar inside a chart line, put that bar on its own line, or use `end`. With `end`, it applies to the **last performance bar of every occurrence** of the section or block it is written in, including a bar inserted by `@play` at the very end.
- **A fill is a bar mark, not state.** It attaches to its written bar (or, with `end`, to the section's last bar) and travels with it through repeat passes, replays, `@play` and inheritance. In a repeat, the marked bar is filled on every pass. To fill only the last pass, mark a bar inside a `[2` ending.
- A fill plays even when no groove is active, so a song can start with a drum lead-in. The groove's cycle keeps counting under the fill bar. The length rules of §11.9 apply to the fill bar too.
- Two fills on one bar: the later one in document order wins (W234).
- A fill that stops the band, using the choke glyph:

```tabu
@drums stop
    T| 1 + 2 + 3 + 4 + |
crash| X - ! - - - - - |
 kick| X - - - - - - - |
```

### 11.11 Built-in styles

A file can name a style instead of defining a grid. The styles are a small, fixed set. **Their grids are normative and listed in Appendix C**, so two conforming implementations produce identical drum events. A minor version may add styles, but it never changes an existing one, since that would change timelines.

| Style | Meters | Character |
|---|---|---|
| `rock` | 4/4, 12/8 | Eighth hats, kick on 1 and 3 (and on the "and" of 3 in 4/4), snare on 2 and 4. |
| `halftime` | 4/4 | Eighth hats, kick on 1 and the "and" of 4, snare on 3. |
| `disco` | 4/4 | Kick on every beat, open hat on the off-beats, snare on 2 and 4. |
| `shuffle` | 4/4 (triplet ruler), 12/8 | Shuffled hats, kick on 1 and 3, snare on 2 and 4. |
| `train` | 4/4 | Country train beat: sixteenth snare ghosts with accents on 2 and 4, kick on 1 and 3. |
| `waltz` | 3/4 | Kick on 1, cross-stick on 2 and 3. |
| `ballad` | 4/4, 6/8, 12/8 | Sparse: ghosted hats, kick on 1 (on 1 and 3 in 12/8), cross-stick on the backbeat. |
| `bossa` | 4/4 | Two-bar cycle: cross-stick bossa clave over a steady kick. |
| `onedrop` | 4/4 | Reggae one-drop: eighth hats, kick and cross-stick together on 3. |
| `shaker` | 4/4, 3/4, 6/8 | Shaker eighths with a soft kick on 1. Suits acoustic songs. |
| `fill` | 4/4, 3/4, 6/8, 12/8 | The default one-bar fill, used by `@fill` with no name. |

- **Variant lookup** is by the bar's meter. `2/2` uses the `4/4` variant (the bar length is the same). `2/4` uses the first half of the `4/4` variant, without a warning. Any other meter with no variant has no drums (W233).
- An unknown style name is E131.

### 11.12 Grooves in the timeline, and degradation

- **Drum events.** The timeline (§17.3) carries one event per drum step, on its own drum track, after the cycle, fill and length rules have been applied. This one is the accented snare on beat 2 of the first Chorus bar (`Chorus#1:1`, performance bar 28) in `examples/harbor-lights-skeleton.tabu`:

```json
{ "kind": "drum", "voice": "snare", "key": 38, "dyn": "accent", "flam": false,
  "onset": "113/4", "bar": 28, "groove": "chorus", "span": [48, 16, 48, 17] }
```

  `groove` names the grid: the file's grid name (`chorus`), `builtin:NAME` for a built-in style (`builtin:rock`, `builtin:fill`), or `fill:NAME` for a file grid played through `@fill` (`fill:lift`). `span` points at the step glyph in the grid, or is `null` for a built-in style. A choke has `"dyn": "choke"`. Drum events have no duration: they are one-shot hits, and an open hat rings until the next hit in its choke group, a choke, or its sample's natural decay.
- **Invariance (normative).** Deleting every groove construct from a file (the `Groove:` header, `@drums` and its grid, `@groove`, `@fill`) leaves the bars, the addresses, every non-drum event and the timing level unchanged. Grooves never raise or lower the timing level (§20.2).
- **Readers that do not play drums** are still conforming if they recognise drum lanes (§4.4, rule 8) so that a grid is never read as lyrics, skip each `@drums` grid as a definition, and accept `Groove:`, `@groove`, `@drums` and `@fill` without W201 or W220. They produce no drum events, and they MAY show the grid as monospace text.
- **Plain text readers** see a drum-machine step chart that any drummer can read.
- **Rights.** A groove describes generic accompaniment, like a pattern block. Grooves are allowed under every `Rights` value (§22).

---

## 12. Grid systems: tablature and lanes

### 12.1 Anatomy

```tabu
   C                  G                  G
                               >
T| 1  +  2  +  3  + | 1  +  2  +  3  + | 1  +  2  +  3  + |
e|------------------|------------------|-------------7----|
B|-8----------p5----|------------------|-8--------------8-|
G|------------------|-7~~~~~---x--7----|------------------|
D|------------------|------------------|------------------|
A|-3----------------|------------------|------------------|
E|------------------|-3----------------|-3----------------|
```

From top to bottom, this system has a chord lane, an effect lane, the ruler, and six staff lines.

### 12.2 Lanes in a grid system

| Lane | How it is recognised | Purpose |
|---|---|---|
| **Staff line** | `[part:]LABEL\|` with a string label | One string. |
| **Ruler** `T\|` | label `T` | Timing (§12.4). At most one per system. |
| **Strum lane** `S\|` | label `S` | Strokes placed under ruler tokens, using pattern tokens (§11.1). |
| **Lyric lane** `L\|` | label `L` | Syllables placed under ruler tokens, giving exact syllable timing. A trailing `-` joins a syllable to the next (`A- ma- zing`). |
| **Chord lane** | unlabeled, and every token is a chord symbol, `N.C.`, `\|`, a volta `[n` or `xN` | Chords positioned by column. They MUST start under ruler tokens when a ruler is present. Barlines in this lane are optional, but MUST align with the staff barlines if present. |
| **Effect lane** | **any other unlabeled line** | Techniques that span columns (§14). |
| **Drum lane** | a drum voice label (§11.7) | One drum voice. Allowed only in a drum grid after `@drums` (§11.6); anywhere else it is E160. |

Classification is forward-compatible:

- An unlabeled line in a grid system is **never** a lyric line or an even-split chart line. A barred chord line above a staff is always a chord lane.
- A token the effect vocabulary does not know is warning W206 and is shown as text. It never re-classifies the line.
- Lyrics inside a grid system need `L|`.
- An unlabeled line made only of ruler tokens (markdown-native style ` | 1 + 2 + |`) is accepted as a ruler in lenient mode with warning W215, and `tabu fmt` adds `T|`.

### 12.3 Staff lines and barlines

- **Strings are matched by order, not by label.** The top staff line is the highest-pitched string of the part's tuning. Labels are checked against the tuning by pitch class (W203 on a mismatch) but never used to identify a string. That handles the two E strings in standard tuning and the three D strings in DADGAD.
- A system's staff group MUST have exactly as many lines as the part has strings (E120).
- **Barlines in staves** are `|`, `||`, `|:`, `:|`, `:|:` and `|]`. They MUST start at the same column in every staff line, the ruler and any `S|`/`L|` lanes of the system (E101). Barlines take up no time.
- **Not allowed in staves:** repeat counts (`:|x3`, where the `x3` would read as a dead note and fret 3) and voltas (`|1.`, where the `1` would read as fret 1). Both are E125. Use the chord lane (`x3`, `[1`), `@repeat N`, or trailing text after the final barline separated by whitespace (`|  x3`).

### 12.4 The ruler (`T|`): the primary timing mechanism

The ruler is a count line, the kind teachers already write over a riff. **A note starts at the ruler token directly above its onset column** (§12.6). Spacing is free: use two columns per slot for single-digit frets and three when two-digit frets or `10b12` appear. Only the token *positions* matter, and technique letters and extra fret digits sit in the gaps without taking up time.

**Ruler tokens:**

| Token | Simple meters (the beat is undotted) | Compound meters counted in dotted beats |
|---|---|---|
| `1`, `2`, … | beat number | beat number (dotted quarter in 6/8) |
| `e` | ¼ of the beat (2nd sixteenth) | not allowed (use `.`) |
| `+` or `&` | ½ of the beat | ⅓ of the beat (2nd eighth) |
| `a` | ¾ of the beat (4th sixteenth) | ⅔ of the beat (3rd eighth) |
| `trip`, `let` | ⅓ and ⅔ of the beat (triplets) | not allowed |
| `la`, `li` | not allowed | ⅓ and ⅔ of the beat |
| `.` | placeholder (see below) | placeholder |
| `[p/q]` | first token only: one-bar meter change | same |

**Positions.** Named tokens are **positional by name**: `1   a` means the 4th sixteenth of beat 1, with no need to write the placeholders in between. When a beat contains `.` placeholders, the beat's *n* tokens (the number included) divide it into *n* equal positions. Every named token in that beat MUST sit at its named position (E107: "`a` is the 3rd of 4 tokens; it should be the 4th"). In a dots-only beat, 3 or 6 tokens in a simple meter infer triplets, which is warning W204 ("write `1 trip let` to confirm").

**Compound meters** may count either way, decided per bar: in dotted beats (`1 + a 2 + a`, or `1 la li 2 la li`, with numbers up to p/3) or in eighths (`1 2 3 4 5 6`, with numbers up to p). Inside an eighth-counted bar, sub-tokens use the simple column of the table. If a pickup bar is ambiguous, it takes the counting mode of the next full bar in the same ruler.

**Bar checks.**

- Beat numbers MUST be consecutive, and the first token of each bar MUST be a beat number (after an optional `[p/q]`). Otherwise E105.
- A bar MUST end on the meter's last beat (E108), with two exceptions: the **first bar of a section** may start late, which makes it a pickup of exactly the remaining beats (`| 3 + |` in 3/4 is a one-beat pickup), and the **last bar of the song** may end early.
- Short bars are measured. The metronome plays exactly their beats.

### 12.5 Without a ruler

- **No ruler, no grid (the default): untimed tab.** Each bar lasts its meter. Inside a bar, the distinct onset columns are spaced evenly in column order. The renderer labels the system "untimed" (I300). This is where pasted ASCII tab lands, and the editor's **"make timed"** action proposes a ruler from the column statistics.
- **Column mode** (`Grid: 1/16` or `@grid 1/16`): every character column inside a bar is one slot of that length. The bar width MUST equal the bar length divided by the slot (E102). Technique characters take up slots in this mode.
- **`Grid: auto`**: the width is inferred per bar, and the slot MUST be a power of two (`1/4` to `1/64`). An inferred triplet slot is W204, and a width different from the previous bar in the same system is W205. **A dropped dash can therefore never silently become a triplet.**
- A ruler always wins over `Grid` for its own system (I-level note).

### 12.6 Onset rule

**One rule for every note form: a note's onset column is the column of the first character of its core.** The core is:

- the first fret digit, for `7`, `12`, `5<17>` and `10pb12`
- `x`, for a dead note
- the opening bracket, for `(5)` and `<12>`

Prefixes (`/`, `\` and the connector letters) are not part of the core. In `/10` and `t12` the onset is the `1`, and the slide or tap motion happens before it.

- **Ruler mode:** every onset and every legato target (§12.7) MUST start exactly under a ruler token (E106). In lenient mode it snaps to the nearest token with a warning.
- **Column mode:** the onset column is the slot.

### 12.7 Arrival rule (techniques that connect notes)

**The column of a target fret's first digit is when the target is reached.**

- **Legato targets** (`h`, `p`, `/`, `\`, `s`, `t`) are rhythmic notes. They start a new note on the same string without a pick attack, except `s` (shift slide) and `t` (tap), which are attacked. In ruler mode they MUST sit under a ruler token.
- **Pitch targets** (`b`, `r`) are points on the pitch curve of the same note. In ruler mode a target under a token is reached at that token. A target between tokens is reached at the time **linearly interpolated between the surrounding ruler token columns**, which is still an exact rational. In column mode the target's column is its slot.
- Bend and release motion is linear in semitones from the previous event on that string to the arrival, after which the pitch holds. Renderers may draw an eased curve.
- **Pre-bend** `7pb9`: the note is picked already bent, at the onset column. There is no arrival.

**Connector linking.** A connector links the nearest note core on its left and on its right *within the same bar* on the same string, skipping fill (`-`) and vibrato (`~`). A stop (`!`) breaks the link.

- No note on the left makes it an *entry*: `/7` and `\7` slide in from below or above, `h7` is a hammer-on from nowhere, and `t12` is a tapped onset. `p`, `s` and `r` with no note on the left are E122/E124.
- A `/` or `\` with no fret after it is a *slide-out*: `7\-`, `7/|`.
- To link across a barline, put the connector directly before the barline and start the next bar with the target: `7-/|9--`.

### 12.8 Durations

- **Notated duration** (rhythm display) runs from an onset to the next onset on any string of the same part, or to the end of the bar.
- **Sounding duration** with `Ring: on` (the default, chosen for acoustic playing): a note sounds until the next onset on the same string (an arrival continues the note), a `!` on that string, a dead note on that string, or the end of the performance. Synth decay takes care of realism.
- **Sounding duration** with `Ring: off`: notes sound for their notated duration, except inside an `LR` span, where the `Ring: on` rule applies.
- **Palm mute** (`PM`) shortens notes to the larger of a sixteenth and 40% of the notated duration, with a damped timbre.
- **Strummed chords** (patterns, `S|`) sound until the next stroke, a chord change, or `!`.
- `_` in a staff is a **tie mark** for notation only. It marks a notated continuation of the sounding note on that string at this position (for example across a barline) and does not attack.

### 12.9 One glyph table for every lane

| Glyph | Staff | Pattern / `S\|` | Chart | Ruler | Drum lane (§11.8) |
|---|---|---|---|---|---|
| `-` | fill: nothing new, keeps ringing | no stroke (alias of `.`) | not used | not used | no hit, keeps ringing |
| `.` | **not used** (lenient: fill, W207) | no stroke, keeps ringing | continue chord | placeholder position | no hit, keeps ringing |
| `!` | stop this string | rest: stop all strings | not used | not used | choke this voice |
| `x` | dead note | muted strum | not used | not used | hit |
| `_` | tie mark | not used | not used | not used | not used (E162) |

No glyph means "keep ringing" in one lane and "stop" in another.

---

## 13. Technique reference

| Technique | Write | Onset or arrival | Notes |
|---|---|---|---|
| Fretted note | `0`–`24` | onset at the first digit | Adjacent digits always form one fret, at most two digits (E121). Two notes in adjacent slots need a separator: `1-2`. |
| Dead note | `x` | onset | |
| Ghost note | `(5)` | onset at `(` | |
| Natural harmonic | `<12>` | onset at `<` | |
| Artificial harmonic | `5<17>` | onset at `5` | Fretted at 5, touched at 17. |
| Pinch / tapped harmonic | effect lane `PH` / `TH` | | The fretted note is written normally. |
| Hammer-on | `5h7` | 7 is a legato target | `h7` with nothing on its left is a hammer-on from nowhere. |
| Pull-off | `7p5` | 5 is a legato target | |
| Legato slide | `5/7`, `7\5` | target not picked | |
| Shift slide | `5s7` | target picked | |
| Slide in | `/7`, `\7` | onset at the `7` | The motion happens before the onset. |
| Slide out | `7\-`, `7/-` | | At the end of the note. |
| Bend | `7b9`, `7b(1/2)`, `7b(full)`, `7b(1.5)`, `7b(2)`, `7b(1/4)` | pitch target | A fret target names the pitch reached. An amount in parentheses is in tones. |
| Bend and release | `7b9~~~r7` | release is a pitch target | Vibrato may sit between. |
| Pre-bend | `7pb9` | onset sounds at 9's pitch | `pb` is read before `p`. |
| Pre-bend and release | `8pb10--r8` | | |
| Vibrato | `7~~~` | | Over the columns covered. Wide vibrato: effect lane `WV`. |
| Tapping | `t12`, `5h8t12p5` | tap is an attacked target | |
| Trill | `5tr7` | | Alternates for the note's duration at the finest ruler subdivision in the bar, or a sixteenth by default. |
| Palm mute | effect lane `PM----` | span | |
| Let ring | effect lane `LR----` or `let ring----` | span | Matters with `Ring: off`. |
| Accent / staccato | effect lane `>` / `'` | column | |
| Rake / arpeggiated chord | effect lane `rake`, `arp`, `arp^`, `arpv` | column | |
| Tremolo picking | effect lane `TP----` | span | Sixteenths by default. |
| Pick direction | effect lane `v` (down), `^` (up) | column | |
| Picking-hand fingers | effect lane `p i m a` | column | Classical fingering letters. |
| Stop | `!` | | |
| Tie mark | `_` | | Notation only. |

---

## 14. Effect lanes

- **Tokens:** `PM`, `LR`, `let ring`, `PH`, `TH`, `AH`, `NH`, `TP`, `WV`, `vib`, `tr`, `rake`, `arp`, `arp^`, `arpv`, `>`, `'`, `v`, `^`, `p`, `i`, `m`, `a`, `fermata`, and `"quoted text"`.
- **Extent:** a token followed by dashes (`PM-----`) spans from its first column to the last dash. A token with no dashes applies to the onsets in its first column. An effect applies to every note of the system's part whose onset falls in its extent. Spans may cross barlines.
- `fermata` is display only. A measured hold is `@hold` (§16.4), and the linter suggests it.
- An effect lane may sit above or below the staff group, and a system may have several.
- Unknown tokens are W206 and are displayed as text. They never cause a fallback to lyrics.

---

## 15. Parts and instruments

```tabu
Part: rhythm "Acoustic (rhythm)" tuning=standard capo=2 sound=steel
Part: lead   "Acoustic (lead)"   tuning=standard capo=0 sound=steel
Part: bass   "Bass"              tuning=E1 A1 D2 G2 sound=bass
```

- With no `Part:`, there is one implicit part `gtr` built from `Tuning` and `Capo`. Otherwise the first declared part is the default.
- In a grid system, prefix staff lines with the part id (`lead:e|`) to stack several parts. Their barlines MUST align.
- `@part` sets the default part for unprefixed staff lines. Patterns and chart playback drive the default part.
- An unscoped `Chord:` definition applies to the default part and to every part with the same string count. A part-scoped definition (`Chord: uke:C = 0003`) applies only to that part. Each part falls back to the chord dictionary for its own instrument.
- Playback gives each part **one MIDI channel per string**, so a bend or vibrato affects only its own string.
- **Drums are not a part.** A groove has no tuning, capo or strings, takes no part prefix, and plays on the General MIDI percussion channel (§11.7, §25.5).

---

## 16. Tempo, meter, pickups, holds, free time, swing

### 16.1 Meters and the beat

| Meter class | Test | Beats B | Beat length | Subdivisions S |
|---|---|---|---|---|
| Simple | otherwise | p | 1/q | 2 |
| Compound | p is a multiple of 3, p ≥ 6, q ≥ 8 | p/3 | 3/q (dotted) | 3 |
| Additive | `p/q (g1+g2+…)` | number of groups | gi/q per group (unequal) | gi per group |

The **beat** is used consistently for `Tempo`, chart slots, patterns, rulers and the metronome. A bare `Tempo: 60` in 6/8 is 60 dotted quarters per minute. Additive meters accent each group's first eighth, and a bare tempo counts eighths.

### 16.2 Tempo changes

- `@tempo N` sets the tempo from the next barline.
- `@tempo A->B N` is a **stepwise ramp**: over the next N bars, each beat k of K total beats has tempo A + (B − A)·k/K. Tempo is constant within each beat, which keeps seconds rational. This replaces "rit." as a timing instruction.

### 16.3 Pickups

- A ruler's first bar in a section can describe its own pickup (`| 3 + |`, §12.4).
- `@pickup D` makes the next written bar a partial bar of length D (for example `1/4`). The slot rule applies to that bar's own length.
- Lyric pickups need no bar at all (§10.3).
- A pickup bar in the middle of the song is an honest short bar in the timeline: the metronome plays its beats.

### 16.4 Holds and free time

- `@hold N`: the next written bar is extended by N beats, and its last event is held. The fermata is therefore measured: the metronome, auto-scroll and loops all know its length. To hold a bar inside a multi-bar system, put that bar in its own system or chart line.
- `@free`: the next bar is unmeasured. Playback renders it at its nominal length. Auto-scroll and the practice metronome pause there until the player taps "continue". Its sync anchors are required (§26).

### 16.5 Swing

`Feel`/`@feel` change playback onsets only, for strums, notes and drum events alike. The timeline keeps both the notated (straight) times and the performed (swung) times. `swing` means eighths at 2:1. `swing 1/8 3:2` and `swing 1/16` are explicit forms. Ratios are rational.

---

## 17. Timing model (normative)

### 17.1 Pipeline

```
text → lex/parse → CST (lossless) + AST (source spans) + diagnostics
     → resolve:  parts, chords, patterns, state by document position (§7.2)
     → unroll:   PerformanceBars with addresses (§6.6)
     → time:     PerformanceTimeline (rational onsets/durations, tempo map, seconds)
     → render:   layout + audio schedule
```

### 17.2 Exact time

- All times are **rationals in whole notes**. Bar onsets are cumulative sums of bar durations.
- **Onsets inside a bar:**
  - chart slot *i* of N: `i × barDur / N`
  - ruler token at in-bar beat position *k* (rational): `k × beatLen`
  - column mode, column *c*: `c × slot`
  - untimed tab, onset *i* of *m* distinct columns: `i × barDur / m`
  - token lanes: the running sum of durations
- **Seconds:** each beat lasts `60 / bpm(beat)` seconds, with bpm taken stepwise (§16.2). Swing is a final remap within each beat pair.
- Conforming implementations MUST produce identical timelines for the corpus. The canonical JSON writes rationals as strings (`"3/4"`).

### 17.3 Timeline JSON (conformance shape)

```json
{ "tabu": "0.1",
  "bars": [ { "index": 0, "address": "Intro#1:1", "onset": "0", "duration": "1/4",
              "meter": "3/4", "tempo": "84", "chord": null } ],
  "events": [ { "kind": "note", "part": "gtr", "string": 4, "fret": 0,
                "onset": "0", "duration": "1/4", "sound": "3/8",
                "techniques": [], "bar": 0, "span": [37, 4, 37, 5] },
              { "kind": "strum", "dir": "D", "chord": "G", "onset": "7/2", "duration": "1/8", "bar": 5 },
              { "kind": "lyric", "text": "mazing", "onset": "13/4", "timing": "T3", "bar": 5 } ],
  "diagnostics": [ { "code": "I310", "severity": "info", "span": [1, 1, 1, 10], "message": "timing level L3" } ] }
```

These values are taken from `examples/amazing-grace.tabu`. The pickup note on the D string has a notated duration of one beat, and it keeps sounding (`Ring: on`) until the next D-string note, on the "+" of the following beat. Onsets are absolute, in whole notes from the start of the performance. Spans are `[line, column, endLine, endColumn]`, 1-based, with the end exclusive.

### 17.4 What the features read

| Feature | Data |
|---|---|
| Auto-scroll | The time span of each system and lyric line (T1–T6, labelled exact or estimated); `@free` waits. |
| Playback / synthesis | Note, strum and chord events with per-string channels, the arrival curves, and the tempo map. |
| Drums | Drum events (§11.12) on the same scheduler as the metronome and synth. |
| MIDI export | The whole timeline plus the tempo and meter maps (§25.5). |
| Slow-down | A scaled tempo map. Rational time means no drift. |
| A/B loops | Performance-bar addresses, `@mark`, and section and block names. |
| Metronome / count-in | Meter class, groupings, pickups, `@hold`, `CountIn`. |
| Transpose / capo shift | Chord symbols, `Key`, `Capo` (§8.3). |
| Practice tracking | Addresses plus the content hash (§26). |
| Editor two-way sync | Source spans on every AST node and timeline event. |

---

## 18. Token lanes (`N|`): the generator form

Token lanes are an exact escape hatch for passages that rulers express badly: nested tuplets, long rests, and Guitar Pro or MusicXML imports. **They are not part of the hand-writing guide.** They are valid at every level, the formatter offers to convert them to ruler form whenever that is possible, and the conformance suite requires both forms to produce identical timelines.

```tabu
N| 7.3:8 b9:4.{v} r7:8 8.2 5.2 5.1 | 5.3:8 /7 6.2 h8 5.1 8.1 p5 6.2 |
```

| Form | Meaning |
|---|---|
| `fret.string` | A note. Strings are numbered with 1 as the highest. |
| `(0.5 2.4 2.3)` | Simultaneous notes. |
| `-` | Rest. |
| `x.4` | Dead note. |
| `h7`, `p5`, `/7`, `\5`, `s7`, `t12`, `b9`, `r7` | Arrival on the same string as the previous note. It takes a duration like any beat. |
| `:1 :2 :4 :8 :16 :32 :64`, `:4.`, `:8t` | Duration. It is sticky: it applies to the following tokens until changed. |
| `{5:4 … }:16` | General tuplet. |
| `{pm} {lr} {v} {nh} {ah} {ph} {g} {pb10} {acc} {st}` | Effects. |

Each `N|` bar MUST sum to its meter (E140).

---

## 19. Grammar

Parsing has two levels. First, the line classifier (§4.4, §12.2) splits the file into header, headings, directives, notes and systems, and assigns each system line to a lane. Second, a per-lane grammar parses each line's content. Lanes are lexed independently, which is how one glyph can have different meanings in different lanes without ambiguity. The real parser is hand-written with error recovery (§21). These grammars are normative for *validity*.

Notation: EBNF for the line level, PEG (ordered choice `/`, `*`, `+`, `?`, `&`, `!`) for lanes. `Sp <- ' '*`, `Sp1 <- ' '+`, `EOL` is the end of the line.

### 19.1 File and line level (EBNF)

```ebnf
file          = [ BOM ] , { blank-line } , [ "---" , EOL ] , magic , EOL ,
                { header-line | blank-line | comment-line } , [ "---" , EOL ] ,
                { body-line } ;
magic         = "Tabu:" , ws , int , [ "." , int ] , ws ;
header-line   = key , ":" , [ ws1 , value ] , [ trailing-comment ] , EOL ;
key           = letter , { letter | digit | "-" } ;
value         = { char } ;                         (* literal; "\//" escapes a comment marker *)
trailing-comment = ws1 , "//" , { char } ;

body-line     = blank-line | fence-line | comment-line | heading | directive
              | note-line | system-line ;
fence-line    = [ "   " ] , "```" , { "`" } , { char } , EOL ;      (* ignored *)
comment-line  = ws , "//" , { char } , EOL ;
heading       = ( "#" | "##" ) , ws1 , name ,
                [ ws1 , "<" , ws1 , name ] , [ ws1 , "x" , int ] , [ ws1 , attrs ] ,
                [ trailing-comment ] , EOL ;
name          = name-char , { name-char } ;          (* any char except "<", "{" and a trailing " xN" *)
attrs         = "{" , attr , { ws1 , attr } , "}" ;
attr          = ident , "=" , ( bare | quoted ) ;
directive     = "@" , ident , [ ws1 , args ] , [ trailing-comment ] , EOL ;
note-line     = ">" , { char } , EOL ;
system-line   = escaped-lyric | labelled-lane | chart-line | chord-line | lyric-line ;
labelled-lane = ws , [ part-id , ":" ] , ( string-label | "T" | "S" | "L" | "N" ) , "|" , lane-body , EOL
              | ws , drum-voice , "|" , lane-body , EOL ;          (* §11.7; no part prefix *)
string-label  = ( "A".."G" | "a".."g" ) , [ "#" | "b" ] | "1".."9" ;
drum-voice    = voice-name | "gm" , digit , [ digit ] ;            (* case-insensitive; fixed table in §11.7 *)
```

Classification order is the table in §4.4. Inside grid systems, unlabeled lines are chord lanes or effect lanes (§12.2).

### 19.2 Directive arguments

```peg
Args        <- TempoArg / TimeArg / PatternDef / PlayArg / MarkArg / DrumsArg / GrooveArg / FillArg / Word (Sp1 Word)*
TempoArg    <- Bpm (Sp '->' Sp Bpm Sp1 Int)?            # @tempo 84->96 4
Bpm         <- ([qhe] '.'? '=')? Int
TimeArg     <- Int '/' Int (Sp '(' Int ('+' Int)+ ')')?
PatternDef  <- PatName (Sp '=' Sp PatternBody)?          # no '=' : next system defines it
PlayArg     <- Name (Sp1 'x' Int)? (Sp1 'bars=' Int '-' Int)?
MarkArg     <- '"' [^"]* '"'
DrumsArg    <- GrooveName                                # @drums: the next system is the grid (§19.10)
GrooveArg   <- 'off' / 'none' / GrooveName               # @groove, and the Groove: header value
FillArg     <- 'end' / GrooveName (Sp1 'end')?           # @fill; no argument is also valid
```

Each directive takes only its own argument form; the alternatives above are selected by the directive name.

### 19.3 Chart line

```peg
ChartLine   <- Sp Open ChartBar (Barline ChartBar)* Sp TrailingComment? EOL
Open        <- '|:' / '||' / '|'
Barline     <- ':|:' / ':|' RepeatCount? / '|:' / '||' / '|]' / '|'
RepeatCount <- 'x' Int                                   # no space after ':|'
ChartBar    <- Sp (Volta Sp)? (BarMeter Sp)? (Item (Sp1 Item)*)? Sp
Volta       <- '[' Int (',' Int)*
BarMeter    <- '[' Int '/' Int ']'
Item        <- Quoted / Slot
Slot        <- '%' / '.' / 'N.C.' / Split / '^'? ChordSym
Split       <- '(' Sp '^'? ChordSym (Sp1 '^'? ChordSym)+ Sp ')'
Quoted      <- '"' [^"]* '"'                             # not a slot
```

Semantic checks: the slot count satisfies the slot rule (E103); `%` is alone in its bar (E115); a bare `/` is E114. A `ChartBar` between two barlines is a bar, even when it is empty ("continue the previous chord"). The empty text after the final barline is not a bar. Text after the final barline other than a trailing comment is E110.

### 19.4 Chord line and inline lyric

```peg
ChordLine   <- Sp CToken (Sp1 CToken)* Sp TrailingComment? EOL
CToken      <- '^'? ChordSym / 'N.C.' / '|'
LyricLine   <- '\'? (Escape / InlineChord / BarMark / Text)* EOL
InlineChord <- '[' '^'? ChordSym ']'
BarMark     <- '|'
Escape      <- '\' [\[\]|\\]
Text        <- (![\[\]|\\] .)+
```

A `ChordLine` immediately followed by a `LyricLine` forms a chord-over-lyric pair (§10.1).

### 19.5 Header values with structure

```peg
ChordDef    <- (PartId ':')? ChordSym Sp '=' Sp Voicing (Sp '|' Sp Voicing)*
Voicing     <- Frets (Sp1 CAttr)*
Frets       <- FretD ('-' FretD)+ / FretC+                # dashed form or compact form
FretC       <- 'x' / [0-9] / '(' [0-9] [0-9]? ')'
FretD       <- 'x' / [0-9] [0-9]?
CAttr       <- 'fingers=' [0-4Tx\-]+ / 'barre=' Int / 'base=' Int
             / 'bass=' [1-9] '/' [1-9] / 'name=' Quoted
PatternBody <- PatBar (Sp '|' Sp PatBar)* (Sp1 'grid=' Int '/' Int 't'?)?
PatBar      <- PTok (Sp1 PTok)* / PChar+
PTok        <- '>'? (Pick ('+' Pick)* / [DUdux]) / '.' / '-' / '!'
Pick        <- 'B' / 'b' / [1-9]
PChar       <- [DUdux.\-!Bb1-9]
PartDef     <- PartId Sp1 Quoted (Sp1 ('tuning=' TuningVal / 'capo=' Int / 'sound=' Word))*
TuningVal   <- Pitch (Sp1 Pitch)* / [a-z0-9\-]+                # explicit pitches (low to high) or a preset name
Pitch       <- [A-G] ('#' / 'b')? [0-9]
```

Semantic checks: the fret count equals the part's string count (E112); fingers has one character per string; unknown attributes are E113.

### 19.6 Chord symbol

```peg
ChordSym    <- Root Quality? Degree? Alter* Group? ('/' Root)? Voicing?
             / NashRoot Quality? Degree? Alter* Group? ('/' NashRoot)? Voicing?    # ChordNames: nashville
Root        <- [A-G] Acc?
Acc         <- '#' / 'b' / '♯' / '♭'
Quality     <- 'maj' / 'ma' / 'M' / 'Δ' / 'min' / 'mi' / 'm' / '-' / 'dim' / '°' / 'aug' / '+' / 'ø'
Degree      <- '6/9' / '69' / ('maj' / 'M' / 'Δ')? ('13' / '11' / '9' / '7' / '6' / '5' / '4' / '2')
Alter       <- ('b' / '#' / '♭' / '♯' / '+' / '-') ('5' / '9' / '11' / '13')
             / 'add' ('2' / '4' / '9' / '11' / '13') / 'sus' ('2' / '4')? / 'no3' / 'alt'
Group       <- '(' (Degree / Alter) (',' ' '? (Degree / Alter))* ')'
Voicing     <- '@' [A-Za-z0-9_\-]+
NashRoot    <- Acc? [1-7]
```

The PEG backtracks across the optional parts, so `Cmaj7` parses either as quality `maj` plus degree `7` or as degree `maj7`. Both normalise to the same chord.

### 19.7 Staff lane

```peg
StaffBody   <- (Bar Barline)+ Trailing?
Barline     <- ':|:' / ':|' / '|:' / '||' / '|]' / '|'
Bar         <- Item*
Item        <- Note / Modifier / Connector / SlideOut / Fill / Vibrato / Stop / Tie / PatternCell
Note        <- Fret ArtHarm? Prebend? / 'x' / '(' Fret ')' / '<' Fret '>'
Fret        <- [0-9] [0-9]? ![0-9]                 # a third digit is E121
ArtHarm     <- '<' Fret '>'
Prebend     <- 'pb' (Fret / BendAmt)
Modifier    <- 'tr' Fret / 'b' (Fret / BendAmt) / 'r' Fret
Connector   <- ('h' / 'p' / 's' / 't' / '/' / '\') Fret
SlideOut    <- ('/' / '\') &('-' / '!' / '~' / Barline / EOL)
BendAmt     <- '(' ('1/4' / '1/2' / '3/4' / 'full' / '1.5' / '2') ')'
Fill        <- '-'
Vibrato     <- '~'
Stop        <- '!'
Tie         <- '_'
PatternCell <- 'o' / 'B' / 'b' ![0-9(]             # pattern blocks only, else E116
Trailing    <- Sp1 ('x' Int / '(' [^)]* ')')
```

Semantic checks (§12.6, §12.7): connector and modifier linking; legato targets on ruler tokens (E106); releases follow a bend (E124); fret limit (E121); bar widths in column mode (E102).

### 19.8 Ruler, strum, lyric and effect lanes

```peg
RulerBody   <- (RBar Barline)+ Trailing?
RBar        <- Sp (BarMeter Sp1)? Unit (Sp1 Unit)* Sp
Unit        <- Beat (Sp1 Sub)*
Beat        <- [1-9] [0-9]?
Sub         <- 'trip' / 'let' / 'la' / 'li' / 'e' / '+' / '&' / 'a' / '.'
StrumBody   <- (SBar Barline)+                        # tokens are PTok, placed under ruler tokens
SBar        <- Sp (PTok Sp)*
LyricLane   <- (LBar Barline)+                        # syllables placed under ruler tokens
EffectLane  <- Sp (EffTok Sp)*
EffTok      <- Quoted / 'let ring' '-'* / [A-Z][A-Z] '-'* / ('vib' / 'tr' / 'rake' / 'arp^' / 'arpv' / 'arp' / 'fermata') '-'*
             / [>'v^pima] / Word                       # Word: unknown token, W206
ChordLane   <- Sp (LaneTok Sp)*
LaneTok     <- ChordSym / 'N.C.' / '|' / Volta / 'x' Int
```

### 19.9 Token lane

```peg
NotesBody   <- (Sp NItem)* Sp
NItem       <- Barline / Volta / Tuplet / Beat
Beat        <- (NChord / NNote / NArrival / '-') Dur? Effects?
NNote       <- (Fret / 'x') '.' [1-9]
NChord      <- '(' Sp NNote (Sp1 NNote)* Sp ')'
NArrival    <- ('h' / 'p' / '/' / '\' / 's' / 't' / 'b' / 'r') Fret ('.' [1-9])?
Dur         <- ':' ('1' / '2' / '4' / '8' / '16' / '32' / '64') ('.'* / 't')
Effects     <- '{' Eff (Sp ',' Sp Eff / Sp1 Eff)* '}'
Tuplet      <- '{' Int ':' Int (Sp1 Beat)+ Sp '}' Dur
```

### 19.10 Drum grid

```peg
DrumGrid    <- (RulerLine / DrumLane / CommentLine)+        # directly after '@drums NAME'; exactly one RulerLine
DrumLane    <- Sp DrumVoice '|' DrumBody EOL                # no part prefix, no trailing comment
DrumVoice   <- VoiceName / 'gm' [0-9] [0-9]?                # case-insensitive; VoiceName = a name or alias in §11.7
             / [A-Za-z] [A-Za-z0-9]*                        # inside a drum grid only: unknown voice, W230
DrumBody    <- (DBar '|')+
DBar        <- DCell*
DCell       <- Step / NoHit
Step        <- [xXoOgfF!]                                   # each Step sits under a ruler token (E106)
NoHit       <- ' ' / '-' / '.'
GrooveName  <- [A-Za-z0-9_\-]+                              # 'off', 'none', 'end' reserved (E164)
```

Semantic checks (§11.6 to §11.10): exactly one ruler and no other lanes (E161); barline columns (E101); steps under ruler tokens (E106); full bars of the grid's meter (E108); unknown voice (W230); duplicate voice lane (W231); unknown step glyph (E162); `@drums` with no grid (E163); reserved name (E164); unknown name in `Groove:`, `@groove` or `@fill` (E131).

---

## 20. Validation levels, timing levels and diagnostics

### 20.1 Validation levels

| Level | Used by | Behaviour |
|---|---|---|
| `lenient` | paste, import, the editor while typing | Accepts tab characters, `.` in staves, off-ruler onsets (snapped), unlabeled rulers, bare `/` in charts, non-chord brackets and uneven staff lines (padded). Every assumption is reported as a warning with an autofix. |
| `strict` | "Save", share, export | Everything that is an error in this spec is an error. Timing *level* is never an error. |
| `library` | the open GitHub library's CI | `strict`, plus the required rights metadata and the `library` profile checks of §22. |
| `upload` | the hosted backend's linter gate (the Worker) and the app's validate-before-upload screen | `strict`, plus the required upload metadata and the `upload` profile checks of §22. It never rejects a file for containing lyrics or tab. |

`library` and `upload` are **publishing profiles**, not stricter versions of the format. A file that passes `strict` is a complete, valid Tabu file whatever they say about it.

### 20.2 Timing levels (reported, never required)

| Level | Meaning | Badge |
|---|---|---|
| **L0** | Chords and lyrics, untimed or estimated (T5, T6). Untimed tab. | Chord sheet |
| **L1** | Every bar is measured: chart lines, bar marks, chord binding, line-parallel, rulers or token lanes. | Bar-timed |
| **L2** | L1, plus every chart, lyric and instrumental bar has an active pattern, is `N.C.`, or comes after an explicit `@strum off`. | Playable backing |
| **L3** | L2 (or L1 for files with no chart bars), plus every grid system timed by a ruler or a grid, every lyric line timed by T1 to T4, and no snapped onsets. | Fully timed |

Grooves (§11.5) neither raise nor lower the timing level. The validator reports the level per section and the minimum for the file (I310). The library shows it as a badge, so a bare chord sheet is a valid first submission and a fully timed file earns "gold".

### 20.3 Diagnostic catalogue

Each diagnostic has a stable code, a severity, a source span, a message and an optional autofix. The corpus has one folder per code.

| Code | Severity (strict) | Meaning |
|---|---|---|
| E100 | error | Tab character in a column-sensitive line. |
| E101 | error | Barline columns differ across the lanes of a grid system. |
| E102 | error | Bar width does not match the grid (column mode). |
| E103 | error | Slot count breaks the slot rule (chart bar or lyric bar). |
| E104 | error | Pattern bar does not fit the meter, or does not match its `grid=`. |
| E105 | error | Ruler bar malformed: beats not consecutive, a bar not starting on a beat, or an unknown token. |
| E106 | error | Onset or legato target not under a ruler token. |
| E107 | error | Ruler token name conflicts with its placeholder position. |
| E108 | error | Short bar where none is allowed. |
| E110 | error | Not a chord symbol (chart line, chord lane or inline bracket). |
| E112 | error | Chord definition has the wrong number of frets. |
| E113 | error | Unknown chord-definition attribute. |
| E114 | error | Bare `/` slot in a chart. |
| E115 | error | `%` not alone in its bar. |
| E116 | error | Pattern cell (`o`, `B`, `b`) outside a pattern block. |
| E120 | error | Staff line count differs from the part's string count. |
| E121 | error | Fret above `Frets`, or a three-digit fret. |
| E122 | error | Connector with no valid note (`p`, `s` from nowhere; slide-out with no note). |
| E123 | error | Modifier (`b`, `r`, `pb`, `tr`, `<n>`) with no note. |
| E124 | error | Release without a preceding bend. |
| E125 | error | Repeat count, volta or other text inside a staff. |
| E130 | error | Nested repeats, or an ending outside a repeat. |
| E131 | error | Unknown section, block, pattern or groove in `Form`, `@play`, `<`, `@strum`, `Groove`, `@groove` or `@fill`. |
| E132 | error | Inheritance cycle. |
| E140 | error | Token-lane bar sums to the wrong duration. |
| E150 | error | Missing magic line (the file goes to the importers). |
| E151 | error | Unsupported major version (opens read-only). |
| E160 | error | Drum lane outside a drum grid (no `@drums NAME` directly above its system). |
| E161 | error | Malformed drum grid: no ruler, more than one ruler, a lane other than `T\|` and drum lanes, or a barline other than `\|`. |
| E162 | error | Unknown step glyph in a drum lane. |
| E163 | error | `@drums NAME` not directly followed by a drum grid (lenient: read as `@groove NAME`). |
| E164 | error | Reserved groove name (`off`, `none`, `end`) in `@drums`. |
| E200 | error | Bar-producing content (chart, lyric, grid or token systems) before the first heading (§6.1). |
| W110 | warning | Non-chord bracket kept as text (lenient). |
| W200 | warning | Header key found in the body (treated as lyric). |
| W201 | warning | Unknown header key. |
| W202 | warning | Unquantised column bar (lenient). |
| W203 | warning | String label does not match the tuning. |
| W204 | warning | Triplet grid inferred (dots-only ruler beat, or `Grid: auto`). |
| W205 | warning | Bar width differs from the previous bar (`Grid: auto`). |
| W206 | warning | Unknown effect token. |
| W207 | warning | `.` in a staff (read as fill). |
| W210 | warning | Duplicate section name. |
| W211 | warning | Duplicate non-repeatable header key. |
| W212 | warning | Unknown heading attribute. |
| W213 | warning | An inheriting section also defines its own bars. |
| W214 | warning | Chart line without a final barline. |
| W215 | warning | Unlabeled ruler (lenient). |
| W216 | warning | Duplicate chord or pattern definition (the last one wins). |
| W220 | warning | Unknown directive. |
| W230 | warning | Unknown drum voice label (lane kept, silent). |
| W231 | warning | Two lanes for the same drum voice in one grid (merged). |
| W232 | warning | Groove grid meter differs from the running meter (groove bars truncated or continued). |
| W233 | warning | Built-in style has no variant for this meter (no drums in those bars). |
| W234 | warning | Two fills on one bar (the later one wins). |
| W301 | warning | Lyric chords do not match the chart; the rest of the section falls back to estimated. |
| W302 | warning | A lyric line skips a chart chord change. |
| W303 | warning | Bar-mark count differs from the bars of the bound span. |
| W304 | warning | Inheriting section has a different line count from its parent. |
| I111 | info | Chord has no definition and is not in the dictionary. |
| I300 | info | Estimated or untimed timing. |
| I310 | info | Timing level report. |
| I320 | info | Section not reachable from `Form`. |
| I331 | info | Push with no active pattern uses an eighth. |
| I340 | info | A groove plays over estimated or untimed bars. |
| L400–L409 | profile error | Publishing profile violations at the `library` or `upload` level (§22). |

---

## 21. Error recovery

The parser never aborts. A bad line produces a diagnostic and a best-effort node, and the lossless CST keeps the original text for round-tripping.

1. **Line-local first.** Each line is classified on its own. A line that fails its lane grammar is kept as an `Unknown` node with the original text, displayed verbatim.
2. **Systems contain damage.** There are no start/end pairs, so an error cannot extend past the next blank line. A pasted Markdown fence is ignored, so an unclosed fence cannot swallow the file.
3. **Grid systems degrade, not vanish.** If a grid system fails its structural checks (E101, E120), it is rendered as verbatim monospace tab and treated as **untimed**. It contributes one bar per barline-delimited segment of its first staff line, which keeps the timeline length stable.
4. **Timing falls back, never fails.** Ruler problems in lenient mode snap onsets. Binding failures fall back down the T-chain (§10.5). An impossible chart bar keeps its meter length and spreads its slots evenly, marked estimated.
5. **Unknown is preserved.** Unknown header keys, directives, heading attributes and effect tokens are kept and re-emitted by `tabu fmt`.
6. **Header recovery.** A malformed header line (no colon) ends the header. The line is parsed as body content, and E200 applies if it produces bars before the first heading.
7. **References.** An unknown `Form` item, `@play` target, `<` parent, `@strum` pattern or groove name is dropped from playback with E131. The rest of the song still plays.
8. **Drum grids fail quietly.** A drum grid that fails its structural checks (E101, E161) is displayed verbatim, and every bar that uses it has no drums. Since grids never contribute bars, the timeline length is unaffected.
9. **Autofixes.** Every lenient assumption carries a machine-applicable fix: expand tabs, add `T|`, snap an onset, insert a barline, replace `/` with `.`, or convert chord-over-lyric to inline.

---

## 22. Rights profiles (publishing policy, not format rules)

**The format does not restrict content by rights.** Lyrics, tab, `N|` and `L|` lanes, patterns, grooves and every other construct are valid in every file, whatever its `Rights` value. The `lenient` and `strict` levels never read `Rights`. A user's own transcription of a copyrighted song, lyrics included, is an ordinary valid Tabu file.

Whether a file may be *published* in a particular place is that home's policy. The two profiles below are the linter rules for the project's two homes (docs/ROADMAP.md §6): `library` for the open GitHub library (public-domain, traditional, Creative Commons and original songs, merged by pull request) and `upload` for the hosted backend (user uploads under the DMCA safe harbor). They implement the content tiers in `docs/research/03-content-and-licensing.md`. They are not legal advice, and they need a lawyer's review before either home opens. Another host may define its own profiles; the format does not change.

| `Rights` | Meaning | `library` (open GitHub library) | `upload` (hosted backend) |
|---|---|---|---|
| `public-domain` | Words and music are in the public domain. | Accepted. `Source` required. `Composed` ≤ the public-domain cutoff (1930 as of 2026; it moves forward every 1 January). Trap-title check. | Accepted |
| `traditional` | A traditional song, from a printed source. | Accepted. `Source` must cite a printed source dated within the cutoff. Trap-title check. | Accepted |
| `cc` | Under a Creative Commons licence. | Accepted. `License` and a `Source` URL required. "No derivatives" licences rejected; non-commercial licences flagged. | Accepted |
| `original`, `permission` | The submitter's own song, or used with the rights holder's permission. | Accepted. Submitter warranty; `permission` needs a contact on file. | Accepted |
| `user-submitted` | A user's own transcription or arrangement of a song whose rights they do not hold. Full lyrics, tab and everything else may be included. | **Not accepted** (L408): copyrighted songs never go in the public repository. | Accepted. Upload terms, uploader logging and the takedown process are hosting policy (docs/ROADMAP.md §6.3). |
| `skeleton` | An optional label for a chords-and-form chart with no lyrics, melody or riffs. The profile checks that a file wearing the label really is lyric-free. Choosing it is the uploader's option, never a requirement. | Not accepted (L408), for the same reason. | Accepted, with the label checks L401, L405 and L406. |
| `licensed` | Covered by a licence the platform holds. | Not accepted (L408). | Can only be set by platform staff. |

`skeleton` label checks: no lyric line, `L|` lane, `N|` lane or staff line with literal frets (pattern blocks made only of `o`, `B`, `b`, `x`, `-` and `!` are allowed, and so are grooves); quoted text of 40 characters or fewer; no image links; `>` notes go through the lyric detector. A file that fails them is still a valid file. The fix is to drop the label (for example to `user-submitted`), not to remove the lyrics.

The `upload` profile also requires `Title`, `Artist`, `Rights` and `Explicit`, and a file size within the host's limit. It never rejects or strips lyrics or tab.

Profile diagnostics:

| Code | Meaning |
|---|---|
| L400 | Missing `Rights`, `License` or (where required) `Source`; at the `upload` level also missing `Title`, `Artist` or `Explicit`. |
| L401 | A file labelled `skeleton` contains a lyric line, staff line with literal frets, `N\|` lane or `L\|` lane. Relabel it, or remove the label. |
| L402 | `Composed` is after the public-domain cutoff. |
| L403 | Title is on the trap list (for example "I'll Fly Away", published 1932). |
| L404 | "No derivatives" licence. |
| L405 | Quoted text over 40 characters in a file labelled `skeleton`. |
| L406 | Lyric detector hit: lyric text in a file labelled `skeleton`; lyrics in a `public-domain` or `traditional` file that match a known later text; or lyric text in LLM-assisted output that was not in the user's input (§25.2). |
| L407 | `Origin: llm-assisted` without the user-confirmation flag set by the submit flow. |
| L408 | `Rights` value not accepted by this home (for example `user-submitted` at the `library` level). |

---

## 23. Versioning and extensibility

- **`Tabu: MAJOR.MINOR`.** In 0.x drafts anything may change. From 1.0, **minor versions are additive only**: new header keys, directives, effect tokens, techniques and chord qualities. A minor version never changes the meaning of a valid file.
- **Readers MUST preserve unknown keys, directives, attributes and tokens**, warn about them, and keep going. A file with a newer minor version opens normally, with the note "made with a newer version".
- **A newer major version** opens read-only in compatibility mode (E151).
- **Extension namespaces:** header keys `X-…` and directives `@x-…` are reserved for tools and apps. They are never warned about, and they are always preserved. The spec will never define a key or directive with these prefixes.
- **Media type and version:** the MIME type does not carry a version. The magic line does.

---

## 24. Graceful degradation and Markdown embedding

### 24.1 What each reader sees

| Reader | Result |
|---|---|
| Our app, site or editor plugins | Engraved tab, diagrams, highlighted lyrics, playback, loops, transpose. |
| Plain text editor, terminal, email, notes app, forum post | A normal chord sheet with ordinary ASCII tab. Headers read as a labelled list, `#` as headings, `>` as quotes. All timing is visible: count ruler tokens, count chart slots, read the bar marks. |
| Monospace printout | A usable chart. The app's PDF export adds diagrams. |
| Proportional-font chat app | Inline-chord lyrics survive. Tab and chord-over-lyric alignment does not. "Copy as text" offers an inline-chord version for this case. |
| A ChordPro app | Use `tabu export --chordpro` (§25.1). A raw `.tabu` is not ChordPro. |
| An older Tabu reader | Unknown constructs are preserved and warned about (§23). |
| A Tabu reader without drum playback | Grooves are skipped. Drum grids are recognised and shown as text, never read as lyrics, and the bars and the rest of the timeline are identical (§11.12). |
| Screen reader (in the app) | The semantic model reads "Verse 1, bar 3, G, three beats" and "string 2, fret 8, bend full step". |

### 24.2 Markdown embedding

````markdown
## Tonight's set

```tabu
Tabu: 0.1
Title: Amazing Grace
Key: G
Time: 3/4
...
```

A riff, as a fragment (no magic line):

```tabu
T| 1 + 2 + 3 + |
e|-------------|
B|-1-----------|
G|---2---0-----|
...
```
````

- GitHub, GitLab and Obsidian show the block as monospace code, so alignment is kept.
- Our site, the Obsidian plugin and the markdown-it plugin render it.
- A **fragment** is a fenced block with no magic line. It is parsed as the body of a file with default header values (`Time: 4/4`, `Tempo: 100`, standard tuning), plus any `Key: value` lines at its top.
- The info string is `tabu`. The proposals' bare `tab` fence id is not used, because it collides with the Obsidian Tablature plugin.

---

## 25. Import and export

All importers produce the shared model (Score > Part > Section > Bar > Beat > Note, shaped like alphaTab's model). Then `tabu fmt` writes canonical text, and the result opens in the editor with a review diff. Imports set `Origin: import(...)`.

### 25.1 ChordPro (`.cho`, `.chopro`, `.crd`, `.chordpro`, `.pro`)

| ChordPro | Tabu import | Tabu export |
|---|---|---|
| `{title}` `{t}` `{subtitle}` `{artist}` `{composer}` `{lyricist}` `{album}` `{year}` | header keys | same directives |
| `{key}` `{capo}` `{time}` `{tempo}` | `Key`, `Capo`, `Time`, `Tempo` (ChordPro `key` taken as sounding) | same |
| `{meta: name value}` | header key, or `X-name` if unknown | `{meta: …}` for Tabu-only keys (`Tuning`, `Rights`, `Source`, `License`, `Origin`, `Feel`) |
| `{start_of_verse: label="Verse 1"}` … `{end_of_verse}`, likewise chorus, bridge, part, and custom `start_of_*` | `# Verse 1` | `{start_of_verse: label="…"}`; other types become `start_of_verse` with the label kept, unless the target supports custom sections |
| `{chorus}` (recall) | empty `# Chorus` heading (replay) | `{chorus}` |
| inline `[Am]` lyrics | inline lyric lines (no bar marks), timing T5 until the user picks bars or a chart | inline chords; chord-over-lyric is converted to inline; `^` and `@voicing` are dropped |
| `{define: Am base-fret 1 frets x 0 2 2 1 0 fingers …}`, `{define-guitar: …}` | `Chord: Am = x02210 fingers=…` (relative frets converted to absolute using base-fret) | `{define: …}` |
| `{start_of_grid}` cells | chart lines. A ChordPro `/` cell ("strike again") becomes an explicit repeat of the chord name; `.` stays `.` | chart lines become `{start_of_grid}` placed before the section's lyrics |
| `{start_of_tab}` … `{end_of_tab}` | untimed grid systems via the ASCII pipeline | `{start_of_tab}` with the text unchanged (rulers and lanes included) |
| `{comment}` `{c}` `{ci}` `{cb}` | `> note` | `{comment: …}` |
| `{transpose: n}` | applied to chord symbols, with a note | dropped (symbols are already transposed) |
| `x_…` directives | `@x-…` directives | `{x_tabu_…}` |
| — | `Pattern`, `@strum` | `{comment: Strum: D . D U . U D U}` |
| — | `@play`, `Form` | expanded copies (default) or `{comment: Intro ×2}` |
| — | `Groove`, `@groove`, `@drums`, `@fill` | `{comment: Groove: rock}` where the groove changes; drum grids are dropped |
| `{new_song}` (multi-song files) | split into one file per song | not used |

### 25.2 Pasted ASCII and Ultimate-Guitar-style text (highest volume)

1. **Normalise:** tabs to spaces, Unicode dashes to `-`. Strip `[tab]`/`[ch]` tags. Turn `[Verse]`, `Verse:` and `CHORUS` into `#` headings. Scrape `Capo 2`, `Tuning: …` and `Key: …` into the header.
2. **Staff groups:** runs of 4 to 8 string lines. Infer the tuning from the labels, or ask. Normalise ragged lines. Map dialects: `^` to `b`, an ambiguous `s` to `/`, `*` to a `PH` effect, `P.M.` to `PM`, and `.` inside staves to `-`. Bars become **untimed**.
3. **Make timed (optional):** the editor proposes a ruler from the onset column statistics, or the user taps along while the notes highlight in order. The user confirms with playback.
4. **Chord-over-lyric blocks** are kept as they are (T5, one bar per chord). An optional "add bar marks" tool lets the user tap the changes.
5. **Local LLM (qwen at `http://127.0.0.1:18090/v1`), optional, and only on text the user supplied:** classify lines, propose section names and the meter, fix chord-line alignment, convert legends ("PM = palm mute") into effects. The model returns Tabu, which is re-parsed (with up to two re-prompts on errors). It **never** adds lyrics, chords or notes that were not in the input. The output is tagged `Origin: llm-assisted`, and a diff against the input checks that the model added no lyric text of its own (L406). Lyrics that were in the user's input are kept as they are.
6. **Drum tab** (staffs labelled `HH`, `SD`, `BD`, `C`, `R`, `T1` and similar) is recognised by its labels and never read as guitar strings. A short repeating drum tab is offered as a `@drums` grid (§11.6); anything else is kept as a `>` note.

### 25.3 Guitar Pro (GP3–5, `.gp`) and MusicXML

| Source | Tabu |
|---|---|
| tracks | `Part:` (tuning, capo, sound) |
| measures | bars. Meter and tempo changes become directives or `[p/q]`; repeats and endings become chord-lane tokens or `@repeat`. |
| beats | Ruler form when every onset in a bar fits ruler names (at most 8 positions per beat, or triplets). Otherwise an `N\|` token lane for that bar. |
| bends | `b`/`r` arrivals at the nearest ruler position to the bend's peak and release points |
| hammer, pull, slide, harmonic, PM, let ring, dead, ghost, tap, vibrato, trill | §13, one to one. Unsupported effects become quoted effect-lane text, so nothing is silently lost. |
| lyrics | `L\|` lanes (syllable-exact) |
| chord symbols / diagrams | chord lanes / `Chord:` |
| drum tracks | Not imported as notation (§0). The importer reports them, and MAY propose the nearest built-in style or a `@drums` grid built from a repeating bar. |

Readers: `dart_gp_tab_reader` (GP3–GP8) and `music_xml`. alphaTab's importers serve as a behavioural reference only, because of MPL-2.0.

### 25.4 Export targets

| Target | Fidelity |
|---|---|
| ChordPro | High for chord sheets (§25.1). Tab exported as text. |
| MusicXML (with tab staff) | Full timing and techniques for L3 content. Untimed tab is marked "rhythm unknown". Grooves export as an unpitched percussion part. This, or Guitar Pro, is where a full score goes, instead of growing the format. |
| MIDI | Guitar notes, strummed charts, a chord track and the drums, with tempo and meter maps (§25.5). |
| Audio (WAV, M4A) | Rendered from the same events as MIDI. |
| alphaTex | Timed tab, for alphaTab-based previews on the library website. |
| Markdown | The file wrapped in a ```` ```tabu ```` fence (§24.2). |
| ASCII / PDF | ASCII is the normalised raw file. The PDF uses the app renderer. |
| Guitar Pro | Low priority. |

### 25.5 MIDI export

`tabu export --to midi` writes a Standard MIDI File from the performance timeline (§17). The mapping below is normative, so two exporters write the same events. The one exception is the voicing of the chord track, whose *timing* is normative but whose *pitches* are not. Everything the export approximates is listed in an **export report** (JSON from the CLI, a sheet in the app).

**File.**

- SMF format 1, with a division of **960 ticks per quarter note**. An onset *t* in whole notes becomes tick `t × 3840`. Because 3840 = 2⁸ × 3 × 5, every ruler position (down to 64ths, triplets and quintuplets) lands on a whole tick. A token-lane tuplet that does not is rounded to the nearest tick and listed in the report.
- Onsets are the **performed** times, swing included (§16.5). `--notated` writes the straight times instead.
- `@free` bars are written at their nominal length, with a `free` marker.

**Tracks.**

| Track | Channel | Content | Present when |
|---|---|---|---|
| 0 Conductor | none | Tempo map, meter map, key signatures, markers | always |
| Guitar, one per part (`Part:` or the implicit `gtr`) | one per string (§15) | Tab notes and the strokes of strum and picking patterns, as played on that part | the part has events |
| Chords | one channel | Chord-name text events, plus a sustained block chord at every change | the file has chords |
| Drums | 10 | Groove and fill events, General MIDI drum map (§11.7) | the file has a groove |
| Lyrics | none | Lyric meta-events | the file has lyrics |

**Conductor track: tempo and meter maps.**

- **Tempo.** A Set Tempo event (FF 51) is written at the start and at every tempo change. A stepwise ramp (§16.2) writes one event per beat. Tabu tempo counts the meter's beat (§16.1), and MIDI tempo counts quarter notes, so the value is `round(60 000 000 / bpm × (1/4) / beatLength)` microseconds per quarter. `Tempo: 60` in 6/8, where the beat is a dotted quarter, gives 666 667.
- **Meter.** A Time Signature event (FF 58) is written at every meter change, **and at every bar whose length differs from the running meter**: pickups, `[p/q]` bars, `@hold` bars and a short last bar. A 4/4 bar with `@hold 2` is written as 6/4 and followed by 4/4 again, so a DAW's barlines match the performance bars and their addresses. Clocks per metronome click are 24 per quarter note of the beat: 24 for a quarter, 36 for a dotted quarter, 48 for a half. An additive meter is written as its plain fraction (`7/8`), and its grouping goes in a marker.
- **Key.** A Key Signature event (FF 59) comes from `Key` and `@key`, as the sounding key. Major and minor keys map directly. A mode is written with its parent major's key signature, so `D dorian` gets C major's.
- **Markers** (FF 06): the address of each section occurrence's first bar (`Verse 1#2:1`), and the text of each `@mark`.

**Guitar tracks.**

- **Program** from `sound=`: steel 26, nylon 25, clean electric 28, overdrive 30, distortion 31, bass 34 (General MIDI program numbers, counted from 1). The default is steel.
- **Channels.** Each string gets its own channel (§15), skipping channel 10. Each channel starts with RPN 0 setting the pitch-bend range to ±12 semitones. If the parts need more than the 15 channels left after the drums (in practice, a third part), the extra parts get one channel each, their bends then affect the whole part, and the report says so.
- **Pitch** is the sounding pitch: the string's tuning, plus the capo, plus the fret. Harmonics are written at their sounding pitch.
- **Bends, releases and vibrato** become pitch-bend events along the arrival curve (§12.7), at least one per 1/64 note. Vibrato depth and rate are exporter settings.
- **Durations** are sounding durations (§12.8), not notated ones.
- **Velocity:** 88 for a normal note, 112 for an accent, 48 for a ghost note (`(5)`), 76 under palm mute. Dead notes and muted strums are 1/64-note notes at velocity 24.
- **Strums** play each string of the voicing offset by `Spread`, converted to ticks through the tempo map. Downstrokes go low to high and upstrokes high to low. `D` and `U` are velocity 88, and `d` and `u` (top strings only) are velocity 64.

**Chords track.**

- At each chord change, a Text event (FF 01) carries the **sounding** chord name, which differs from the written shape when there is a capo. `--shapes` writes the shapes as written instead.
- A sustained block chord on program 1 at velocity 56 runs from each change to the next change, to `N.C.`, or to the end of the performance. Pushes (§9.3) are written at their pushed onset. Voicing is not normative: the recommended voicing is the slash bass or the root in octave 2, with the other chord tones close-voiced around middle C.

**Drums track.**

- Channel 10 uses the keys of §11.7. With `--gm1`, `shaker` is written as key 70 (Maracas).
- **Velocity:** 96 for `normal`, 120 for `accent`, 44 for `ghost`.
- **Flam:** a grace note at velocity 56, 40 ticks (a 1/96 note) before the main hit.
- **Length:** notes for `ohat`, `crash`, `ride` and `bell` last until the next hit on the same voice, a choke, or one bar, whichever comes first, so samplers that honour note-off can choke them. Every other drum note lasts a 1/32 note.
- **Choke:** a note-off for the ringing voice. On a hi-hat lane it also writes `pedal` (44) at velocity 40, which is the sound of a hat closing.

**Lyrics track.**

- One Lyric event (FF 05) per syllable from `L|` lanes, or per fragment between chords and bar marks in lyric lines, at its onset. A syllable joined with `-` keeps its hyphen. A carriage return (0x0D) ends each lyric line, and a line feed (0x0A) ends each section, following the MIDI lyric convention. Lyrics with estimated timing (T5, T6) are written at their estimated times and listed in the report.

**MIDI clock out** (a later player feature, not a file format): the player may send 24-PPQN MIDI clock derived from the same tempo map, Start at the first bar, and Song Position Pointer for loops and seeks, so a drum machine or DAW can follow the transport. Swing does not affect the clock.

---

## 26. Sidecar files

Machine-only data never goes in the readable body.

- **Audio sync:** `song.tabu.sync.json`, stored beside the song or in app storage, for the player's *own* recordings only. Syncing with streaming services is excluded by policy.

```json
{ "tabu": "0.1", "song": "sha256:…", "recording": "my-take-2026-11-20.m4a",
  "anchors": [ { "bar": "Intro#1:1", "index": 0, "t": 1.92 },
               { "bar": "Verse 1#1:1", "index": 5, "t": 9.80 } ],
  "latency_ms": 38 }
```

  Time between anchors is interpolated through the tempo map. Anchors are keyed by address, and the stored `index` detects drift after edits.

- **Practice data** (loops, sessions, best tempo, the chosen voicing per chord) lives in the app database, keyed by content hash plus bar address. A loop can be shared as a URL fragment such as `#loop=Solo%231:1-Solo%231:3`.

---

## 27. How the review findings were resolved

Every fatal flaw the two judges listed, with its resolution. The first column gives the proposal: **MN** markdown-native, **CP** chordpro-plus, **RF** rhythm-first.

| # | Flaw (proposal) | Resolution in this spec |
|---|---|---|
| 1 | Fence tax: 15–25 fence lines per song (MN) | No fences. Music lines are recognised by shape (§4.4). Fences are only for embedding in Markdown (§24.2). |
| 2 | A lyric outside a fence collapses into one paragraph (MN) | The file is not Markdown, so lines are never reflowed. |
| 3 | `.tab.md` cannot get its own UTI, ProgID or intent (MN) | One extension, `.tabu` (§1). |
| 4 | YAML gotchas (`1979`, `We're #1`, `Re: Your Brains`, `3/4` quoting) (MN) | Flat literal `Key: value` lines with no coercion (§4.3). |
| 5 | Chord-over-lyric drifts when edited; timing depended on it (MN) | Inline chords are first-class. `tabu fmt` converts both ways. Timing needs columns only in the optional chart-over-lyric layout (§10). |
| 6 | Verse 2 silently inherits a chart only if the sequences match (MN) | Explicit `<` inheritance, line-parallel timing, and W301–W304 diagnostics. Never silent (§6.4, §10.5). |
| 7 | The bare `tab` fence collides with the Obsidian plugin (MN) | The fence id is `tabu` (§24.2). |
| 8 | Ruler subdivision inferred from token count: `1 a` misread (MN) | Ruler tokens are positional by name. Placeholders must agree with names (E107) (§12.4). |
| 9 | Compound counting `1 + a` breaks the beat check (MN) | Compound meters are defined with dotted beats, consistently everywhere. Rulers may count beats or eighths (§12.4, §16.1). |
| 10 | Collapsed chord-sequence matching loses line anchors (MN, CP) | Per-line binding with no collapsing across lines (§10.5, T3). |
| 11 | Chords entered twice; "chart wins" (MN, CP) | Single-source options: T1 (the lyrics are the chart) or a chart plus chordless lines. When both exist, lyric chords are binding keys, not a second timing source (§10.5). |
| 12 | An unclosed fence or missing `{end_of_tab}` swallows the document (MN, CP) | No block delimiters. Fence lines are ignored (§4.4, §21). |
| 13 | `:\|x3` and `\|1.` inside staves collide with dead notes and frets (MN, CP, RF) | Banned in staves (E125). Voltas are written `[1` in chart lines and chord lanes (§6.5, §12.3). |
| 14 | The chord-line test misreads `A` or `Em` lyric lines (MN) | Documented rule, plus the `\` escape (§4.2). An instrumental line with no lyric is shown as chords, so the effect is visible. |
| 15 | Inconsistent onset anchoring (`(5)` vs `t12` vs `/3`) (MN) | One onset rule: the first character of the core (§12.6). |
| 16 | Section tempo attributes have undefined persistence (MN) | No state on headings. State resolves by document position (§6.1, §7.2). |
| 17 | `{start_of_verse}` … `{end_of_verse}` braces are slow to type (CP) | `#` headings (§6). |
| 18 | Inline `[Am]` hides the chord-over-word layout (CP) | Both forms are first-class and convertible (§10.1). |
| 19 | "Superset of ChordPro" is false: grid `/` meaning, unknown environments (CP) | Not claimed. There is an explicit import/export mapping. Bare `/` is banned, and ChordPro `/` imports as a restrike (§9.1, §25.1). |
| 20 | Dash counting against `grid=1/16` is tedious (CP) | The ruler is primary and spacing is free. Column mode is opt-in (§12.4, §12.5). |
| 21 | Invisible whitespace: lanes must be indented (CP) | Lanes are labelled (`T\|`, `S\|`, `L\|`, `N\|`). Unlabeled grid lanes are classified by content, never by indentation (§12.2). |
| 22 | Push `^` has three definitions (CP) | One definition: one active-pattern slot early, or an eighth with no pattern (§9.3). |
| 23 | Releases cannot be timed; bend/release contradictions (CP) | Arrival rule, with interpolation between ruler tokens for pitch targets (§12.7). |
| 24 | A typo in a rhythm row silently switches timing mode (CP) | No rhythm rows. Two timing mechanisms for tab: the ruler, and column mode with an explicit grid (§12). |
| 25 | Document-order state is undefined under Form and `{play}` (CP) | Document-position state; replays and inserts use the target's own state (§7.2). |
| 26 | Grammar contradicts its examples (`(x)`, `C6/9`, tuplets, LR) (CP) | The chord PEG is fixed, there is a torture list (Appendix A), and every example is checked against this spec (Appendix B). |
| 27 | Barline-padded lyrics are mandatory (RF) | Optional layout only (§10.4). Bar marks and binding cover the normal case. |
| 28 | The library requires barlines (RF) | Timing levels are badges, never requirements (§20.2). |
| 29 | Per-bar width inference: a dropped dash turns into triplets silently (RF) | No inference without `Grid`. `Grid: auto` warns on triplets and on width changes (W204, W205) (§12.5). |
| 30 | `.` and `-` swap meanings between lanes (RF) | One glyph table. `!` is the only stop glyph (§12.9). |
| 31 | Token mode presented as a peer of tab (RF) | It is the generator form, outside the hand-writing guide (§18). |
| 32 | Chords anchored only per bar; syllables interpolated (RF) | Inline and chord-over-lyric chords sit at syllables. T1 and T3 time chords individually (§10). |
| 33 | ChordPro export lossy, no compatibility story (RF) | Two-way mapping table (§25.1). |
| 34 | The even-split rule rejects compound meters (6/8 `\| G C \|`) (RF) | The slot rule uses the beat structure. 6/8 `\| G C \|` and 12/8 `\| G C D Em \|` are valid (§9.1). |
| 35 | Technique glyphs take up time in the column rule (RF) | In ruler mode they sit in the gaps between tokens. Only opt-in column mode charges columns (§12.4). |
| 36 | Cross-line lyric pickups are inexpressible (RF, and all three) | Pickup rule: text before a line's first chord or mark belongs to the previous bar (§10.3). |
| 37 | Line-classification collisions: barred chord line above a staff; an effect lane with a typo falling to lyrics; a lyric line starting with `\|` (RF) | A barred line inside a grid system is a chord lane. Unlabeled grid lines that are not chord lanes are effect lanes, and unknown tokens only warn. A body line starting with `\|` is always a chart line; escape lyrics with `\` (§4.4, §12.2). |
| 38 | `.` on one string rests every string (RF) | `!` stops only its own string (§12.8). |
| 39 | The header ends at the first blank line, so a later `Key:` becomes a lyric (RF) | The header is the leading run, with blank lines allowed. A known key found later is W200 (§4.3). |
| 40 | Unclear whether quoted chart tokens count as slots (RF) | They never count (§9.1). |
| 41 | `C6/9` and `Cø7` fail the chord grammar (RF) | Fixed PEG, plus Appendix A (§19.6). |
| 42 | Song-scoped `@tempo` is ambiguous under Form reordering (RF) | Document-position state (§7.2). |

### 27.1 Owner decisions folded in after the merge (2026-11-27)

The decisions themselves are recorded in `docs/OPEN-QUESTIONS.md` (D1 to D6). This table covers only what they changed in the format, and the design risks each change raised.

| # | Decision or risk | Resolution in this spec |
|---|---|---|
| 43 | D4: the format should carry a small, optional drum groove, but must not become drum notation | Named step grids (`@drums`), a `Groove:` header and `@groove` state, `@fill` bar marks, and ten built-in styles. No rolls, stickings, durations or per-bar drum parts; full scores go to MusicXML or Guitar Pro (§0, §11.5, §25.4). |
| 44 | A second timing mechanism for drums would split the engine | Drum grids reuse the `T\|` ruler, the onset rule (E106), barline alignment (E101) and full-bar checks (E108). There is no new timing rule (§11.6). |
| 45 | Header and directive names should pair, as `Tempo:` pairs with `@tempo` | `Groove:` and `@groove` both select the groove and take the same values. The definition directive has its own name, `@drums`, just as `@pattern` defines and `@strum` applies (§11.5). |
| 46 | Drum lane labels could collide with string labels (`cb` is a C♭ string) or turn lyric lines into lanes | The voice table is fixed, and no name or alias has the shape of a string label. Unknown words are never drum lanes outside a grid. A lyric line starting with `kick\|` needs `\` (§4.4, §11.7). |
| 47 | Drum tab writes `o` for an open hi-hat, but `o` for a hit on drums | Both, as drum tab does: `o` is a hit, except on the `hat` lane, where it is an open hat. `ohat` exists for writers who want it explicit (§11.8). |
| 48 | Under Form, repeats, `@play` and inheritance, the groove could become undefined | `@groove` is document-position state like `@strum` (§7.2). Cycles restart per section occurrence and continue through repeat passes. `@fill` is a bar mark that travels with its bar (§11.9, §11.10). |
| 49 | Should drums follow `@strum` and skip tab systems? | No. A groove covers every performance bar, including grid and token systems, because the drummer keeps playing under a solo (§11.9). |
| 50 | Readers without drum support must not break | Normative invariance: removing all groove constructs changes no bar, address, non-drum event or timing level. Grids are recognised and skipped, never read as lyrics (§11.12, §24.1). |
| 51 | Built-in styles must give identical timelines across implementations | Their grids are normative (Appendix C). Minor versions may add styles but never change one (§11.11). |
| 52 | MIDI export must be reproducible | Normative tracks, channels, tick division, tempo and meter maps, velocities and drum lengths. Only the chord track's voicing is left free (§25.5). |
| 53 | D1: earlier wording implied that copyrighted songs could only be lyric-free skeletons | The format never restricts lyrics. `Rights` is a publishing declaration checked by optional `library` and `upload` profiles. `user-submitted` was added, and `skeleton` is now an optional label whose checks verify the label, not the format (§0, §5, §20.1, §22). |

---

## 28. Conformance corpus (initial cases)

Layout: `spec/corpus/valid/<feature>/<case>.tabu` with `<case>.timeline.json`, and `spec/corpus/invalid/<code>/<case>.tabu` with `<case>.diag.json`. Any implementation, including the Dart reference and any later TypeScript, Rust or Python port, MUST pass the whole corpus.

These cases come from the review and MUST exist before 0.2:

| Case | Expectation |
|---|---|
| 6/8 `\| G C \|` | valid: two dotted quarters |
| 12/8 `\| G C D Em \|` and `\| G C D \|` | valid; E103 |
| 3/4 `\| G C \|` | E103 |
| A 12-column bar under `Grid: 1/16` in 4/4 | E102 |
| A 12-column bar under `Grid: auto` | W204, timed as triplets |
| Ruler `1   a` and `1 . . a` and `1 . a` | `a` at ¾ of the beat; same; E107 |
| Ruler `1 . .` in 4/4 | W204 (triplet inferred) |
| `:\|x3--\|` inside a staff | E125 |
| Effect lane with an unknown token `PM---- palm` | W206; the line stays an effect lane |
| A barred chord line directly above a staff with no blank line | chord lane, timed by the ruler |
| A cross-line lyric pickup (`"Re[C]member`) | pickup in the previous bar |
| A line starting with the chord the previous line ended on | binds to a new event (no collapse) |
| `Title: We're #1`, `Title: 1979`, `Title: Re: Your Brains` | literal values |
| `Title: X`, a blank line, then `Key: G` | both are header keys |
| `C6/9`, `Cø7`, `Cm(maj7)`, `C7(b9,#5)` | valid chords (Appendix A) |
| A `## block` containing `@strum` | does not affect the next section |
| A release at a specific column (`7b9--r7` with `r7` under `3`) | release arrives on beat 3 |
| A release between ruler tokens | arrival interpolated (exact rational) |
| `@play Intro` after `@tempo 120`, with Intro defined at 90 | Intro plays at 90 |
| A pasted ```` ``` ```` line with no closing fence | ignored; the rest of the file parses |
| `Verse 6 < Verse 5 < Verse 1`, with `@strum` overridden in Verse 5 | Verse 6 uses Verse 5's pattern |
| The three files in `examples/` | timelines as in Appendix B |

These cases cover the owner decisions of §27.1, and MUST also exist before 0.2:

| Case | Expectation |
|---|---|
| `@drums verse` with `T\|`, `hat\|`, `rim\|`, `kick\|` lanes right-aligned with leading spaces | valid; no bars; drum events on every bar where `@groove verse` is active |
| A drum step one column right of its ruler token | E106 (strict); snapped with a warning (lenient) |
| A drum lane label misaligned by one column against `T\|` | E101 |
| `@drums verse` followed by a blank line, then a chart line | E163; lenient reads it as `@groove verse` |
| `kick\| x - x -` in a section with no `@drums` above it | E160 |
| A drum grid with an `S\|` lane | E161 |
| `snare\| - - Y -` | E162 |
| `cowbel\|` inside a drum grid; `bd\|` and `kick\|` in the same grid | W230; W231 (merged) |
| `o` on a `hat` lane and on a `snare` lane | key 46 (open hat); key 38 |
| A two-bar grid in a section of `\|: 3 bars :\|` | groove bars 1, 2, 1, 2, 1, 2 (the cycle continues through the repeat) |
| `# Chorus x2` with a two-bar groove on a three-bar chorus | the cycle restarts on the second time: 1, 2, 1, 1, 2, 1 |
| `@groove` inside a `## block`, then the next `#` section | the block's groove does not leak |
| `Verse 2 < Verse 1`, where Verse 1 has `@groove verse` and `@fill lift end` | Verse 2 has the same groove and the same fill on its last bar |
| `@fill end` in a section with `\|: :\|` | fill on the last performance bar only |
| `@fill` before a `[2/4]` bar of a 4/4 groove | the first half of the fill bar |
| A ruler pickup `\| 3 + 4 + \|` at a section start under `Groove: rock` | the last two beats of the rock bar |
| `@hold 2` on a bar with a groove | groove for 4 beats, silence for the 2 held beats |
| `Groove: rock` in 6/8 | W233; no drums |
| The same file with every groove construct deleted | identical bars, addresses, non-drum events and timing level |
| MIDI export of `Tempo: 60` in 6/8 | Set Tempo 666 667 µs per quarter; Time Signature 6/8 with 36 clocks per click |
| MIDI export of a 4/4 bar with `@hold 2` | Time Signature 6/4 for that bar, then 4/4 |
| `Rights: user-submitted` with full lyrics and tab | valid at `strict` and at `upload`; L408 at `library` |
| `Rights: skeleton` with a lyric line | valid at `strict`; L401 at `upload` (relabel it) |

---

## Appendix A. Chord symbol torture list

**Valid** (each normalises to the chord shown):

`C` `Cm` `Cmin` `C-` `Cmaj7` `CM7` `CΔ7` `CΔ` `C7` `Cm7` `C-7` `Cmmaj7` `CmM7` `Cm(maj7)` `C6` `Cm6` `C6/9` `C69` `C9` `C11` `C13` `Cmaj9` `Cmaj9#11` `Cadd9` `Cadd2` `Cmadd9` `C(add9)` `C2` `C4` `C5` `Csus` `Csus2` `Csus4` `C7sus4` `C9sus4` `Cdim` `C°` `Cdim7` `C°7` `Cø` `Cø7` `Cm7b5` `Cm7-5` `Caug` `C+` `Caug7` `C+7` `C7#5` `C7b9` `C7#9` `C7b13` `C7alt` `C7(b9,#5)` `C7(b9, #11)` `Cno3` `C/G` `D/F#` `C/B♭` `Bb` `B♭m7` `F#m7` `F#7#9` `Ebm7b5` `Abmaj7` `G@2` `G@rock` `D/F#@capo` `N.C.` `NC`

With `ChordNames: nashville`: `1` `4` `5` `6m` `b7` `4/1` `5/7` `2m7` `#4ø7`

**Invalid** (E110 in charts and chord lanes; plain text in lyric lines): `H` `Hm` `c` (lower-case root) `Cx` `C7b` `Cadd` `C/9` `C//G` `Cmaj 7` (two tokens, and `7` alone is not a chord). A line reading `Am I` is a lyric line, because `I` is not a chord.

---

## Appendix B. Example timelines

The three examples were checked against the classification, slot, ruler, onset, alignment, binding, inheritance and reference rules of this spec using a throwaway reference checker. All three report 0 errors and 0 warnings. The groove constructs in `harbor-lights-skeleton.tabu` were added after that check. They add no bars (§11.12), so the totals below stand, and the column alignment of their drum grids was checked separately. Unrolled totals:

| File | Performance bars | Beats | Length | Notable constructs |
|---|---|---|---|---|
| `examples/amazing-grace.tabu` (3/4, 84 BPM) | 64 | 193 | 2:18 | Ruler pickup `\| 3 + \|` (Intro: 1 + 12 beats); T3 binding with no warnings (Verse 1 and Verse 2's inline chords against the inherited chart); T4 with bar marks (Verse 3); solo with slides, a pre-bend whose release lands on beat 3, a pull-off, a dead note, harmonics; `@hold 3` (Outro: 3 + 6 beats). |
| `examples/scarborough-fair.tabu` (3/4, 96 BPM) | 140 | 423 | 4:24 | Pattern blocks `arp` and `pinch` with `o`/`B`/`b`; T1 lyric bars with a mid-word mark (`rose\|[G]mary`) and pickups (`"Re`, `For`); line-parallel Verses 2–8; an inheritance chain (`Verse 6 < Verse 5 < Verse 1`, where Verse 5 overrides `@strum`); `@play Intro`; `@play Intro bars=1-3` plus `@hold 3` (Outro: 9 + 6 beats). |
| `examples/harbor-lights-skeleton.tabu` (4/4, 96 BPM) | 94 | 378 | 3:56 | Optional `skeleton` label; a groove showcase (`Groove: shaker` for the Intro, `@drums` grids `verse`, a two-bar `chorus` cycle and the fills `lift`, `stop` and `ending`, built-in `halftime`, `@groove off` in the Bridge, `@fill … end`, a choke, a flam, a groove change inside the `## Turnaround` block that does not leak); repeats with `[1`/`[2` endings (Verse: 16 performance bars); pushes `^D` and `^Dsus4`; `(D/F# Em7)` split; a `[2/4]` bar (Bridge: 34 beats); a skeleton-safe pattern block; `N.C.`; a `## Turnaround` block played by `@play … x2`; `@hold 4`. |

---

## Appendix C. Built-in groove styles

These grids are normative (§11.11). Each block is shown with the `@time` its variant serves, and the variants of one style are alternatives, not duplicate definitions. The reference implementation ships them as data (`spec/grooves/builtin.tabu`). The `fill` grids are the bars that `@fill` with no name plays (§11.10). Built-in grids have no source span, so their drum events carry `"span": null`.

**`rock`, 4/4**

```tabu
@time 4/4
@drums rock
    T| 1 + 2 + 3 + 4 + |
  hat| x x x x x x x x |
snare| - - x - - - x - |
 kick| x - - - x x - - |
```

**`rock`, 12/8**

```tabu
@time 12/8
@drums rock
    T| 1 + a 2 + a 3 + a 4 + a |
  hat| x x x x x x x x x x x x |
snare| - - - x - - - - - x - - |
 kick| x - - - - - x - - - - - |
```

**`halftime`, 4/4**

```tabu
@time 4/4
@drums halftime
    T| 1 + 2 + 3 + 4 + |
  hat| x x x x x x x x |
snare| - - - - x - - - |
 kick| x - - - - - - x |
```

**`disco`, 4/4**

```tabu
@time 4/4
@drums disco
    T| 1 + 2 + 3 + 4 + |
  hat| x o x o x o x o |
snare| - - x - - - x - |
 kick| x - x - x - x - |
```

**`shuffle`, 4/4**

```tabu
@time 4/4
@drums shuffle
    T| 1 trip let 2 trip let 3 trip let 4 trip let |
  hat| x -    x   x -    x   x -    x   x -    x   |
snare| - -    -   x -    -   - -    -   x -    -   |
 kick| x -    -   - -    -   x -    -   - -    -   |
```

**`shuffle`, 12/8**

```tabu
@time 12/8
@drums shuffle
    T| 1 + a 2 + a 3 + a 4 + a |
  hat| x - x x - x x - x x - x |
snare| - - - x - - - - - x - - |
 kick| x - - - - - x - - - - - |
```

**`train`, 4/4**

```tabu
@time 4/4
@drums train
    T| 1 e + a 2 e + a 3 e + a 4 e + a |
snare| g g g g X g g g g g g g X g g g |
 kick| x - - - - - - - x - - - - - - - |
```

**`waltz`, 3/4**

```tabu
@time 3/4
@drums waltz
   T| 1 + 2 + 3 + |
 rim| - - x - x - |
kick| x - - - - - |
```

**`ballad`, 4/4**

```tabu
@time 4/4
@drums ballad
   T| 1 + 2 + 3 + 4 + |
 hat| g g g g g g g g |
 rim| - - x - - - x - |
kick| x - - - - - - - |
```

**`ballad`, 6/8**

```tabu
@time 6/8
@drums ballad
   T| 1 + a 2 + a |
 hat| g g g g g g |
 rim| - - - x - - |
kick| x - - - - - |
```

**`ballad`, 12/8**

```tabu
@time 12/8
@drums ballad
   T| 1 + a 2 + a 3 + a 4 + a |
 hat| g g g g g g g g g g g g |
 rim| - - - x - - - - - x - - |
kick| x - - - - - x - - - - - |
```

**`bossa`, 4/4**

```tabu
@time 4/4
@drums bossa
   T| 1 + 2 + 3 + 4 + | 1 + 2 + 3 + 4 + |
 hat| x x x x x x x x | x x x x x x x x |
 rim| x - - x - - x - | - - x - - x - - |
kick| x - - x x - - x | x - - x x - - x |
```

**`onedrop`, 4/4**

```tabu
@time 4/4
@drums onedrop
   T| 1 + 2 + 3 + 4 + |
 hat| x x x x x x x x |
 rim| - - - - x - - - |
kick| - - - - x - - - |
```

**`shaker`, 4/4**

```tabu
@time 4/4
@drums shaker
     T| 1 + 2 + 3 + 4 + |
shaker| X x X x X x X x |
  kick| g - - - - - - - |
```

**`shaker`, 3/4**

```tabu
@time 3/4
@drums shaker
     T| 1 + 2 + 3 + |
shaker| X x X x X x |
  kick| g - - - - - |
```

**`shaker`, 6/8**

```tabu
@time 6/8
@drums shaker
     T| 1 + a 2 + a |
shaker| X x x X x x |
  kick| g - - - - - |
```

**`fill`, 4/4**

```tabu
@time 4/4
@drums fill
    T| 1 e + a 2 e + a 3 e + a 4 e + a |
  hat| x - x - x - x - - - - - - - - - |
snare| - - - - x - - - x x x x - - - - |
 tom1| - - - - - - - - - - - - x x - - |
floor| - - - - - - - - - - - - - - x x |
 kick| x - - - - - - - x - - - - - - - |
```

**`fill`, 3/4**

```tabu
@time 3/4
@drums fill
    T| 1 e + a 2 e + a 3 e + a |
  hat| x - x - - - - - - - - - |
snare| - - - - x x x x - - - - |
 tom1| - - - - - - - - x x - - |
floor| - - - - - - - - - - x x |
 kick| x - - - - - - - x - - - |
```

**`fill`, 6/8**

```tabu
@time 6/8
@drums fill
    T| 1 + a 2 + a |
  hat| x x x - - - |
snare| - - - x - - |
 tom1| - - - - x - |
floor| - - - - - x |
 kick| x - - - - - |
```

**`fill`, 12/8**

```tabu
@time 12/8
@drums fill
    T| 1 + a 2 + a 3 + a 4 + a |
  hat| x x x x x x x x x - - - |
snare| - - - x - - - - - x - - |
 tom1| - - - - - - - - - - x - |
floor| - - - - - - - - - - - x |
 kick| x - - - - - x - - - - - |
```
