Nanobots Producing Megastructures

    midify-numark-dj2go

    0.1.1 • Public • Published

    midify-numark-dj2go NPM version Dependency Status

    midify compatible map for the Numark DJ 2 Go.

    Install via npm:

    npm install midify-numark-dj2go
    

    What it does

    midify is a package that combines node's event emitter with the browser's web midi api, to make working with midi messages more palatable. This module provides handlers for the Numark DJ 2 Go, intended to be used with midify, but also provides a reference for the various controls on the device so that it can be used with other modules too!

    Example

    Bundle this code with browserify. Note that Web MIDI is currently available behind a flag in Chrome, and remains unsupported in other browsers. To enable it in Chrome, go to chrome://flags and ensure that the Web MIDI option is on. As of this writing, MIDI support in Chrome is not quite plug and play capable, so you'll need to shut down Chrome and plug your device in before testing any code.

    var Midify = require('midify');
    var dj2go = require('midify-numark-dj2go');
     
    navigator.requestMIDIAccess().then(function(midiAccess) {
        var midiIn;
        var midiOut;
     
        // For brevity, we are just assuming one MIDI device is connected
        for (var input of midiAccess.inputs.values()) {
            midiIn = input;
        }
     
        for (var output of midiAccess.outputs.values()) {
            midiOut = output;
        }
     
        var midify = new Midify({
            midiIn: midiIn,
            midiOut: midiOut,
            controller: dj2go
        });
     
        midify.on('*', function(event) {
            console.log('triggered', event, 'event');
        });
     
    }, function() { console.error('MIDI access unavailable'); });

    Mapping

    dj2go

    Substitute deckX for deckA or deckB depending on which side of the controller the control is.

    Input (midify.on(event, callback)) Output (midify.send(event))
    1 browse.change
    2 enter.on / enter.off
    3 back.on / back.off
    4 deckX.load.on / deckX.load.off
    5 deckX.sync.on / deckX.sync.off deckX.sync.on / deckX.sync.off
    6 deckX.play.on / deckX.play.off deckX.play.on / deckX.play.off
    7 deckX.cue.on / deckX.cue.off deckX.cue.on / deckX.cue.off
    8 deckX.wheel.change
    9 deckX.pitchUp.on / deckX.pitchUp.off deckX.pitchDown.on / deckX.pitchDown.off
    10 deckX.pitch.change
    11 deckX.pfl.on / deckX.pfl.off deckX.pfl.on / deckX.pfl.off
    12 deckX.volume.change
    13 crossfader.change
    14 masterGain.change
    15 headphoneGain.change

    License

    MIT © Ben Briggs

    Install

    npm i midify-numark-dj2go

    DownloadsWeekly Downloads

    2

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • beneb