0.1.1 • Published 9 years ago

midify-numark-mixtrack-pro v0.1.1

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

midify-numark-mixtrack-pro NPM version Dependency Status

midify compatible map for the Numark MixTrack Pro.

Install via npm:

npm install midify-numark-mixtrack-pro

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 MixTrack Pro, 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 mixtrack = require('midify-numark-mixtrack-pro');

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

    midify.on('*', function(event) {
        console.log('triggered', event, 'event');
    });

}, function() { console.error('MIDI access unavailable'); });

Mapping

mixtrack

Note that the mic gain control at the bottom of the device does not emit any MIDI messages. Substitute deckX for deckA or deckB depending on which side of the controller the control is.

  • NB: Some controllers may show deck A as having a 'view' button, and deck B as having a 'tick' button in this place. However, the schema defines this as a delete button, and for consistency it is better to name this the same thing.

License

MIT © Ben Briggs