0.69.7 • Published 7 years ago

tonal-midi v0.69.7

Weekly downloads
261
License
MIT
Repository
github
Last release
7 years ago

tonal-midi npm version

tonal

tonal-midi is a collection of functions to convert between midi numbers and note names.

This is part of tonal music theory library.

You can install via npm: npm i --save tonal-midi

API Reference

isMidiNum(num) ⇒ Boolean

Test if the given number is a valid midi note number

Kind: global function
Returns: Boolean - true if it's a valid midi note number

ParamTypeDescription
numObjectthe thing to be tested

toMidi(pitch) ⇒ Integer

Get midi number for a pitch

Kind: global function
Returns: Integer - the midi number or null if not valid pitch

ParamTypeDescription
pitchArray | Stringthe pitch

Example

midi('C4') // => 60

fromMidi(midi) ⇒ String

Given a midi number, returns a note name. The altered notes will have flats.

Kind: global function
Returns: String - the note name

ParamTypeDescription
midiIntegerthe midi note number

Example

tonal.fromMidi(61) // => 'Db4'

fromMidiS(midi) ⇒ String

Given a midi number, returns a note name. The altered notes will have sharps.

Kind: global function
Returns: String - the note name

ParamTypeDescription
midiIntegerthe midi note number

Example

tonal.fromMidiS(61) // => 'C#4'
0.69.7

7 years ago

0.69.6

7 years ago

0.69.5

7 years ago

0.69.4

7 years ago

0.69.3

7 years ago

0.69.2

7 years ago

0.69.0

7 years ago

0.68.1

7 years ago

0.68.0

7 years ago

0.66.0

7 years ago

0.62.0

7 years ago

0.61.0

7 years ago

0.60.0

7 years ago

0.50.7

8 years ago

0.50.6

8 years ago

0.50.0

8 years ago

0.50.5

8 years ago

0.50.4

8 years ago

0.50.2

8 years ago

0.50.1

8 years ago