Skip to content

danigb/note.midi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

note.midi

Build Status Test Coverage Climate js-standard-style npm version license tonal

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

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

About

Get the midi number of a note

Resources

License

Stars

Watchers

Forks

Packages

No packages published