npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

midi-help

v1.0.0

Published

Companion to npm midi package

Downloads

40

Readme

midi-help

Companion to npm midi package

Getting Started

Install the module with: $ npm install midi-help

Sending MIDI

var help = require('midi-help');
var midi = require('midi');
var output = new midi.output();

output.openPort(0);
output.sendMessage(help.noteOn(60, 127)); // note=50, vel=127, channel=0
output.sendMessage(help.noteOff(53, 80, 3)); // note=53, vel=80, channel=3
output.sendMessage(help.pitchBend(8192, 0)); // pitchbend centered, channel=0
output.sendMessage(help.cc(123, 0)); // all notes off/continuous control 123

Listening for MIDI

input = new midi.input();
parser = new help.MidiParser();

input.on('message', function(deltaTime, message) {
  parser.parseArray(message);
});

console.log('Opening port:', input.getPortName(0));
input.openPort(0);

parser.on('noteOn', function(note, velocity, channel){
  console.log('noteOn:', note, velocity, channel);
});

parser.on('noteOff', function(note, velocity, channel){
  console.log('noteOff:', note, velocity, channel);
});
// parser.on 'pitchBend', 'cc', 'clock', etc...

Documentation

These midi message types will be emitted as events:

  • noteOn
  • noteOff
  • pitchBend
  • cc
  • clock
  • start
  • songPosition
  • channelPressure

Use these messages for input and output. See examples above for more detail.

// input
parser.on('clock', function(){
  console.log('24 of these per quarter note :P');
});

// output
var pressure = 127;
var channel = 0
output.sendMessage(help.channelPressure(pressure, channel));

Notes

Unsupported messages are ignored. SysEx is currently broken (by default, the npm midi module suppresses SysEx messages).

There is no input checking -- if you use crazy values like help.noteOn(240) you will get invalid or incorrect midi messages.

Contributing

Adding new midi types is super easy -- just one line of code gets you input and output events and types. See src/lib/midi-help.js for details.

Release History

  • 1.0.0 rewrite, converting to coffeescript to modern node.js. Untested in the browser.
  • 0.2.0 Add 'stop' and 'continue' midi message support
  • 0.1.5 Remove unused dependency on npm midi
  • 0.1.3 Fis bug introduced after renaming MidiParser
  • 0.1.1 Add this handy README
  • 0.1.0 initial

License

Copyright (c) 2013 Charles Holbrow
Licensed under the MIT license.