Currently the mixer bank zone visibility changes can be followed by a MIDI Remote surface.
However, the update of the surface in not immediate, we need to do something, for e.g. select a track, change a volume, etc.
Not sure if this is the expected behaviour or will be changed in the future, still for now, we can workaround this in our scripts.
We can make use of the page.mOnIdle event and trick the Mixer to think that a change event is raised, by re-setting a parameter’s current value. I’ve chosen the Automation Read parameter of the selected track.
I’ve prepared a MIDI Remote surface to show how this is done:
Test_Force Visibility Change.midiremote (2.0 KB)
Here’s its source code:
var midiremote_api = require('midiremote_api_v1')
var deviceDriver = midiremote_api.makeDeviceDriver("Test","Force Visibility Change","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 faders=[]
var labels=[]
for(var i=0;i<8;i++){
var fader=surface.makeFader(4*i,0,4,4)
fader.mSurfaceValue.mMidiBinding
.setInputPort(midiInput)
.bindToPitchBend(i)
faders.push(fader)
var label=surface.makeLabelField(4*i,4,4,1)
labels.push(label)
labels[i].relateTo(faders[i])
}
var page=mapping.makePage("Default")
var mixer=page.mHostAccess.mMixConsole
var mixerBankZone=mixer.makeMixerBankZone("Main")
mixerBankZone.excludeInputChannels()
mixerBankZone.excludeOutputChannels()
mixerBankZone.setFollowVisibility(true) //true by default
var channels=[]
for(var i=0;i<8;i++){
var channel=mixerBankZone.makeMixerBankChannel()
channels.push(channel)
page.makeValueBinding(faders[i].mSurfaceValue,channels[i].mValue.mVolume)
}
// ******** The code for forcing the mixer to update
var selectedTrack=page.mHostAccess.mTrackSelection.mMixerChannel
var daSelectedTrack=page.mHostAccess.makeDirectAccess(selectedTrack)
var refreshRate=5 // This is for setting up the latency for updating we're comfortable with
var currentCount=0
page.mOnIdle=function(activeDevice,activeMapping){
currentCount++
if(currentCount>=refreshRate){
currentCount=0
refreshSelected(activeDevice,activeMapping)
}
}
function refreshSelected(activeDevice,activeMapping){
//setting the read automation of the selected track to its current value
//this will trick the mixer to update
var selectedTrackID=daSelectedTrack.getBaseObjectID(activeMapping)
var autoRead=daSelectedTrack.getParameterProcessValue(activeMapping,selectedTrackID,4013)
daSelectedTrack.setParameterProcessValue(activeMapping,selectedTrackID,4013,autoRead)
}
// ********
And a small video demonstrating the sync:
