Returns song lines, skipping leading empty/meta-only lines.
Returns song paragraphs, skipping paragraphs with only empty lines.
The body paragraphs 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.
No longer used internally; use bodyParagraphs or expandedBodyParagraphs.
No longer used internally. See renderParagraphs.
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(s) set to the specified value(s).
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
Returns a deep clone of the song
Returns a copy of the song with the capo eliminated, like ChordPro's decapo setting. It changes:
key directive, to the sounding keycapo in metadata and any existing capo directive, which are removedThe song is returned unchanged when it has no usable capo, or when any of its keys cannot be parsed.
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.
Optionalcontext: 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
OptionalnormalizeSuffix?: 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
Optionaloptions: { accidental?: Accidental | null; normalizeChordSuffix?: boolean } = {}
options
Optionalaccidental?: Accidental | nullOptionalnormalizeChordSuffix?: booleanwhether to normalize the chord suffixes after transposing
The transposed song
Transposes the song down by one semitone. It will:
key directiveOptionaloptions: { normalizeChordSuffix?: boolean } = {}
options
OptionalnormalizeChordSuffix?: booleanwhether to normalize the chord suffixes after transposing
The transposed song
Transposes the song up by one semitone. It will:
key directiveOptionaloptions: { normalizeChordSuffix?: boolean } = {}
options
OptionalnormalizeChordSuffix?: booleanwhether to normalize the chord suffixes after transposing
The transposed song
Returns a copy of the song with all chords changed to the specified accidental.
Examples:
song.useAccidental('#');
song.useAccidental('b');
the new accidental
the changed song
Represents a song in a chord sheet. Currently a chord sheet can only have one song.