Skip to content

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

Notifications You must be signed in to change notification settings

mmckegg/midi-grabber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

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

Resources

Stars

Watchers

Forks

Packages