chord-type
Get the type of the chord (can be 'M', 'm', '7' or 'o' to represent major, minor, dominant and diminished respectively)
It assumes that the chord is not inverted (first note is always the tonic)
It detects major, minor, augmented, diminished and dominant chords. All chord notes beyond the 5th (except 7th for dominant chords) are ignored
Parameters
chord
Array
the chord notes
Examples
var chord = chordtype'C E G' // => 'M'chordtype'C Eb G' // => 'm'chordtype'C Eb Gb' // => 'dim'chordtype'C E G#' // => 'aug'chordtype'C E G B' // => 'M'chordtype'C E G B7' // => '7'
Returns String
the chord type ('M', 'm', '7', 'dim', 'aug' or null)
Install
Via npm: npm i --save chord-type
License
MIT License