1.0.0 • Published 9 years ago

web-midi-note-stream v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

web-midi-note-stream

Takes in a stream of midi events and outputs objects with note/frequency information

Uses this table to decode notes.

Expects a web-midi stream to be piped into it, or chunks of arrays with [status, note, velocity].

Outputs an objects that looks like

{
	pressed: Boolean, // Whether the note was pressed or released
	note: Number, // The note from the midi event [0-127]
	velocity: Number, // The velocity from the midi event [0-127]
	channel: Number, // The channel the note was played in [1-16]
	frequency: Number, // The frequency of the note played
}

Usage

Install:

npm install --save web-midi-note-stream

Run:

var noteStream = require("web-midi-note-stream");
var midiStream = require('web-midi');
var stdout = require("stdout");

// Listen to all button presses, parse them, log to console
midiStream("Launchpad")
	.pipe(noteStream())
	.pipe(stdout("Note:"));