With ES6 import
:
import { ChordDetect } from "@tonaljs/tonal";
With ES5 require
:
const { ChordDetect } = require("@tonaljs/tonal");
Standalone:
import { detect } from "@tonaljs/chord-detect";
Examples:
ChordDetect.detect(["D", "F#", "A", "C"]); // => ["D7"]
ChordDetect.detect(["F#", "A", "C", "D"]); // => ["D7/F#"]
ChordDetect.detect(["A", "C", "D", "F#"]); // => ["D7/A"]
ChordDetect.detect(["E", "G#", "B", "C#"]); // => ["E6", "C#m7/E"]
This function is also exposed in Chord
module.