https://github.com/danigb/music.interval.name
Convert from array interval notation to short name interval notation
https://github.com/danigb/music.interval.name
Last synced: 5 months ago
JSON representation
Convert from array interval notation to short name interval notation
- Host: GitHub
- URL: https://github.com/danigb/music.interval.name
- Owner: danigb
- License: mit
- Created: 2015-11-03T10:55:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-03T13:13:12.000Z (over 9 years ago)
- Last Synced: 2024-12-27T11:34:51.989Z (6 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# music.interval.name
[](https://travis-ci.org/danigb/music.interval.name)
[](https://codeclimate.com/github/danigb/music.interval.name/coverage)
[](https://codeclimate.com/github/danigb/music.interval.name)
[](https://github.com/feross/standard)
[](https://www.npmjs.com/package/music.interval.name)
[](https://www.npmjs.com/package/music.interval.name)
[](https://www.npmjs.com/package/music.kit)A tiny (658 bytes minified) function to convert from [array interval notation](https://github.com/danigb/music.array.notation) to [shorthand interval notation](https://en.wikipedia.org/wiki/Interval_(music)#Shorthand_notation)
```js
var name = require('music.interval.name')
name([0, 0, 0]) // => '1P'
name([0, 0, 1]) // => '8P'
name([0, 0, 2]) // => '15P'
name([1, 1, 0]) // => '2A'
```The returned string has the form: `number + quality` where:
- [number](https://en.wikipedia.org/wiki/Interval_(music)#Number): the interval number. Positive means ascending interval, negative descending interval. Can't be 0.
- [quality](https://en.wikipedia.org/wiki/Interval_(music)#Quality): one or more letters of 'd', 'm', 'P', 'M', 'A' (dimished, minor, perfect, major, augmented)To convert in the opposite direction see [music.interval.name.parse](https://github.com/danigb/music.interval.name.parse)
Part of [music.kit](https://www.npmjs.com/package/music.kit)
## Install
Via npm module: `npm install --save music.interval.name`
## Documentation
Just one function, read the [generated documentation here](https://github.com/danigb/music.interval.name/blob/master/API.md)
## License
MIT License