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

spacebrew-midi

v0.2.1

Published

Route MIDI events via Spacebrew

Downloads

14

Readme

spacebrew-midi

Route MIDI events via Spacebrew

CLI Utility Usage

The CLI utility is a quick and easy way to connect MIDI devices to the public Spacebrew admin interface.

Input ports start listening for two Note On events in the background to use as lower and upper boundaries for the range. The UI doesn't currently indicate this is occuring—sorry, bad UX! I'll get that fixed in the next version.

Output ports are currently connected for the entire C-0 through G-9 range.

WARNING: Simultaneous connections of the same type (input or output) segfaults on some platforms. Looking into the root cause...

$ npm i -g spacebrew-midi
$ spacebrew-midi

Spacebrew MIDI - Select a device to connect to Spacebrew                    
  ------------------------------------------------------------------------  
   INPUT on QUNEO:0                                                         
   INPUT on MPK mini:0                                                      
  OUTPUT on QUNEO:0 - Connected!                                            
  OUTPUT on MPK mini:0                                                      

Module Usage Example

var sbmidi = require("spacebrew-midi");

// Connect to Spacebrew, passing an onOpen handler
sbmidi.connect(function () {

  // Determine the last available port, usually the most recently connected device
  var portNumber = sbmidi.getInPortCount() - 1;

  // One octave to either side of Middle C
  sbmidi.addInputRange(portNumber, 48, 72);

  // Similar for output!
  sbmidi.addOuputRange(portNumber, 48, 72);

  // Alternatively, just pass a port number and bounds will be "learned"
  // based on the next two Note On events received
  sbmidi.addInputRange(portNumber);

});

And over in the Admin interface you'll see:

Screenshot of Spacebrew Admin running example code

By default this will create a connection to the public Spacebrew Admin interface.

To connect to another server: sbmidi.connect({ server: "http://localhost/" })

To use a different name and description: sbmidi.connect({ name: "Bob", description: "Bob's MIDI Controller" })

CHANGELOG

v0.2.0

  • Added CLI utility
  • Added support for connecting multiple ports simultaneously (still has issues)
  • Added input range addition via "learning" from MIDI Note On events

v0.1.1

  • Added MIDI output support

TODO

  • Support more MIDI messages than just note on/off
  • Use Spacebrew custom messages for sending complex CC messages (knobs, sliders, etc.)
  • Publish MIDI helper library separately
  • Add CLI option parsing for non-interactive routing
  • JSON based config files to support building a device map library (think spacebrew-midi --device QuNeo)
  • Web interface to complement CLI for adding/editing routed messages
  • Handle closing things down (onClose handler to close MIDI ports, etc.)
  • Refactor so a range can be added on an already open port

LICENSE

MIT