New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tonal-midi

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tonal-midi

Conversion between midi numbers and note names

  • 0.69.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
74
increased by19.35%
Maintainers
1
Weekly downloads
 
Created
Source

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

toMidi(pitch)Integer

Get midi number for a pitch

fromMidi(midi)String

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

fromMidiS(midi)String

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

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'

Keywords

FAQs

Package last updated on 08 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc