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.
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()
...
}
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.
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.
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()
...
}
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.
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
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