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.
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.
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.