A dictionary of musical chords.
ES6:
import { ChordType } from "tonal";
node:
const { ChordType } = require("tonal");
Given a chord type name, return an object with the following properties:
- name: the chord type name
- aliases: a list of alternative names
- quality: Major | Minor | Augmented | Diminished | Unknown
- num: the pcset number
- chroma: the pcset chroma
- length: the number of notes
- intervals: the interval list
Example:
ChordType.get("major"); // =>
// {
// name: "major",
// aliases: ["M", ""],
// quality: "Major",
// intervals: ["1P", "3M", "5P"],
// num: 2192,
// chroma: "100010010000",
// length: 3
// });
List all chord type (long) names in the dictionary
List all chord type (long) names in the dictionary
Return a list of all available chord types.
Add a chord type to dictionary:
add(["1P", "3M", "5P"], ["M"], "mayor");
ChordType.all()
.filter((get) => get.length === 3)
.map((get) => get.name);
ChordType.add(["1P", "3M", "5P"], ["M", "may"], "mayor");
ChordType.get("mayor"); // => { name: 'mayor', quality: "Major", chroma: ... }
ChordType.get("may"); // => { name: 'mayor', quality: "Major", chroma: ... }