Rearrange Inserts

Yes, it’s doable, but the process of doing so is close to a nightmare concerning the async handles which will take place. Basically, one has to read the slots with an effect, and then copy/paste all the parameters involved to an empty slot (this includes the VST itself, so this is not an instant process) and obviously erase in the end whichever slots got empty. At the same time, if one gets to use the MR API, opening all the editors is close to a one line assignment if you grab the vital part of my code in this post:

However, if for whatever reasons, you’d insist to use the provided commands in Cubase, here’s a way to set up the macro so that we make sure that all of them are executed, in a MR Script:

var midiremote_api = require('midiremote_api_v1')

var deviceDriver = midiremote_api.makeDeviceDriver("Test","Execute Inserts Toggle Open","m.c")

var midiInput = deviceDriver.mPorts.makeMidiInput("anInput")
var midiOutput = deviceDriver.mPorts.makeMidiOutput("anOutput")

var detectionUnit=deviceDriver.makeDetectionUnit()

detectionUnit.detectPortPair(midiInput, midiOutput)
    .expectInputNameEquals("Bome MIDI Translator 1")
    .expectOutputNameEquals("Bome MIDI Translator 1")

var surface=deviceDriver.mSurface
var mapping=deviceDriver.mMapping

var buttonToggle=surface.makeButton(0,0,1,1)
buttonToggle.mSurfaceValue.mMidiBinding
    .setInputPort(midiInput)
    .bindToControlChange(0,0)

var page=mapping.makePage("Toggle Inserts")

var customToggles=[]
for(var i=1;i<17;i++){
    var customToggle=surface.makeCustomValueVariable("customToggle"+i)
    customToggles.push(customToggle)
    var iString=i<10 ? "0"+i : i.toString()
    page.makeCommandBinding(customToggles[i-1],"Mixer","Insert "+iString+": Open/Close Editor for Selected Track/Channel").mOnValueChange=function(activeDevice,activeMapping,value,diff){
        customToggles[this.i-1].setProcessValue(activeDevice,0)
    }.bind({i})
}

buttonToggle.mSurfaceValue.mOnProcessValueChange=function(activeDevice,value,diff){
    //toggle
    if(value==1){
        for(var i=0;i<customToggles.length;i++){
            customToggles[i].setProcessValue(activeDevice,1)
        }
    }
}

This won’t break since all commands are handled in parallel.

@Thor.HOG do you use the approach of handling the inserts in the UI?

1 Like