5.0.5 • Published 3 months ago

@tonaljs/chord-type v5.0.5

Weekly downloads
448
License
MIT
Repository
-
Last release
3 months ago

@tonaljs/chord-type tonal npm version

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.0.5

3 months ago

5.0.4

3 months ago

5.0.3

4 months ago

5.0.2

5 months ago

5.0.1

5 months ago

5.0.0

11 months ago

4.8.2

11 months ago

4.8.1

1 year ago

4.7.2

1 year ago

4.8.0

1 year ago

4.7.1

1 year ago

4.7.3

1 year ago

4.7.0

1 year ago

4.6.10

1 year ago

4.6.5

3 years ago

4.6.2

3 years ago

4.5.1

3 years ago

4.5.0

3 years ago

3.7.0

3 years ago

3.6.1

4 years ago

3.6.0

4 years ago

3.5.6

4 years ago

3.5.5

4 years ago

3.5.4

4 years ago

3.5.3

4 years ago

3.5.2

4 years ago

3.5.1

4 years ago

3.5.0

4 years ago