@kaibu/korg-nano-kontrol

0.2.10 • Public • Published

korg-nano-kontrol

Node.js/Browser library for KORG nanoKONTROL and nanoKONTROL2.

Circle CI

Install

% npm install korg-nano-kontrol -save
  • On Node.js, This library depends on midi npm to handle MIDI messages. Please install ALSA libs after run npm install.
  • On Browser, require WebMIDI API support.

Samples

Usage

Connect

find nanoKONTROL or nanoKONTROL2

var nanoKONTROL = require('korg-nano-kontrol');

nanoKONTROL.connect()
.then(function(device){
  console.log('connected!' + device.name);
  // do something
})
.catch(function(err){
  console.error(err);
});

specify device name

nanoKONTROL.connect('nanoKONTROL2').then( function(device){ } );

Register Events

// register specific slider/knob/button events
device.on('slider:0', function(value){
  console.log("slider:0 >>> "+value);
});

device.on('knob:1', function(value){
  console.log("knob:1 >>> "+value);
});

device.on('button:play', function(value){
  console.log("button:play >>> "+value);
});


// catch all slider/knob/button events
device.on('slider:*', function(value){
  console.log(this.event+' => '+value);
});

device.on('knob:*', function(value){
  console.log(this.event+' => '+value);
});

device.on('button:**', function(value){
  console.log(this.event+' => '+value);
});

Close

device.close();

Scene

nanoKONTROL has a scene button

console.log(device.scene); // => return 1~4

device.on('button:scene', function(scene){
  console.log(scene);
});

Debug

enable debug npm

for node.js

% export DEBUG="korg-nano-kontrol:*"

for browser

localStorage.debug = "korg-nano-kontrol:*";

Build

% npm run build
% npm run buildSample

% npm run watch

Test

% npm install

% npm test
# or
% npm run watch

Readme

Keywords

Package Sidebar

Install

npm i @kaibu/korg-nano-kontrol

Weekly Downloads

1

Version

0.2.10

License

MIT

Unpacked Size

60.5 kB

Total Files

17

Last publish

Collaborators

  • kaibu