Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

midievents

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

midievents

Decode/encode MIDI events.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80
increased by26.98%
Maintainers
1
Weekly downloads
 
Created
Source

MIDIEvents Build Status

MIDIEvents is a helper intended to help working with MIDI events. MIDIEvents is the base project for MIDIFile and MIDIPlayer.

MIDIEvents can be used either in modern browsers (pick the last bundle) or with NodeJS by installing the following NPM module :

npm install midievents

What it does

  • Decode midi events
  • Check midi events (using strictMode)
  • Calculate needed buffer to encode midi events
  • Encode midi events

What it doesn't do

Usage

// Your variable with an ArrayBuffer instance containing your MIDI events
var anyBuffer;

// MIDI events parser
var event, events=[], parser;
parser=new MIDIEvents.createParser(
  new DataView(anyBuffer),
    0, false);
event=parser.next();
do {
  events.push(event);
  event=parser.next();
} while(event);

// Check bufffer size before encodng
if(anyBuffer.length >= MIDIEvents.getRequiredBufferLength(events)) {
  console.log('ok');
}

// Encode MIDI events
var destination = new Uint8Array(anyBuffer);
MIDIEvents.writeToTrack(events, destination);

Contributing / Testing

Install them and run the following command :

npm install --dev
su npm install grunt-cli -g
grunt test

Contributing

  • Feel free to PR
  • If you find MIDI events the library can't read, create a test an do a pull request. I'll work on it asap.

License

Copyright Nicolas Froidure 2013. MIT licence.

Keywords

FAQs

Package last updated on 15 Dec 2013

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