https://github.com/danigb/music.scale.dictionary
A dictionary of music scales
https://github.com/danigb/music.scale.dictionary
Last synced: 9 months ago
JSON representation
A dictionary of music scales
- Host: GitHub
- URL: https://github.com/danigb/music.scale.dictionary
- Owner: danigb
- License: mit
- Created: 2015-10-25T09:42:46.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-03T10:07:43.000Z (over 10 years ago)
- Last Synced: 2025-05-17T18:08:28.645Z (about 1 year ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
# music.scale.dictionary
[](https://travis-ci.org/danigb/music.scale.dictionary)
[](https://codeclimate.com/github/danigb/music.scale.dictionary)
[](https://github.com/feross/standard)
[](https://www.npmjs.com/package/music.scale.dictionary)
[](https://www.npmjs.com/package/music.scale.dictionary)
[](https://www.npmjs.com/package/music.kit)
A dictionary of music scales:
```js
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](https://www.npmjs.com/package/music.kit)
## Features
- Build scales from names
- Get scale intervals
- Get all available names
- Find scale name by notes
## Install
Via npm: `npm i --save music.scale.dictionary` or grab the file (10kb minified) from [dist](https://raw.githubusercontent.com/danigb/music.scale.dictionary/master/dist/music.scale.dictionary.min.js) folder.
## Usage
#### Create scales using a scale name
The simplest usage is creating a scale from a name with tonic:
```js
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:
```js
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:
```js
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:
```js
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