Midi Remote API - Bind controls to fixed channels

Hi there,
I am struggling (or maybe to dumb ;-)) to find a way to link my controls to specific tracks in my mixing Template.

My controller has 4 faders and I want thes to be linked to my submix buses (16, 24, 33, 52) in order to control only these. Is that somehow possible?

Thanks
Phil

Hi,

You can bind the controller to the specific track slot, not to the track. So you can bind it for example to the track 3. So if you reorder the tracks and put some track above your 3rd one, the new 3rd one is going to be controlled.

Hi Martin,
thanks for the feedback. That should work out, as I typically not modify my template.
Do you know the API command to do so? I do not find something on track slots in the manual for the Javascript API.

Hi,

First, you have to make the MixerBankZone.

var hostMixerBankZone = page.mHostAccess.mMixConsole.makeMixerBankZone()
		.excludeInputChannels() // If you want to exclude the Input Channels
		.excludeOutputChannels() // If you want to exclude theOutput Channels

Then iterate over the channels in the bank:

for (var i = 0; i < 8; ++i) {
		var channelBankItem = hostMixerBankZone.makeMixerBankChannel()
...
}

and in the for loop, assign the Volume:

page.makeValueBinding(faderValue, channelBankItem.mValue.mVolume).setValueTakeOverModeScaled()

So the whole example could look like this:

var hostMixerBankZone = page.mHostAccess.mMixConsole.makeMixerBankZone()
	.excludeInputChannels()
	.excludeOutputChannels()

for (var i = 0; i < 8; ++i) {
	var channelBankItem = hostMixerBankZone.makeMixerBankChannel()
		
	var faderValue = surfaceElements.faderStrips[i].fader.mSurfaceValue
	page.makeValueBinding(faderValue, channelBankItem.mValue.mVolume)
}

You can also run a hybrid system where you use the API to define the hardware controls, and then create a mapping page on top of that using the mapping assistant in Cubase.

That gives you a little more flexibility and ability to change mappings per project, too.

Hi,

The highest flexibility gets when you fully script it.

Hi there,

the example is the code I am currently using (based on the examples from the doc) and this works.
My problem is, with that code it is iterating over all channels, not specific ones. So what I am looking for would be a code like this

var hostMixerBankZone2 = page2.mHostAccess.mMixConsole.makeMixerBankZone()
     .excludeInputChannels()
     .excludeOutputChannels()

var channelindexes = [16, 24, 33, 52];  

for(var channelIndex = 0; channelIndex < channelindexes.length; ++channelIndex) {
      var hostMixerBankChannel =  hostMixerBankZone2.makeMixerBankChannel(channelindexes[channelIndex]) //this does not seem to be possible

      page2.makeValueBinding(solobuttonSurfaceValue, hostMixerBankChannel.mValue.mVolume)

So the aim is to specify the slots that are mapped to my controls.
What skijumptoes says might be an approach, even though I would prefer to only script it.

Trouble with the API is that you cannot map to global plugin parameters or define project specific mappings as you can with the mapping assistant.

Which is why I opt for a hybrid approach, and bare that in mind when developing via the API.

Hi,

I haven’t tried, but what about to do something like this?

var channelBankItemsInUse = [16, 24, 33, 52]
for (var i = 0; i < 1000; ++i) {
	if (channelBankItemsInUse.indexOf(i) == -1) continue
	var channelBankItem = hostMixerBankZone.makeMixerBankChannel()
	...
}

HI all,

thanks for the reply, will test both approaches.
@Martin: funny, just had the same idea to simply skip channels I do not want :wink:

1 Like

Hi,

I’m wondering about the result. :wink:

There you go, works perfectly (had to tweak it a bit)

var channelBankItemsInUse = [139, 140, 141, 142, 143, 144, 145, 12, 13, 14, 15]             //Define channels to be used, Cubase Channel -1!!
var max = Math.max.apply(Math, channelBankItemsInUse)                                       //Get Max Index of channels

for(var channelIndex = 0; channelIndex < max + 1; ++channelIndex) {                         //Go one channel further than max
    var hostMixerBankChannel = hostMixerBankZone2.makeMixerBankChannel()
    var faderindex = channelBankItemsInUse.indexOf(channelIndex)                            //Determine if current index of channel is in use list
    if (faderindex >= 0)
    {
        var solobuttonSurfaceValue = solobuttons[faderindex].mSurfaceValue;                 //link this channel to fader number, according to channel list
        var mutebuttonSurfaceValue = mutebuttons[faderindex].mSurfaceValue;
        var panknobSurfaceValue = panknobs[faderindex].mSurfaceValue;
        var faderSurfaceValue = faders[faderindex].mSurfaceValue;
        
        page2.makeValueBinding(solobuttonSurfaceValue, hostMixerBankChannel.mValue.mSolo)
        page2.makeValueBinding(mutebuttonSurfaceValue, hostMixerBankChannel.mValue.mMute)
        page2.makeValueBinding(panknobSurfaceValue, hostMixerBankChannel.mValue.mPan)
        page2.makeValueBinding(faderSurfaceValue, hostMixerBankChannel.mValue.mVolume)
    }
}

With this I can select the channels and put them on the faders where I want.


Thanks for helping out here!

1 Like

Hi,

Thank you for sharing. For this solution, I would recommend to add a Label bellow the faders to print the track’s name. :wink: Just to keep the overview.

Good point, will try to. Is there some example how to link the label to the channel name?

By the way, Hybrid works as well :wink:

Hi,

I posted an example few days ago here.

Ahhh, please @Martin.Jirsak :wink:

I’m a bit surprised no one found the channel type filter yet :thinking:.

Hi Jochen,
thanks for the note. I tried this before with the Group Filter and basically it worked. I just preferred to have a custom order of the channels, without changing the layout in Cubase.
Bit special request, but at the end, got it working :wink:

1 Like

Hi MArtin,

again thanks for your help. Did some trials and found the solution
page.setLabelFieldHostObject(labels[faderindex], hostMixerBankChannel)
This can be used in the loop above and will add the track name to the label

1 Like