GithubHelp home page GithubHelp logo

maxbittker / korg-nano-kontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shokai/korg-nano-kontrol

1.0 3.0 0.0 789 KB

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

Home Page: https://npmjs.com/package/korg-nano-kontrol

JavaScript 100.00%

korg-nano-kontrol's Introduction

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

korg-nano-kontrol's People

Contributors

shokai avatar maxbittker avatar sashimizakana avatar

Stargazers

Christos Poulias avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.