note-interval
is a function to calculate the interval between two notes:
var interval = // => '3M'
Install
Only via npm: npm i --save note-interval
Usage
There's only one function with two params. The function can be partially applied:
var fromC = // => '3m'
Get interval between two notes (pitches)
This is the simplest use case. Can be descending intervals:
// => '4P' // => '-5P'
Get interval between two pitch classes
If one or both notes are pitch classes (no octave) an ascending interval is always returned:
// => '4P' // => '2m'
Distance between intervals
It can be used to subtract intervals:
// => '3m'
License
MIT License