Alesis VI49 midi remote

I tried to create a midi remote script for alesis vi49. This is my first attempt.

//-----------------------------------------------------------------------------
// 1. DRIVER SETUP - create driver object, midi ports and detection information
//-----------------------------------------------------------------------------

// get the api's entry point
var midiremote_api = require('midiremote_api_v1')

// create the device driver main object
var deviceDriver = midiremote_api.makeDeviceDriver('Alesis', 'VI49', 'MH')

// create objects representing the hardware's MIDI ports
var midiInput = deviceDriver.mPorts.makeMidiInput()
var midiOutput = deviceDriver.mPorts.makeMidiOutput()

// define all possible namings the devices MIDI ports could have
// NOTE: Windows and MacOS handle port naming differently
deviceDriver.makeDetectionUnit().detectPortPair(midiInput, midiOutput)
    .expectInputNameEquals('VI49')
    .expectOutputNameEquals('VI49')    

//-----------------------------------------------------------------------------
// 2. SURFACE LAYOUT - create control elements and midi bindings
//-----------------------------------------------------------------------------
var surface = deviceDriver.mSurface

var keyboard = {}
keyboard.knobs = {}
keyboard.knobs.num = 12
keyboard.knobs.channel = 0
keyboard.buttons = {}
keyboard.buttons.rows = 3
keyboard.buttons.channel = 1
keyboard.buttons.cc = [
    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
    64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
    80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
]
keyboard.pads = {}
keyboard.pads.num = 16
keyboard.pads.channel = 1
keyboard.pads.note = [
    48, 49, 50, 51,
    44, 45, 46, 47,
    40, 41, 42, 43,
    36, 37, 38, 39,
]



function makeKnobs(x, y, w, h, num, channel) {
    var knobs = []
    for (var i = 0; i < num; i++) {
        var knob = surface.makeKnob(i * w + x, y, w, h)
        knob.mSurfaceValue.mMidiBinding.setInputPort(midiInput).setOutputPort(midiOutput).bindToControlChange(channel, i + 20)
        knobs[i] = knob  
    }
    return knobs
}

function makeButtons(x, y, w, h, channel) {
    var buttons = []
    for (var row = 0; row < keyboard.buttons.rows; row++) {
        for (var i = 0; i < keyboard.knobs.num; i++) {
            var button = surface.makeButton(i * w + x, row * h + y, w, h)
            button.mSurfaceValue.mMidiBinding.setInputPort(midiInput).setOutputPort(midiOutput).bindToControlChange(channel, keyboard.buttons.cc[row * 12 + i])
            buttons.push(button)
        }
    }
    return buttons
}

function makePads(x, y, w, h, channel) {
    var pads = []
    for (var row = 0; row < 4; row++) {
        for (var i = 0; i < 4; i++) {
            var pad = surface.makeTriggerPad(i * w + x, row * h + y, w, h)
            pad.mSurfaceValue.mMidiBinding.setInputPort(midiInput).setOutputPort(midiOutput).bindToNote(channel, keyboard.pads.note[row * 4 + i])
            pads.push(pad)
        }
    }
    return pads
}

function makeTransport(x, y) {
    var transport = {}
    function mkButton(x, y, w, h, cc) {
        var button = {}
        button = surface.makeButton(x, y, w, h)
        button.mSurfaceValue.mMidiBinding.setInputPort(midiInput).setOutputPort(midiOutput).bindToControlChange(0, cc)        
        return button
    }    
    transport.rewind = mkButton(x, y, 1, 0.7, 116)
    transport.forward = mkButton(x + 1, y, 1, 0.7, 117)
    transport.stop = mkButton(x + 2, y, 1, 0.7, 118)
    transport.play = mkButton(x + 3, y, 1, 0.7, 119)
    transport.cycle = mkButton(x + 4, y, 1, 0.7, 115)
    transport.record = mkButton(x + 5, y, 1, 0.7, 114)
    return transport
}

function makeSurfaceElements(){
    var surfaceElements = {}
    surfaceElements.knobs = makeKnobs(11, 0, 1.2, 2, keyboard.knobs.num, keyboard.knobs.channel)
    surfaceElements.buttons = makeButtons(11, 1.5, 1.2, 0.7, keyboard.buttons.channel)
    surfaceElements.pads = makePads(0, 4, 1, 1, keyboard.pads.channel)
    surfaceElements.transport = makeTransport(4, 2.5)
    surfaceElements.pb = surface.makeBlindPanel(0, 0, 0.75, 2)
    surfaceElements.mw = surface.makeBlindPanel(1, 0, 0.75, 2)
    surfaceElements.piano = surface.makePianoKeys(4, 4, 24, 4, 0, 48)
    return surfaceElements
}

var surfaceElements = makeSurfaceElements()
//-----------------------------------------------------------------------------
// 3. HOST MAPPING - create mapping pages and host bindings
//-----------------------------------------------------------------------------

var page = deviceDriver.mMapping.makePage('Default')
//Knobs
var knobs = surfaceElements.knobs
for (var i = 0; i < 8; i++) {
    var knobSurfaceValue = knobs[i].mSurfaceValue
    page.makeValueBinding(knobSurfaceValue, page.mHostAccess.mFocusedQuickControls.getByIndex(i)).setValueTakeOverModePickup()
}
page.makeValueBinding(knobs[8].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mVolume).setValueTakeOverModePickup()
page.makeValueBinding(knobs[9].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mPan).setValueTakeOverModePickup()
page.makeValueBinding(knobs[10].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mSends.getByIndex(0).mLevel).setValueTakeOverModePickup()
page.makeValueBinding(knobs[11].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mSends.getByIndex(1).mLevel).setValueTakeOverModePickup()

//Transport
var transport = surfaceElements.transport
page.makeValueBinding(transport.rewind.mSurfaceValue, page.mHostAccess.mTransport.mValue.mRewind)
page.makeValueBinding(transport.forward.mSurfaceValue, page.mHostAccess.mTransport.mValue.mForward)
page.makeValueBinding(transport.stop.mSurfaceValue, page.mHostAccess.mTransport.mValue.mStop).setTypeToggle()
page.makeValueBinding(transport.play.mSurfaceValue, page.mHostAccess.mTransport.mValue.mStart).setTypeToggle()
page.makeValueBinding(transport.cycle.mSurfaceValue, page.mHostAccess.mTransport.mValue.mCycleActive).setTypeToggle()
page.makeValueBinding(transport.record.mSurfaceValue, page.mHostAccess.mTransport.mValue.mRecord).setTypeToggle()


//Pads
var pads = surfaceElements.pads
page.makeCommandBinding(pads[0].mSurfaceValue, 'Mixer', 'Bypass: Inserts')
page.makeCommandBinding(pads[1].mSurfaceValue, 'Mixer', 'Bypass: EQs')
page.makeCommandBinding(pads[2].mSurfaceValue, 'Mixer', 'Bypass: Channel Strip')
page.makeCommandBinding(pads[3].mSurfaceValue, 'Mixer', 'Bypass: Sends')

page.makeCommandBinding(pads[4].mSurfaceValue, 'Devices', 'Mixer')
page.makeCommandBinding(pads[5].mSurfaceValue, 'Editors', 'Open/Close Editor')
page.makeActionBinding(pads[6].mSurfaceValue, page.mHostAccess.mTrackSelection.mAction.mPrevTrack)
page.makeActionBinding(pads[7].mSurfaceValue, page.mHostAccess.mTrackSelection.mAction.mNextTrack)

page.makeValueBinding(pads[8].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mMute).setTypeToggle()
page.makeValueBinding(pads[9].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mSolo).setTypeToggle()
page.makeValueBinding(pads[10].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mAutomationRead).setTypeToggle()
page.makeValueBinding(pads[11].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mAutomationWrite).setTypeToggle()

page.makeValueBinding(pads[12].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mRecordEnable).setTypeToggle()
page.makeValueBinding(pads[13].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mMonitorEnable).setTypeToggle()
page.makeValueBinding(pads[14].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mEditorOpen).setTypeToggle()
page.makeValueBinding(pads[15].mSurfaceValue, page.mHostAccess.mTrackSelection.mMixerChannel.mValue.mInstrumentOpen).setTypeToggle()


//Switches
var buttons = surfaceElements.buttons
page.makeCommandBinding(buttons[0].mSurfaceValue, 'Transport', 'To Marker 1')
page.makeCommandBinding(buttons[1].mSurfaceValue, 'Transport', 'To Marker 2')
page.makeCommandBinding(buttons[2].mSurfaceValue, 'Transport', 'To Marker 3')
page.makeCommandBinding(buttons[3].mSurfaceValue, 'Transport', 'To Marker 4')
page.makeCommandBinding(buttons[4].mSurfaceValue, 'Transport', 'To Marker 5')
page.makeCommandBinding(buttons[5].mSurfaceValue, 'Transport', 'To Marker 6')
page.makeCommandBinding(buttons[6].mSurfaceValue, 'Transport', 'To Marker 7')
page.makeCommandBinding(buttons[7].mSurfaceValue, 'Transport', 'To Marker 8')
page.makeCommandBinding(buttons[8].mSurfaceValue, 'Transport', 'To Marker 9')

You may need to check the midi port name and possibly the keyboard mapping. I have set my pads and buttons to midi channel 2.
alesis.zip (2.1 KB)

4 Likes

Looks good. I have the similar Alesis VI61.

:nerd_face: :+1:

Buona base per il VI61 :grinning: :heart_eyes: :sunglasses:

Hello,
I’ve been trying to get the file into Cubase for quite some time but apparently I’m too dumb.
Can someone explain me how to install this file in Cubase?

This isn’t the intended method for distributing these files, but do the following with Cubase closed:

Open alesis.zip, then go to this folder:

Mac: /Users/<Username>/Documents/Steinberg/Cubase/MIDI Remote/Driver Scripts
Windows: C:\Users\<Username>\Documents\Steinberg\Cubase\MIDI Remote\Driver Scripts

Drag and drop the alesis folder from the alesis.zip file into the Local folder.

image

In Cubase, you’ll now be able to select this script file:

1 Like

I can’t import the script as it looks for a .midiremote file and there is only a .js (javascript) file in the alesis folder and no .midiremote file. So how do I add this script? It’s still unclear to me…Also I don’t have an Add button at the top right as in the picture. I can only click “Import Script”?! Thx for info - Johan

Hi, if you placed the js file as instructed above, you don’t have to click on “Import”.
If you click on “Vendor” does the “Alesis” appear as an option?
If so, select it and then proceed to “Model”. If VI49 appears as an option, select it and then go on with selecting the Input/Output MIDI Ports and you’re done.

1 Like

I have placed it into the right directory. But I would have to fill in the model myself. Nothing to select. And when I chose the ports and cick next I see nothing. The controls don’t appear. I have made a mapping myself in the meantime…
How would I configure that in the next 8 tracks the first 8 buttons and knobs would have the same function for track 9 to 16? I know I can add a page, but how to make the buttons and knobs point to tracks 9 to 16 (and with even more pages to other track numbers?) Thx for info - Johan

Hi, you have to assign two buttons to the previous/next mixer bank.

I will attach my basic Alesis VI49 Remote Midi file (.midiremote extension). The upper right knob is configured to handle Mouse A.I. (whatever you point your mouse at will be controlled by this knob) and the 2 buttons bottom right are configured for Edit Instrument and Edit Channel Settings. The rest of the buttons on the right I still have to configure. I also have to figure out the Q controls (knobs) and how to add those in somehow, because I understood that it can be very handy to have those available…:wink: And I still have to configure tracks 9 to 16 etc etc
Alesis_VI49.midiremote (8.0 KB)

Okay. Nice. Thanks for the info. Much appreciated! :wink:

I have updated my Alesis VI49 .midiremote with the previous and next mixer bank functions (the 2 buttons above the bottom right buttons) I will attach this version.
Now I only have to figure out how to configure Quick Controls somehow. Does anybody have experience with that? Any tip is welcome - hehe :wink:
Alesis_VI49_updated_21_5_23_2013.midiremote (8.1 KB)