Just for CB 13 (Latest) and CB14, won’t work on earlier versions.
Here’s a MIDI remote script that does what the title suggests:
When we change the selected track (in the mixer, but also in the project window if we have Preferences→Editing→Project & MixConsole→Sync Selection in Project Window and MixConsole enabled) all plugin windows are closed and then all the inserts slots plugin windows of the newly selected track will open. At the same time the instrument plugin window will open. BOTH these options can be treated separately if needed, by directly altering the variables settingActivateOpen and settingActivatePluginOpen in the script, by setting them to true or false based on whether we want to open plugin windows and/or the instrument plugin window. We can even dynamically toggle these variables, I have set MIDI CC 0 and 1 (Channel 0) for toggling them. One can always edit the MIDI Port names to fit the ones they want, and also the MIDI CC message involved.
The state of these settings are reflected in the MIDI Remote Surface Window, by lamps. So for example, in the following screenshot, we can see both enabled:
And when for example we disable the auto open of the instrument plugin window:
Here’s the snippet for anyone interested in this:
// Opening all insert slots and/or instrument plugin of selected track
var midiremote_api = require('midiremote_api_v1')
var deviceDriver = midiremote_api.makeDeviceDriver("Test","Open Inserts Selected","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 customOpenPlugins=surface.makeCustomValueVariable("customOpenPlugins")
customOpenPlugins.mMidiBinding
.setInputPort(midiInput)
.bindToControlChange(0,0)
var customOpenPluginWindow=surface.makeCustomValueVariable("customOpenPluginWindow")
customOpenPluginWindow.mMidiBinding
.setInputPort(midiInput)
.bindToControlChange(0,1)
var labelOpenPlugins=surface.makeLabelField(0,0,8,1)
var lampOpenPlugins=surface.makeLamp(8,0,1,1)
var labelOpenPluginWindow=surface.makeLabelField(0,1,8,1)
var lampOpenPluginWindow=surface.makeLamp(8,1,1,1)
var closeAllPluginsCustomVar=surface.makeCustomValueVariable("closeAllPluginsCustomVar")
var openPluginsSelectedTrackVar=surface.makeCustomValueVariable("openPluginsSelectedTrackVar")
var openPluginWindowSelectedTrackVar=surface.makeCustomValueVariable("openPluginWindowSelectedTrackVar")
var page=mapping.makePage("Open Inserts")
page.setLabelFieldText(labelOpenPlugins,"Plugins Open State")
page.setLabelFieldText(labelOpenPluginWindow,"Plugin Window Open State")
var selectedTrack=page.mHostAccess.mTrackSelection.mMixerChannel
var daSelectedTrack=page.mHostAccess.makeDirectAccess(selectedTrack)
page.mOnActivate=function(activeDevice,activeMapping){
daSelectedTrack.activate(activeMapping)
lampOpenPluginWindow.mSurfaceValue.setProcessValue(activeDevice,settingActivatePluginOpen ? 1 : 0)
lampOpenPlugins.mSurfaceValue.setProcessValue(activeDevice,settingActivateOpen? 1 : 0)
}
page.mOnDeactivate=function(activeDevice,activeMapping){
daSelectedTrack.deactivate(activeMapping)
}
var settingActivateOpen=true
var settingActivatePluginOpen=true
customOpenPlugins.mOnProcessValueChange=function(activeDevice,value,diff){
if(value==1){
settingActivateOpen=!settingActivateOpen
lampOpenPlugins.mSurfaceValue.setProcessValue(activeDevice,settingActivateOpen ? 1 :0)
}
}
customOpenPluginWindow.mOnProcessValueChange=function(activeDevice,value,diff){
if(value==1){
settingActivatePluginOpen=!settingActivatePluginOpen
lampOpenPluginWindow.mSurfaceValue.setProcessValue(activeDevice,settingActivatePluginOpen ? 1 :0)
}
}
page.makeCommandBinding(closeAllPluginsCustomVar,'Windows', 'Close All Plug-in Windows').mOnValueChange=function(activeDevice,activeMapping,value,diff){
if(value==1){
closeAllPluginsCustomVar.setProcessValue(activeDevice,0)
if(settingActivateOpen){
openPluginsSelectedTrackVar.setProcessValue(activeDevice,1)
}
if(settingActivatePluginOpen){
openPluginWindowSelectedTrackVar.setProcessValue(activeDevice,1)
}
}
}
page.makeValueBinding(openPluginWindowSelectedTrackVar,selectedTrack.mInstrumentPluginSlot.mEdit)
var customHostOpenPlugins=page.mCustom.makeHostValueVariable("customHostOpenPlugins")
page.makeValueBinding(openPluginsSelectedTrackVar,customHostOpenPlugins).mOnValueChange=function(activeDevice,activeMapping,value,diff){
if(value==1){
if(selectedObjectID>-1){
daSelectedTrack.setParameterProcessValue(activeMapping,selectedObjectID,4096,1)
}
openPluginsSelectedTrackVar.setProcessValue(activeDevice,0)
}
}
var selectedObjectID=0
daSelectedTrack.mOnObjectChange=function(activeDevice,activeMapping,objectID){
if(settingActivateOpen==false && settingActivatePluginOpen==false) return
var selected=daSelectedTrack.getParameterProcessValue(activeMapping,objectID,4000)
if(selected==1 && objectID!=selectedObjectID){
selectedObjectID=objectID
closeAllPluginsCustomVar.setProcessValue(activeDevice,1)
}
}
And here’s the midiRemote installation file:
Test_Open Inserts Selected.midiremote (1.9 KB)
A short demonstration, while selecting a track either by mouse click or cursors up/down: