Got Scales?
Got Scales? is a simple Javascript module that allows you to create music scales and chords.
Install
> npm install got-scales --save-dev
gotScales.note(name)
Creates a new note
instance.
name - The name of the note. Can contain sharps and flats 'C', 'C#', 'Cb'.
Methods
get()
Returns the note string
passed to the note() method.
scale(formula, [,forceFormula])
Creates a scale
instance using the note
passed.
gotScales.scale(formula, [,forceFormula])
Creates a scale
instance with one of the pre-defined formulas found in scaleFormulas.es6
.
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
.
Methods
get(int)
Return a specific note in the scale.
getNotes()
Return an array
of notes in the scale instance.
Usage
// How to usevar gMajorScale = gotScalesvar aCustomScale = gotScales console // ['G','A','B','C','D','E','F# / Gb','G']console // [ 'A', 'C', 'E', 'G', 'G# / Ab' ] // Chordsvar cMajorChord = gotScales // Can be 'C' or 'CMaj'var aMinorChord = gotScales // Can be 'Am' or 'Amin'console) // ['C','E','G']console) // ['A','C','E']