Normalise
Respell chords to match key signatures and canonical enharmonic conventions.
Functions
normaliseSection
normaliseSection(chords: Chord[], config?: DetectKeyConfig, declaredKey?: string | null): { chords: Chord[]; homeKey: string | null }
Re-spell a flat chord array for a single section. Returns the corrected chords and the inferred home key.
normaliseSong
normaliseSong(song: Song, config?: DetectKeyConfig): Song
Re-spell chord roots across every section to match inferred key signatures and canonical enharmonic conventions. Runs harmonic analysis internally to determine the home key of each section. Returns a new `Song`; does not mutate.