5.1.1 • Published 5 months ago
@tonaljs/chord-type v5.1.1
@tonaljs/chord-type

A dictionary of musical chords.
Usage
ES6:
import { ChordType } from "tonal";
node:
const { ChordType } = require("tonal");
API
ChordType.get(name: string) => object
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
// });
ChordType.names() => string[]
List all chord type (long) names in the dictionary
ChordType.symbols() => string[]
List all chord type (long) names in the dictionary
ChordType.all() => object[]
Return a list of all available chord types.
ChordType.add(intervals: string[], names: string[], fullName?: string) => ChordType
Add a chord type to dictionary:
add(["1P", "3M", "5P"], ["M"], "mayor");
HOW TO
How to get triad chord names?
ChordType.all()
.filter((get) => get.length === 3)
.map((get) => get.name);
How to add a chord type to the dictionary?
ChordType.add(["1P", "3M", "5P"], ["M", "may"], "mayor");
ChordType.get("mayor"); // => { name: 'mayor', quality: "Major", chroma: ... }
ChordType.get("may"); // => { name: 'mayor', quality: "Major", chroma: ... }
5.1.1
5 months ago
5.1.0
10 months ago
5.0.5
1 year ago
5.0.4
1 year ago
5.0.3
1 year ago
5.0.2
1 year ago
5.0.1
1 year ago
5.0.0
2 years ago
4.8.2
2 years ago
4.8.1
2 years ago
4.7.2
2 years ago
4.8.0
2 years ago
4.7.1
2 years ago
4.7.3
2 years ago
4.7.0
2 years ago
4.6.10
3 years ago
4.6.5
4 years ago
4.6.2
4 years ago
4.5.1
5 years ago
4.5.0
5 years ago
3.7.0
5 years ago
3.6.1
5 years ago
3.6.0
5 years ago
3.5.6
5 years ago
3.5.5
5 years ago
3.5.4
5 years ago
3.5.3
5 years ago
3.5.2
5 years ago
3.5.1
5 years ago
3.5.0
5 years ago