
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
This module wraps the MIDI interface to communicate with the XONE:K2 in a sane api for Node.
npm install xonek2
Plug in the controller ( ͡° ͜ʖ ͡°)
var xonek2 = require('xonek2');
var controller = xonek2.create();
if (!controller.connect())
throw new Error("Can't connect to device");
The controller has 4 channels
// Access the third channel
var channel = controller.channels[2];
Each channel has an endless knob at the top, 3 standard knobs, a fader and 4 buttons
channel.endless_knob
channel.knobs[1] // The second knob
channel.fader
channel.buttons[3] // The last button
Standard knobs have a button beneath them, endless knobs are buttons themselves (on push).
channel.knobs[0].button
channel.endless_knob.button
Buttons and knobs have leds attached
channel.endless_knob.led
channel.knobs[2].button.led
channel.buttons[0].led
The two big buttons and the central endless knobs at the bottom can be accessed through controller.utils
controller.utils.buttons[1] // The "EXIT SETUP" button
controller.utils.endless_knobs[0]
All the components (except for leds) emit events.
The original midi message is sent along, in case you want to route it to a virtual midi device or something.
var button = controller.channels[0].buttons[1]; // The "E" button
button.on('press', function() {
console.log('Button pressed');
});
button.on('release', function() {
console.log('Button released');
});
var knob = controller.channels[3].knobs[1]; // The second knob on the last channel
knob.on('update', function(value, midi_msg) {
console.log('Knob twisted: the value is (0-1): ' + value);
});
var fader = controller.channels[1].fader; // The fader on the second channel
fader.on('update', function(value, midi_msg) {
console.log('Fader moved: the value is (0-1): ' + value);
});
var endless_knob = controller.channels[0].endless_knob; // The endless knob on the first channel
endless_knob.on('update', function(value) {
if (value == 1)
console.log('Turnin right');
if (value == -1)
console.log('Turnin left');
});
Leds can be lit up in three different colors: red (default), orange and green.
var led = controller.channels[2].knobs[0].button.led;
led.turn_on()
var led2 = controller.channels[0].endless_knob.led;
led2.turn_on(xonek2.COLOR_ORANGE);
var led3 = controller.channels[1].buttons[2].led;
led3.turn_on(xonek2.COLOR_GREEN);
Turn off a led
led.turn_off();
Turn off all leds
controller.reset_leds();
Testing is done with a virtual midi device (so you don't need to connect the controller).
npm test
Copyright (c) 2015, Marco Sampellegrini babbonatale@alpacaaa.net
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FAQs
Node api for the awesome XONE:K2 MIDI controller by Allen & Heath
We found that xonek2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.