The addChordLookup method adds a new chord shape which the findChord method is able to search through.
The ChordFinder instance is returned, to allow for chaining operations.
The name to use when refering to the shape rather than a specific instance of the chord.
For example, for a minor 7th chord, this would just be 'm7'.
The intervals that make up the chord. Where each interval is defined as the semi-tone distance from the chord root.
For example, for a major chord, this would be [0, 4, 7].
The name of the chord in expression form, where {r} is a placeholder for the chord root. For example, '{r}M7' is the expression for a major 7th chord.
The name of the chord in expression form when inversed, where {r} is a placeholder for the chord root and {b} for the chord bass. For example, '{r}M7/{b}' is the expression for a major 7th chord, when the root is not in the bass.
Where 2 chords are equally well suited, the one with higher preference will be chosen.
The findChord method gets passed in a collection of pitches and tries to find the best suggestion it can of what chord they make up.
If a matching chord is successfully found, then a ChordLookupResult instance is returned with details of the match. Otherwise the method returns null.
The currently known pitches in the chord.
Optional, the currently known chord root.
Optional, the names of the chord shapes that it's allowed to return. These must match shape names of already added chord lookups.
Optional, the scale which any notes that need to be added to the suggested chord must belong to.
Just like the findChord method, this method returns a ChordLookupResult object with details about the best chord fit it could find. However, this method performs its lookup by chord name, rather than the individual pitches that are in the chord
The name of the chord to look for
Optional
scale: ScaleThe removeChordLookup method finds a lookup that's already been added and removes it, meaning the chord finder can no longer find chords of that type.
The ChordFinder instance is returned, to allow for chaining operations.
The shape name of the chord to remove, for example 'M' or 'm7'.
The replaceChordLookup method acts the same as if you called removeChordLookup, followed by addChordLookup. This just allows you to more easily redefine existing lookups.
The ChordFinder instance is returned, to allow for chaining operations.
The name to use when refering to the shape rather than a specific instance of the chord.
For example, for a minor 7th chord, this would just be 'm7'.
The intervals that make up the chord. Where each interval is defined as the semi-tone distance from the chord root.
For example, for a major chord, this would be [0, 4, 7].
The name of the chord in expression form, where {r} is a placeholder for the chord root. For example, '{r}M7' is the expression for a major 7th chord.
The name of the chord in expression form when inversed, where {r} is a placeholder for the chord root and {b} for the chord bass. For example, '{r}M7/{b}' is the expression for a major 7th chord, when the root is not in the bass.
Where 2 chords are equally well suited, the one with higher preference will be chosen.
The withDefaultChordLookups method sets up the ChordFinder with a default collection of chord lookups that should cover most of what you might commonly use.
The ChordFinder instance is returned, to allow for chaining operations.
Generated using TypeDoc
Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.