node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป

a midi library for the web browser built on nodejs.


$ npm install

example app contained for reference.

use is a connect middleware. it requires a instance as it's first argument.

var connect = require('connect'),
	socketio = require(''),
	midi = require('');

var server = connect.createServer(),
	io = socketio.listen(server);


the server above will create the following resources:

GET /midi/devices - show all midi devices
GET /midi/devices/:id - get a specific midi device by port number
WS /midi/devices/:id - creates a websocket subscription to midi events from a specific device

client library

a backbone client library is also provided. it creates two classes:

MidiDevice - this is a backbone model which emits midi events
MidiDevices - this is a collection to manage multiple devices

<script src="/"></script>

	var devices = new MidiDevices();

	// show all midi devices
		success: function() {
			console.log('found devices', devices.models);

	// tie a midi event to a specific function
	devices.learn(function() {
		console.log('the next midi button pressed will always log me!');

	// log all midi events for all devices
	devices.on('midi', function(msg) {
		console.log('got midi', msg);