4.8.5 • Published 3 months ago
@tonaljs/scale-type v4.8.5
@tonaljs/scale-type
@tonaljs/scale-type
is a dictionary of musical scales.
Usage
ES6:
import { ScaleType } from "tonal";
nodejs:
const { ScaleType } = require("tonal");
API
get(name: string) => ScaleType
Given a scale type name, return a ScaleType object with the following properties:
- name: the scale 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:
ScaleType.get("major"); // =>
// {
// name: "major",
// aliases: ["ionian"],
// num: 2773,
// chroma: "101011010101",
// length: 7
// intervals: ["1P", "2M", "3M", "4P", "5P", "6M", "7M"],
// });
names() => string[]
Return a list of all scale names
all() => object[]
Return a list of all scale types
add(intervals: string[], name?: string, aliases?: string[]) => ScaleType
Add a scale type to dictionary:
ScaleType.add(["1P", "5P"], null, ["5"]);
HOW TO
How to get all pentatonics names?
ScaleType.all()
.filter((scaleType) => scaleType.intervals.length === 5)
.map((scaleType) => scaleType.name);
How do to add a scale to the dictionary?
ScaleType.add(["1P", "5P"], "quinta", ["quinta justa", "diapente"]);
ScaleType.scale("quinta"); // => { name: "quinta", intervals: ...}
ScaleType.scale("quinta justa"); // => { name: "quinta", intervals: ... }
References
Some sources explaining various scale systems:
4.8.5
3 months ago
4.8.4
3 months ago
4.8.3
4 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.3
3 years ago
4.6.5
3 years ago
4.6.4
3 years ago
4.6.2
3 years ago
4.5.1
3 years ago
4.5.0
3 years ago
3.6.0
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