Skip to content

Instantly share code, notes, and snippets.

@bencevans
Created January 22, 2016 18:08
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 bencevans/1b0dba0639921f1ce01c to your computer and use it in GitHub Desktop.
Save bencevans/1b0dba0639921f1ce01c to your computer and use it in GitHub Desktop.
AKAI LPK25 Keyboard Events
const midi = require('midi')
var input = new midi.input()
input.getPortCount()
input.getPortName(0)
input.on('message', function (deltaTime, message) {
var info = {
eventCode: message[0], // 144=keydown 128=keyup
key: message[1],
weight: message[2],
deltaTime: deltaTime
}
console.log(info)
})
input.openPort(0)
input.ignoreTypes(false, false, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment