Get channel number in a bank

Hi,

I have a channel bank:

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

var channelBankItem = hostMixerBankZone.makeMixerBankChannel()

Is there a way to get the number of the track attached to channelBankItem? I can get the title and color and everything but I couldn’t find the number.

Hi,

No, this is not possible. Cubase doesn’t send this information out. Of course, you can store the channel index in the MixerBankZone.

2 Likes

As @Martin.Jirsak said.

If you need just the channel index and since usually we’re creating our channelBankItems in a loop, you can get it (the channel index inside the bank, NOT the track number in the project window), by using a bind (here I’m using the mVolume change event, but you can do it pretty much in every other change):

var yourBanksChannelsLength=8 // Place whichever number suits your controller
for (var i = 0; i < yourBanksChannelsLength; i++) {
        
        var channelBankItem=hostMixerBankZone.makeMixerBankChannel()

        channelBankItem.mValue.mVolume.mOnProcessValueChange=function(activeDevice,activeMapping,volume){
        
              console.log("Your channel index="+this.i.toString())

         }.bind({i})

}

Now, if you really need the DAW track number, a way is to create a PLE to renumber your tracks and add their number to the prefix or suffix of your track name, and get them from the title change.

2 Likes

Thank you. It would be nice if Steinberg would add this function.

Hi,

Add the feature-request tag to your post, please.

Out of curiosity, can you offer an example of a use-case for this functionality? It sounds interesting to me.

Well I have a controller that can display that for each track. I think it is quite nice to have. E.g. when you have 8 or 16 faders you can pretty quickly see where you are in the project without having to read track names.