Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var easymidi = require('easymidi');
// Monitor all MIDI inputs with a single "message" listener
easymidi.getInputs().forEach(function(inputName){
var input = new easymidi.Input(inputName);
input.on('message', function (msg) {
var vals = Object.keys(msg).map(function(key){return key+": "+msg[key];});
console.log(inputName+": "+vals.join(', '));
});
});
var easymidi = require('easymidi');
console.log('Input ports: \n\t'+easymidi.getInputs().join('\n\t'));
console.log('Output ports: \n\t'+easymidi.getOutputs().join('\n\t'));
process.exit(0);