Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setupPush () {
const push = this;
push.output = WebMidi.getOutputByName('Ableton Push 2 User Port');
push.input = WebMidi.getInputByName('Ableton Push 2 User Port');
if (!push.input || !push.output) {
log('push not connected');
push.emit('push:failed');
return;
}
push.input.addListener('sysex', 'all', (e) => {
log('sysex', e);
});
// Listen to control change message on all channels
push.input.addListener('controlchange', 'all', (e) => {
log('Received \'controlchange\' message.', e);
if (e.controller) {
const name = e.controller.name;
const number = e.controller.number;