Releases: patrady/chord-js
v2.2.0
Removing Extraneous Notes
If a chord has notes that are outside of the chord, those notes will be disregarded and the chord will still be recognized!
For example, since the A1
is far enough from the rest of the chord, it will be ignored.
Before:
Chord.for("A1 C E G").getName(); // undefined
After:
Chord.for("A1 C E G").getName(); // C
Recognizing Multiple Chords
If multiple chords are given, then only the first one will be recognized
Before:
Chord.for("D2 F#2 A2 C E G").getName(); // undefined
After:
Chord.for("D2 F#2 A2 C E G").getName(); // D
v2.1.0
Lots of new features in this release 🚀
New Chords
Several new chords can be recognized now:
- Sixth Chords
- Minor Sixth Chords
- Major Minor Seventh Chords
- Augmented Seventh Chords
- Augmented Major Seventh Chords
Double Flats and Double Sharps
Send those obscure double flat or double sharp notes along and they'll now be recognized!
Example:
Chord.for('D# F𝄪 A# C𝄪5')?.getName(); // D#maj7
Chord.for('C Eb Gb B𝄫')?.getName(); // Cdim7
v2.0.0
New Features
Recognize chords that are out of order
Before if the notes of a chord were passed out of order, the chord could not be recognized.
For example, the C chord in the order of C, G, E couldn't be recognized.
Now, the order does not matter for any of types of chords because the notes are sorted by their MIDI value before the chord is identified:
// Before
Chord.for('C G E')?.getName(); // undefined
Chord.for('C G Eb')?.getName(); // undefined
Chord.for('C G Bb E')?.getName(); // undefined
// After
Chord.for('C G E')?.getName(); // C
Chord.for('C G Eb')?.getName(); // Cm
Chord.for('C G Bb E')?.getName(); // C7
Breaking Changes
Since the notes are sorted by their MIDI value before the chord is identified, it is possible for some inverted chords to be now identified without the inversion. For example,
// Before
new Chord.for('E G C')?.getName(); // C/E
// After
new Chord.for('E G C')?.getName(); // C because the C note is assumed to be C4 instead of C5
It is now considered a best practice to specify the note with its octave when using strings.
// Before
new Chord.for('E G C')?.getName(); // C/E
// After
new Chord.for('E G C5')?.getName(); // C/E
v1.4.0
v1.3.0
Adds support for recognizing Half Diminished Seventh Chords
Special thanks to @danielparvin for the contribution!