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
See music.note.fromMidi for the opposite operation.
This is part of tonal
Install via npm: npm install --save note.midi
or use add the dist file to the html page.
Get the midi number of a note
The note can be an string in scientific notation or array pitch notation
note
String or Array
the note in string or array notation
midi('A4') // => 69
midi('a3') // => 57
midi([0, 2]) // => 36 (C2 in array notation)
Returns Integer
the midi number
Generated documentation here
MIT License