JSPM

midi-grabber

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q33439F
  • License MIT

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

Package Exports

  • midi-grabber

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (midi-grabber) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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