Returns the song lines, skipping the leading empty lines (empty as in not rendering any content). This is useful if you want to skip the "header lines": the lines that only contain meta data.
The song body lines
The body paragraphs of the song, with any {chorus}
tag expanded into the targeted chorus
The song's metadata. When there is only one value for an entry, the value is a string. Else, the value is an array containing all unique values for the entry.
Returns a copy of the song with the key set to the specified key. It changes:
key
in the metadata setkey
directiveThe new key.
The changed song
Returns a copy of the song with the directive value set to the specified value.
value
is null
it will act as a delete, any directive matching name
will be removed.The directive name
The value to set, or null
to remove the directive
The changed song
Returns a copy of the song with the metadata changed. It will:
The metadata to change
The changed song
Returns all chord definitions from the song.
Definitions are made using the {chord}
or {define}
directive.
A chord definitions overrides a previous chord definition for the exact same chord.
Optional
context: FormattingContextthe chord definitions
Returns all unique chords used in the song
the chords
Change the song contents inline. Return a new Item to replace it. Return null
to remove it.
the callback function
the changed song
Returns a copy of the song with all chords normalized to the specified key. See Chord#normalize.
the key to normalize to
options
Optional
normalizeSuffix?: booleanwhether to normalize the chord suffixes
Returns a copy of the song with the key value set to the specified capo. It changes:
capo
in the metadata setcapo
directivethe capo. Passing null
will:
capo
directiveThe changed song
Returns a copy of the song with the key value set to the specified key. It changes:
key
in the metadata setkey
directivethe key. Passing null
will:
key
directiveThe changed song
Transposes the song by the specified delta. It will:
key
directiveThe number of semitones (positive or negative) to transpose with
Optional
options: { modifier?: null | Modifier; normalizeChordSuffix?: boolean } = {}options
Optional
modifier?: null | ModifierOptional
normalizeChordSuffix?: booleanwhether to normalize the chord suffixes after transposing
The transposed song
Transposes the song down by one semitone. It will:
key
directiveOptional
options: { normalizeChordSuffix?: boolean } = {}options
Optional
normalizeChordSuffix?: booleanwhether to normalize the chord suffixes after transposing
The transposed song
Transposes the song up by one semitone. It will:
key
directiveOptional
options: { normalizeChordSuffix?: boolean } = {}options
Optional
normalizeChordSuffix?: booleanwhether to normalize the chord suffixes after transposing
The transposed song
Returns a copy of the song with all chords changed to the specified modifier.
Examples:
song.useModifier('#');
song.useModifier('b');
the new modifier
the changed song
Represents a song in a chord sheet. Currently a chord sheet can only have one song.