Skip to content

Instantly share code, notes, and snippets.

@DatanoiseTV
Created December 28, 2014 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DatanoiseTV/89b389efe82329f3f61c to your computer and use it in GitHub Desktop.
Save DatanoiseTV/89b389efe82329f3f61c to your computer and use it in GitHub Desktop.
midi = require('midi'),
input = new midi.input(),
output = new midi.output(),
com = require("serialport");
serialPort = new com.SerialPort("/dev/tty.usbmodem261", {
baudrate: 115200,
});
input.openVirtualPort("My Virtual Midi Input");
var b = new Buffer(7);
input.on('message', function(deltaTime, message) {
new Buffer("AxoM").copy(b);
new Buffer(message).copy(b,4);
serialPort.write(b);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment