} else {
this.outputs[port.name] = undefined;
}
- if (port.name == 'nanoPAD2 MIDI 1') { $('#devices .nanopad').removeClass('on'); }
- if (port.name == 'nanoKONTROL2 MIDI 1') { $('#devices .nanokontrol').removeClass('on'); }
+ if (port.name == 'nanoPAD2 MIDI 1' || port.name == 'nanoPAD2 2 PAD') { $('#devices .nanopad').removeClass('on'); }
+ if (port.name == 'nanoKONTROL2 MIDI 1' || port.name == 'nanoKONTROL2 2 SLIDER/KNOB') { $('#devices .nanokontrol').removeClass('on'); }
} else {
if (port.type == "input") {
if (this.inputs[port.name] === undefined) { this.registerPort(port); }
if (this.outputs[port.name] === undefined) { this.registerPort(port); }
}
console.log('hello:', port.name);
- if (port.name == 'nanoPAD2 MIDI 1') { $('#devices .nanopad').addClass('on'); }
- if (port.name == 'nanoKONTROL2 MIDI 1') { $('#devices .nanokontrol').addClass('on'); }
+ if (port.name == 'nanoPAD2 MIDI 1' || port.name == 'nanoPAD2 2 PAD') { $('#devices .nanopad').addClass('on'); }
+ if (port.name == 'nanoKONTROL2 MIDI 1' || port.name == 'nanoKONTROL2 2 SLIDER/KNOB') { $('#devices .nanokontrol').addClass('on'); }
this.renderPort(port);
}
},
} else {
this.outputs[port.name] = port;
- if (port.name == 'nanoKONTROL2 MIDI 1') {
+ if (port.name == 'nanoKONTROL2 MIDI 1' || port.name == 'nanoKONTROL2 2 SLIDER/KNOB') {
+ var port_name = port.name;
/* turn "external leds" mode on.
*
* The sysex dump has been recorded from the official Korg kontrol
* editor by the Overtone project, original code at:
* https://github.com/overtone/overtone/blob/master/src/overtone/device/midi/nanoKONTROL2.clj */
- device("nanoKONTROL2 MIDI 1").raw([240, 126, 127, 6, 1, 247]);
- device("nanoKONTROL2 MIDI 1").raw([240, 66, 64, 0, 1, 19, 0, 31, 18, 0, 247]);
- device("nanoKONTROL2 MIDI 1").raw([240, 126, 127, 6, 1, 247]);
+ device(port_name).raw([240, 126, 127, 6, 1, 247]);
+ device(port_name).raw([240, 66, 64, 0, 1, 19, 0, 31, 18, 0, 247]);
+ device(port_name).raw([240, 126, 127, 6, 1, 247]);
- device("nanoKONTROL2 MIDI 1").raw([ 240, 66, 64, 0, 1, 19, 0, 127, 127,
+ device(port_name).raw([ 240, 66, 64, 0, 1, 19, 0, 127, 127,
2, 3, 5, 64, 0, 0, 0, 1, 16, 1, 0, 0, 0, 0, 127, 0, 1, 0, 16,
0, 0, 127, 0, 1, 0, 32, 0, 127, 0, 0, 1, 0, 48, 0, 127, 0, 0,
1, 0, 64, 0, 127, 0, 16, 0, 1, 0, 1, 0, 127, 0, 1, 0, 0, 17, 0,
127, 0, 127, 127, 127, 127, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 247]);
- device("nanoKONTROL2 MIDI 1").raw([240, 126, 127, 6, 1, 247]);
- device("nanoKONTROL2 MIDI 1").raw([240, 66, 64, 0, 1, 19, 0, 31, 17, 0, 247]);
+ device(port_name).raw([240, 126, 127, 6, 1, 247]);
+ device(port_name).raw([240, 66, 64, 0, 1, 19, 0, 31, 17, 0, 247]);
- function on(note) { device("nanoKONTROL2 MIDI 1").cc(note, 127); }
- function off(note) { device("nanoKONTROL2 MIDI 1").cc(note, 0); }
+ function on(note) { device(port_name).cc(note, 127); }
+ function off(note) { device(port_name).cc(note, 0); }
var leds = Array(43, 44, 42, 41, 45);
for (var i=0; i<8; i++) {
leds.push(64+i);