API Reference
Auto-generated reference for every public module exported from the grigson package. Pages are built from TypeDoc output at Eleventy build time.
-
Parser
— Parse .chart source strings into typed song trees.
parseBar, parseChord, parseFrontMatter, parseRow, parseSong -
Transpose
— Shift chord roots by semitone interval with correct enharmonic spelling.
transposeSection, transposeSong, transposeSongToKey -
Normalise
— Respell chords to match key signatures and canonical enharmonic conventions.
normaliseSection, normaliseSong -
Keys
— Key lookup, mode detection, diatonic note sets, and sibling mode utilities.
diatonicNotes, getKeyMode, getKeyRoot, getRelativeMajor, getSiblingModes, resolveKey -
Key Detection
— Infer the tonic key from a chord sequence.
detectKey -
Pitch Class
— Map note names to integer pitch classes (0–11) and enharmonic pairs.
rootToPitchClass -
Harmonic Analysis
— Annotate chord sequences with inferred local keys and circle-of-fifths distances.
analyseHarmony, analyseSong, circleOfFifthsDistance - Text Renderer — Render a parsed song to plain-text or ASCII chord charts.
-
HTML Renderer
— Render a parsed song to semantic HTML with aria labels and grid layout.
chordAriaLabel, reflowSong -
Renderer CSS
— Generate stylesheet and font-face declarations for the HTML renderer.
getRendererFontFaceCSS, getRendererStyles -
Notation Presets
— Register and resolve notation presets that control how chord qualities are rendered.
definePreset, resolvePreset -
Validator
— Produce structured diagnostics from a .chart source string.
validate - Events — Custom events dispatched by the <grigson-chart> custom element.