tonal-scale
tonal-scale
is a collection of functions to create and manipulate music scales.
This is part of tonal music theory library.
You can install via npm: npm i --save tonal-scale
API Reference
- build(source, tonic) ⇒
Array
Create scales by scale type or intervals and tonic. The returned scale is an
array of notes (or intervals if you specify false
as tonic)
This function is currified
- names(aliases) ⇒
Array
Return the available scale names
- get(name) ⇒
Array
Get scale notes from scale name
build(source, tonic) ⇒ Array
Create scales by scale type or intervals and tonic. The returned scale is an
array of notes (or intervals if you specify false
as tonic)
This function is currified
Kind: global function
Returns: Array
- the scale notes
Param | Type | Description |
---|
source | String | the scale type, intervals or notes |
tonic | String | the scale tonic (or false to get intervals) |
Example
var scale = require('tonal.scale')
scale.create('maj7', 'C2')
scale.create('maj7', false)
const maj7 = scale.create('maj7')
maj7('C')
scale.create('1 3 5 m7 m9', 'C')
names(aliases) ⇒ Array
Return the available scale names
Kind: global function
Returns: Array
- the scale names
Param | Type | Description |
---|
aliases | boolean | true to include aliases |
Example
scaleNames()
get(name) ⇒ Array
Get scale notes from scale name
Kind: global function
Returns: Array
- the scale notes
Param | Type | Description |
---|
name | String | the scale name |
Example
var scale = require('tonal-scale')
scale.get('C7')
scale.get('CMaj7')