Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(portName = 'Ableton Push 2 User Port', virtual = false) {
super();
// console.log(`Initializing ${portName}`);
this._input = new easymidi.Input(portName, virtual);
this._output = new easymidi.Output(portName, virtual);
this._input.on('message', (msg) => {
// Emit all messages as 'message' events, plus each individual type separately.
this.emit(msg._type, msg);
this.emit('message', msg);
});
}
/**
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(', '));
});
});