asked Mar 15 '15 at 17:52 by iggyk (11)

Hello, I have axiom pro 49, is there a way for me to midi map all the buttons on it to bitwig, the transport buttons, drum pads, knobs, mute, solo for channels etc...? I downloaded some axiom pro controller script but it does nothing but let me play the keys. Thank you Igor

I might have something for you! (and anyone who stumbled into this thread)

I created a simple Bitwig Controller Script for my Axiom Pro 61, that lets it be used as a normal generic midi controller, but also gives functionality to the Axiom's transport buttons. Credits to "teetrinkers" who created the Bitwig Script for the Axiom 25, which I referenced.

Play - Starts Bitwig's Playback
Rec - Toggles Bitwigs Record
 Stop - Stops Bitwigs Playback
>> - Selects Next Track
<< - Selects Previous Track
LOOP - Toggles current window visible/invisible
Soft Buttons S10-S17 - Functionality dependent on what "Button Mode" you've selected
Soft Button S18 - Cycles through "Button Modes" (Select -> Mute -> Solo -> Arm)

Change all occurances of "Axiom Pro 61" to "Axiom Pro 49", and I think you'll be golden!

This script should give everyone (not just Axiom owners) a solid base to start creating their own controller scripts =D

loadAPI(1);

host.defineController("M-Audio", "Axiom Pro 61", "1.0", "10eeab13-ccbc-4a40-8850-ed335826d7e6");  // These values are what you want to be displayed in BitWig for this MIDI Controller / Script.
host.defineMidiPorts(1, 1);
host.addDeviceNameBasedDiscoveryPair(["Axiom Pro 61"], ["Axiom Pro 61"]); // Change this to your device's name that shows up in Bitwigs MIDI Controller Drop-down.

var NUM_SCENES = 10;
var ccToUserIndex = []
var CC_MIN = 1;
var CC_MAX = 127;
var buttonMode = 0;

var BUTTON = {
    SELECT : 0,
    MUTE : 1,
    SOLO : 2,
    ARM : 3,
    PRESS : 127,
    RELEASED : 0
}

var CC = {
    LOOP: 113,
    REW: 114,
    FF: 115,
    STOP: 116,
    PLAY: 117,
    REC: 118,
    BUTTON1: 85,
    BUTTON2: 86,
    BUTTON3: 87,
    BUTTON4: 88,
    BUTTON5: 89,
    BUTTON6: 90,
    BUTTON7: 110,
    BUTTON8: 111,
    BUTTON9: 112
}

function printSysexId() {
    // To view logs, in BitWig goto View -> Controller Script Console.
    println("Sysex ID:");
    sendSysex("F0 7E 7F 06 01 F7");
}

function createViews() {

    noteInput = host.getMidiInPort(0).createNoteInput("Axiom Pro 61", /* Change this to your MIDI Controller Name */
        "80????", "90????", "B001??", "B002??", "B00B??", "B040??", "C0????", "D0????", "E0????" /* These bytes can stay the same, regardless of MIDI Controller */);
    noteInput.setShouldConsumeEvents(false);

    transport = host.createTransport();

    // A track-bank view acts as a N-track window onto the documentĀ“s tracks
    trackBank = host.createTrackBank(8 /* num tracks */, 1 /* num sends */, 0 /* num scenes*/);

    // The cursor track view follows the track selection in the application GUI
    cursorTrack = host.createCursorTrack(4 /* num sends */, NUM_SCENES /* num scenes */);

    masterTrack = host.createMasterTrack( NUM_SCENES );

    userControls = host.createUserControls(CC_MAX - CC_MIN + 1 /* numControls */ );
}

function init() {

    host.getMidiInPort(0).setSysexCallback(onSysex);
    host.getMidiInPort(0).setMidiCallback(onMidi);

    printSysexId();
    createViews();

    var index = 0;
    for (var cc = CC_MIN; cc < CC_MAX; cc++) {
        if (!withinRange(cc, CC.LOOP, CC.REC)) {
            ccToUserIndex[cc] = index;
            userControls.getControl(index).setLabel("CC" + cc); // Makes the CC Available to be Mapped!
            index++;
        }
    }

    host.showPopupNotification("Axiom Pro Loaded");
}

function isUserCc(cc) {
    return cc < ccToUserIndex.length && ccToUserIndex[cc] != undefined;
}

function onSysex(data)
{
    // Handle SysEx Here
    println(data);
}

function processButton(trackNum){
    theTrack = trackBank.getTrack(trackNum - 1);
    if(theTrack){
        switch(buttonMode) {
            case BUTTON.SELECT:
                theTrack.select();
                break;
            case BUTTON.MUTE:
                theTrack.getMute().toggle();
                break;  
            case BUTTON.SOLO:
                theTrack.getSolo().toggle();
                break;  
            case BUTTON.ARM:
                theTrack.getArm().toggle();
                break;      
        }   
    }
}

function onMidi(status, noteNumber, noteVelocity) {
    printMidi(status, noteNumber, noteVelocity);

    if (isChannelController(status)) {

        if(noteVelocity == BUTTON.RELEASED){ 
            switch (noteNumber) {
                case CC.LOOP:
                    cursorTrack.getPrimaryDevice().isWindowOpen().toggle();
                    break;
                case CC.REW:
                    cursorTrack.selectPrevious();
                    host.showPopupNotification("Axiom Pro Loaded");
                    break;
                case CC.FF:
                    cursorTrack.selectNext();
                    host.showPopupNotification("Axiom Pro Loaded");
                    break;
                case CC.STOP:
                    transport.stop();
                    break;
                case CC.PLAY:
                    transport.play();
                    break;
                case CC.REC:
                    transport.record();
                    break;
                case CC.BUTTON1:
                    processButton(1);
                    break;
                case CC.BUTTON2:
                    processButton(2);
                    break;
                case CC.BUTTON3:
                    processButton(3);
                    break;
                case CC.BUTTON4:
                    processButton(4);
                    break;
                case CC.BUTTON5:
                    processButton(5);
                    break;
                case CC.BUTTON6:
                    processButton(6);
                    break;
                case CC.BUTTON7:
                    processButton(7);
                    break;
                case CC.BUTTON8:
                    processButton(8);
                    break;
                case CC.BUTTON9:
                    buttonMode == 3 ? buttonMode = 0 : buttonMode++;
                    if(buttonMode == 0) { 
                        host.showPopupNotification("Button Mode [Select Track]");
                    } else if(buttonMode == 1) { 
                        host.showPopupNotification("Button Mode [Mute Track]");
                    } else if(buttonMode == 2) { 
                        host.showPopupNotification("Button Mode [Solo Track]");
                    } else if(buttonMode == 3) { 
                        host.showPopupNotification("Button Mode [Arm Track]");
                    }
                    break;

            }
        }

        if (isUserCc(noteNumber)) {
            var index = ccToUserIndex[noteNumber];
            userControls.getControl(index).set(noteVelocity, 128);
        }
    } else {
        // Not a controller-message.  WHAT IS IT?!
    }
}

function exit() {
    // No clean-up necessary.
}

I've added some comments to make it somewhat more understandable.

To install this script (or any, really) in BitWig

  1. Create a new folder called "AxiomPro" in %USERPROFILE%\Documents\Bitwig Studio\Controller Scripts\
  2. In the new AxiomPro folder, create a new file called "AxiomPro.control.js", and save the above script/code inside of it.
  3. Goto Bitwig's Settings -> Controllers -> Click "Detect Available Controllers", and you should see a new controller entry get added!

If you want to learn more about scripting, or your script/device does not get recognized, then in BitWig goto Help -> Control Surface Scripting Guide, and read it. =]

Cheers

link

answered Dec 31 '15 at 01:10 by wygonjinn (181)

edited Dec 31 '15 at 19:02

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×199
×3
×3
×2

Asked: Mar 15 '15 at 17:52

Seen: 1,670 times

Last updated: Dec 31 '15 at 19:02