Scales
Work with scales
Scale properties
Scale.get
get(name: string): Scale
Get a scale from a scale name. Scale.get
accepts tonics in the scale name and returns a scale type with two more properties: tonic
and notes
:
Scale notes
Scale.degrees
degrees(scaleName: string) => (degree: number) => string
Scale.degrees
returns a function to get a note name from a scale degree:
Bear in mind that degree numbers starts with 1 and 0 returns an empty string:
Because it returns a function, it's handy to be used with map
(and similar functions):
Notice that it uses octaves if the scale tonic has an octave or pitch classes (octaveless notes) otherwise.
See Chord.degrees
See https://en.wikipedia.org/wiki/Degree_(music)
Scale.steps
steps(scaleName: string) => (degree: number) => string
Same as Scale.degree
but 0 is tonic. It plays better with ranges:
Scale.scaleNotes
scaleNotes(notes: string[]) => string[]
Given an array of notes, return an array of sorted note names starting from the first note name of the input array.
Scale.rangeOf
rangeOf(scaleName: string) => (from: string, to: string) => string[]
Scale.rangeOf
returns a function to create scale ranges:
Please note that the scale name must have tonic:
This function also works with a collection of notes:
Finding scales
Scale.names
names(): string[]
List all known scale names. Same as ScaleType.names()
See scale-type
Scale.detect
detect(notes: string[], options: { tonic?: string, match?: "fit" | "exact" }) => string[]
Find all scales that first a collection of notes with a given tonic:
You can pass an optional tonic (otherwise first note will be used):
You can ask just the exact match:
Relationships
Scale.scaleChords
scaleChords(scale: string) => string[]
Get all chords that fits a given scale:
Scale.extended
Scale.extended(scale: string) => string[]
Get all scales names that has the same notes and at least one more:
Scale.reduced
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.modes
modes(name: string) => string[][]
Find mode names (if any) of a given scale: