JavaScript utility for novation LAUNCH CONTROL
Node.js
npm install @mohayonao/launch-control
Browser
Online examples (using Web MIDI API)
Run example with Node.js (using node-midi)
node examples/dump.js
constructor(deviceName: string = 'Launch Control', opts={})
opts.enablePadOff
when true, enable to receive pad off events
requestDeviceNames(): Promise<{ inputs: string[], outputs: string[] }>
Also implements methods from the interface @mohayonao/event-emitter.
open(): Promise<[ input, output ]>
close(): Promise<[ input, output ]>
send(data: number[]): void
led(track: number|string, color: number|string, [channel: number]): void
track
0 - 7 or "all", "even", "odd"color
index or name (see below)
message
dataType: string
- knob1
- knob2
- pad
- cursor
value: number
0 - 127track: number
0 - 7 ( knob1, knob2, pad )direction: string
"left", "right", "up" or "down" ( cursor )channel: number
0 - 15deviceName: string
color name | color index |
---|---|
off | 0 |
dark red | 1 |
red | 2 |
light red | 3 |
dark green | 4 |
dark amber | 5 |
green | 8 |
amber | 10 |
light green | 12 |
light amber | 15 |
Node.js
var LaunchControl = require("@mohayonao/launch-control");
Browser
<script src="/path/to/launch-control.js"></script>
Common
var ctrl = new LaunchControl();
ctrl.open().then(function() {
ctrl.led("all", "amber");
});
ctrl.on("message", function(e) {
console.log("dataType: " + e.dataType);
console.log("track : " + e.track);
console.log("value : " + e.value);
console.log("channel : " + e.channel);
});
MIT