Chords
Get and manipulate chords
Chord properties
Chord.get
get(name: string) => Chord
Given a chord symbol or tokens, it returns the chord properties.
Chord properties is the the same object that ChordType.get
but with additional fields:
- symbol: the chord symbol (a combination of the tonic, chord type shortname and root, if present). For example:
Cmaj7
,Db7b5/F
. The symbol always uses pitch classes (note names without octaves) for both the tonic and root. - tonic: the tonic of the chord (or an empty string if not present)
- bass: the bass of the chord (or an empty string if not present). The bass can be any pitch class.
- root: the root of the chord (or an empty string if not present). The root is present if the bass not belongs to the chord. It could be chords with bass without root field, but not the opposite.
- rootDegree: the degree of the root. NaN if root not present. A number greater than 0 if present, where 1 indicates the tonic, 2 the second note (normally the 3th), 2 the third note (normally the 5th), etc.
- notes: an array of notes, or empty array if tonic is not present. The notes will be always pitch classes.
Example:
Chord.chord
is an alias that is handy if using the @tonaljs/chord
directly:
Chord.getChord(chordType, tonic, bass)
is very similar but with arguments for each chord part:
Chord notes
Chord.notes
notes(chordType: string, tonic?: string) => string[]
Print the notes of the given chord at the given tonic:
Chord.degrees
degrees(chordType: string, tonic?: string) => (degree: number) => string
Scale.degrees
returns a function to get a note name from a scale degree:
It can be used, for example, to get the notes of chord inversions:
Bear in mind that degree numbers starts with 1 and 0 returns an empty string:
See Scale.degrees
Chord.steps
steps(chordName: string) => (degree: number) => string
Same as Chord.degrees
but 0 is the tonic. Plays better with numeric ranges:
Finding chords
Chord.detect
detect(notes: string[]) => string[]
Given a list of notes, get the possible chord names:
Chord.transpose(chordName: string, intervalName: string) => string
Transpose a chord symbol by an interval:
Relationships
Chord.chordScales
chordScales(chordName: string) => string[]
Get all scales where the given chord fits:
Chord.extended
extended(chord: string) => string[]
Get all chords names that are a superset of the given one (has the same notes and at least one more)
Chord.reduced
reduced(chord: string) => string[]
Find all chords names that are a subset of the given one (less notes but all from the given chord)