Transpose
Shift chord roots by semitone interval with correct enharmonic spelling.
Functions
transposeSection
transposeSection(chords: Chord[], semitones: number): Chord[]
Shift each chord root by `semitones` (positive = up, negative = down) and re-normalise enharmonic spelling. Returns a new array; does not mutate input.
transposeSong
transposeSong(song: Song, semitones: number): Song
Transpose all sections of a song and update the front-matter key to the home key of the first transposed section. Returns a new `Song`; does not mutate.
transposeSongToKey
transposeSongToKey(song: Song, targetKey: string): Song
Compute the semitone interval from the detected home tonic to `targetKey` (a tonic note name, e.g. `'G'`, `'Bb'`), then call `transposeSong`. The mode of the song is preserved — only the tonic shifts. Equivalent to computing the interval yourself and calling `transposeSong(song, semitones)`.