Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
tonal-midi
Advanced tools
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
Boolean
Test if the given number is a valid midi note number
Integer
Get midi number for a pitch
String
Given a midi number, returns a note name. The altered notes will have flats.
String
Given a midi number, returns a note name. The altered notes will have sharps.
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
Param | Type | Description |
---|---|---|
num | Object | the thing to be tested |
Integer
Get midi number for a pitch
Kind: global function
Returns: Integer
- the midi number or null if not valid pitch
Param | Type | Description |
---|---|---|
pitch | Array | String | the pitch |
Example
midi('C4') // => 60
String
Given a midi number, returns a note name. The altered notes will have flats.
Kind: global function
Returns: String
- the note name
Param | Type | Description |
---|---|---|
midi | Integer | the midi note number |
Example
tonal.fromMidi(61) // => 'Db4'
String
Given a midi number, returns a note name. The altered notes will have sharps.
Kind: global function
Returns: String
- the note name
Param | Type | Description |
---|---|---|
midi | Integer | the midi note number |
Example
tonal.fromMidiS(61) // => 'C#4'
FAQs
Conversion between midi numbers and note names
The npm package tonal-midi receives a total of 67 weekly downloads. As such, tonal-midi popularity was classified as not popular.
We found that tonal-midi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.