1.0.2 • Published 8 years ago
note-midi v1.0.2
note-midi
note-midi
is a tiny function (1kb minified) to get the midi number from a note name:
var midi = require('note-midi')
midi('A4') // => 69
midi('c2') // => 36
This is part of tonal
Installation
Install via npm: npm install --save note-midi
or use add the dist file to the html page.
API
midi
Get the midi number of a note
The note can be an string in scientific notation or array pitch notation
Parameters
note
String or Array
the note in string or array notation
Examples
midi('A4') // => 69
midi('a3') // => 57
midi([0, 2]) // => 36 (C2 in array notation)
Returns Integer
the midi number
Generated documentation here
License
MIT License