0.5.0 • Published 7 years ago

@mohayonao/launch-control v0.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

LAUNCH CONTROL

Build Status NPM Version License

JavaScript utility for novation LAUNCH CONTROL

Launch Control

Installation

Node.js

npm install @mohayonao/launch-control

Browser

Examples

Online examples (using Web MIDI API)

Run example with Node.js (using node-midi)

node examples/dump.js

API

LaunchControl

  • constructor(deviceName: string = 'Launch Control', opts={})
    • opts.enablePadOff when true, enable to receive pad off events

Class methods

  • requestDeviceNames(): Promise<{ inputs: string[], outputs: string[] }>

Instance methods

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)

Events

  • message
    • dataType: string
      • knob1
      • knob2
      • pad
      • cursor
    • value: number 0 - 127
    • track: number 0 - 7 ( knob1, knob2, pad )
    • direction: string "left", "right", "up" or "down" ( cursor )
    • channel: number 0 - 15
    • deviceName: string

Color Code

color namecolor index
off0
dark red1
red2
light red3
dark green4
dark amber5
green8
amber10
light green12
light amber15

Usage

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);
});

License

MIT

0.5.0

7 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago