Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
midi-message-parser
Advanced tools
Parse MIDI data into JSON and back again.
This library is for you if:
import { MidiMessage } from 'midi-message-parser';
const rawMidiData = [144, 60, 64]; // <-- imagine this came from a midi device.
const timestamp = 740; // <-- timestamp that came along with midi data.
// Take raw midi info (from node-midi, browser midi events, etc.)
// and parse it into something easier to understand.
const message = new MidiMessage(rawMidiData, timestamp);
// Message is a simple object describing the midi message.
console.log(message.type); // 'noteon'
console.log(message.channel); // 0
console.log(message.number); // 60 (the key pressed)
console.log(message.value); // 64 (the velocity)
console.log(message.timestamp); // 740
console.log(message.ccMode); // false (something like 'monoon' for channel mode messages)
// You can also construct one from a browser MidiMessageEvent
const message2 = new MidiMessage(midiMessageEvent);
// Or create one manually.
const message3 = new MidiMessage(
'noteon',
64, // note number
60, // velocity
2, // channel
0, // timestamp
);
// You can convert a midi message back into raw midi data to send.
const outputMidiData = message.toMidiArray();
console.log(outputMidiData); // [144, 60, 64]
If this library doesn't fit the bill, try one of these...
FAQs
Parse MIDI data into JSON and back again.
The npm package midi-message-parser receives a total of 2 weekly downloads. As such, midi-message-parser popularity was classified as not popular.
We found that midi-message-parser 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.