danigb / music.scale.dictionary

A dictionary of music scales
MIT License
1 stars 0 forks source link

music.scale.dictionary

Build Status Code Climate js-standard-style npm version license music.kit

A dictionary of music scales:

var scale = require('music.scale.dictionary')
scale.get('phrygian') // => [ '1P', '2m', '3m', '4P', '5P', '6m', '7m' ]
scale.get('Db phrygian') // => [ 'Db', 'Ebb', 'Fb', 'Gb', 'Ab', 'Bbb', 'Cb' ]
scale.get('Eb4 phrygian') // => [ 'Eb4', 'Fb4', 'Gb4', 'Ab4', 'Bb4', 'Cb5', 'Db5' ]

This is part of music.kit

Features

 Install

Via npm: npm i --save music.scale.dictionary or grab the file (10kb minified) from dist folder.

Usage

Create scales using a scale name

The simplest usage is creating a scale from a name with tonic:

scale.get('F altered') // => [ 'F', 'Gb', 'Ab', 'A', 'Cb', 'Db', 'Eb' ]
scale.get('Gb enigmatic') // => [ 'Gb', 'Abb', 'Bb', 'Dbb', 'Ebb', 'Fb', 'F' ]

Get scale intervals

You can get scale intervals if you don't specify the tonic:

scale.get('bebop') // => [ '1P', '2M', '3M', '4P', '5P', '6M', '7m', '7M' ]

Get scale names

Use the names function to get scale names. Passing true as first argument return scale aliases names too:

scale.names() // => ['major', ...] (89 names)
scale.names(true) // => ['major', ...] (108 names)

Find scale name

The find function get the scale name from a list of notes. All the notes of the scale must be inside the list and the first note of the list is considered the tonic:

scale.find('c g a b e f b5 d') // => 'major'
scale.find('d c g a b e f b5 d') // => 'dorian'

License

MIT License