midi-grabber

v0.2.0
Stream midi data in and temporarily route ranges to specific callbacks.
midi filter route controller button launchpad

midi-grabber

browser support

Stream midi data in and temporarily route ranges to specific callbacks.

NPM

Example

var MidiGrabber = require('midi-grabber')
var midi = require('midi')

// set up an midi input stream
var input = midi.input()
input.openVirtualPort("Input")
var inputStream = midi.createReadStream(input)

// set up midi output stream
var output = midi.output()
input.openVirtualPort("Filtered Output")
var outputStream = midi.createWriteStream(input)

// pipe the input through grabber and back out
var grabber = MidiGrabber()
inputStream.pipe(grabber).pipe(outputStream)

// at this stage, any midi notes sent to 'Input' will pass thru to 'Filtered Output'

// Now let's grab a range of notes (say control buttons)
var release = grabber.grab([176, '104..111'], function(data){
  // do stuff with the grabbed midi
  // notes matching the filter will not be passed thru to 'Filtered Output'
  // however, if you return false, the note will still be passed through 
})

// let go of the range
release()
npm i midi-grabber

Metadata

  • MIT
  • Whatever
  • Matt McKegg
  • released 7/13/2014

Downloads

Maintainers