Got Scales? is a simple Javascript module that allows you to create music scales and chords.
https://andrewdelprete.github.io/got-scales-riotjs
https://gotscales-react-redux.surge.sh/
https://elm-gotscales.surge.sh
> npm install got-scales --save-dev
Creates a new note
instance.
name - The name of the note. Can contain sharps and flats 'C', 'C#', 'Cb'.
Returns the note string
passed to the note() method.
Creates a scale
instance using the note
passed.
Creates a scale
instance with one of the pre-defined formulas found in scaleFormulas.js
.
formula - The formula parameter can be either a string
like Cmaj7
or an array of integers [0, 3, 7]
.
forceFormula - Allows creating a custom formula if it doesn't exist in the pre-defined formulas. bool
defaults to false
.
Return a specific note in the scale.
Return an array
of notes in the scale instance.
import gotScales from 'got-scales'
// How to use
var gMajorScale = gotScales.note('G')
var aCustomScale = gotScales.note('A')
console.log(gMajorScale.scale('major').getNotes()) // ['G','A','B','C','D','E','F# / Gb','G']
console.log(aCustomScale.scale([0, 3, 7, 10, 11], true).getNotes()) // [ 'A', 'C', 'E', 'G', 'G# / Ab' ]
// Chords
var cMajorChord = gotScales.chord('Cmaj') // Can be 'C' or 'CMaj'
var aMinorChord = gotScales.chord('Am') // Can be 'Am' or 'Amin'
console.log(cMajorChord).getNotes()) // ['C','E','G']
console.log(aMinorChord).getNotes()) // ['A','C','E']