JSPM

  • Created
  • Published
  • Downloads 12498
  • Score
    100M100P100Q135970F
  • License MIT

Musical scales and its relations

Package Exports

  • @tonaljs/scale

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tonaljs/scale) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@tonaljs/scale npm version

tonal

@tonaljs/scale is a collection of functions to create and manipulate musical scales

API

scale(name: string) => Scale

Get a scale from a scale name. Unlike scaleType, scale accepts tonics in the scale name and returns the scale type with two more properties: tonic and notes:

See scale-dictionary for more details.

scale("c5 pentatonic");
// =>
// {
//   empty: false,
//   name: "C5 pentatonic",
//   type: "major pentatonic",
//   tonic: "C5",
//   notes: ["C5", "D5", "E5", "G5", "A5"],
//   intervals: ["1P", "2M", "3M", "5P", "6M"],
//   aliases: ["pentatonic"],
//   setNum: 2708,
//   chroma: "101010010100",
//   normalized: "101010010100"
// }

chords(scale: string) => string[]

Get all chords that fits a given scale

Scale.chords("pentatonic");
// => ["5", "64", "M", "M6", "Madd9", "Msus2"]

extended(scale: string) => string[]

Get all scales names that are a superset of the given one (has the same notes and at least one more)

Scale.extended("major");
// => ["bebop", "bebop dominant", "bebop major", "chromatic", "ichikosucho"]

reduced(scale: string) => string[]

Find all scales names that are a subset of the given one (less notes but all from the given scale)

Scale.reduced("major");
// => ["ionian pentatonic", "major pentatonic", "ritusen"]