# ST4 Lyrics Standard v1.3

This is the versioned source of truth for the first ST4 lyrics preparation utility.

## Output shape

- Song title: # Song Title
- Artist: ## Artist
- Key: ## Key: G
- Section headings: ### Intro, ### Verse, ### Chorus, ### Refrain, ### Pre-Chorus, ### Bridge, ### Solo, ### Instrumental, ### Interlude, ### Outro, or ### End
- Drop section numbers: Verse 1, Verse 2 and Verse 3 each become ### Verse. Keep each occurrence; never merge repeated sections. Preserve combined labels without numbers, for example ### Verse/Outro.
- Chords: inline bracket tokens such as [G], [Am7], and [D/F#]
- Repeated sections remain repeated. No abbreviations, summaries, or omitted endings.

## Deterministic transpose contract

Transpose changes only:

1. recognized bracketed chord tokens;
2. the note in stated Key: metadata (including the standard ## Key: line).

Chord qualities remain unchanged. Slash-bass notes transpose with the chord root. Enharmonic spelling follows the target key: sharp-oriented keys use sharps and flat-oriented keys use flats.

The operation preserves every other character, including lyrics, line breaks, whitespace outside changed chord tokens, section markers, timestamps, MIDI commands, comments, and standalone final chords.

## Formatting import

The formatter produces # Title, ## Artist, ## Key: C and ### Section headings. It removes website statistics, author/difficulty/rating/capo/tuning controls and other page-header material from the output. It removes timestamps during formatting, including timestamped title/key echoes before the first section. Transpose-only preserves timestamps.

The default import omits guitar tablature and retains repeat counts such as x4. Chord-only intro/solo/instrumental rows become bracketed chords separated by single spaces, with vertical-bar separators removed. Keep the original row boundaries and repeated chords. This applies to raw and already-bracketed chord grids. Literal bars in lyrics, MIDI and comments remain unchanged. Lyrics, fade instructions, repeated sections, comments and MIDI in the body are retained.

For intact above-lyric charts, the converter uses chord columns as insertion points in the following lyric line. Blank spacer lines between a chord row and its lyric are consumed as part of the pair. Markdown emphasis is removed from chord-only rows; lyric punctuation is retained. This produces a draft for human review, not proof of musically correct alignment. Tabs in a chord/lyric pair and flattened multi-section lines are rejected rather than guessed.

The user can move chords in converted lyric lines. Validation requires unchanged literal lyric characters and unchanged chord order/qualities on each line; other draft lines remain literal. These checks run behind the scenes. Valid formatted output can be copied, downloaded or transposed immediately, without a separate approval step. The original input remains in the source editor and saved browser workspace.

## Interface

The first screen is two text boxes: Paste your chart here with Format for ST4, and ST4 output with Copy and Download. No hero, analysis cards, completeness dashboard, or mandatory review screens. Errors appear only when action is needed.

The output has a compact flat/sharp semitone control. Each click lowers or raises the key by one semitone, bounded from -7 through +7, and displays the new key. All steps use the original formatted base, so returning to zero restores that base exactly. The source key is detected from its metadata; a small key menu provides manual selection if necessary.

## Key detection

Read explicit metadata, never infer the musical key from the first chord. Support plain, ST4, Markdown, ChordPro and adjacent web fields such as Key: **C**Capo: No capo. Missing or conflicting keys require a manual source selection. Minor keys retain their mode during transposition. Changing the source must not silently change the target selection.

Chord-based suggestions rank major and minor candidates using diatonic chord qualities, harmonic-minor dominants, and dominant-to-tonic cadences. Repeated chord counts are damped so a repeated section does not dominate the result. The visible fraction is the number of compatible chord occurrences, not a probability or accuracy claim. Relative keys, borrowed chords, key changes and sparse charts can be ambiguous. Suggestions never overwrite metadata or select a source key without the user's choice. Flattened charts require restored lines before harmony analysis.

## Validation

Every prepared output is checked for:

- exact deterministic transpose or safe-cleanup result;
- unchanged non-chord text and line breaks;
- bracket-token and recognized-chord counts;
- exact section-heading sequence;
- protected MIDI, timestamp, and comment lines;
- a non-empty final line with the same non-chord shape.

The utility is local-first and AI-free for these deterministic operations.

## Version history

- v1.3: Remove section numbers and instrumental bar separators during formatting; retain every repeated section, chord, repeat count and row.
- v1.2: Two-editor, one-click formatting workflow for TraxxTool; remove mandatory approvals and diagnostic panels; add compact -7 to +7 key control.
- v1.1: User-confirmed timestamp-free formatting; Refrain and numbered sections; reviewed web-chart import; broader key-label detection, manual source selection and harmony-based key suggestions.
- v1.0: Initial ST4 headings, bracketed chords, transpose preservation and completeness checks.
