It is easy to turn off subpanels when the main panel is hidden. However, there is no simple method to remember which subpanels were previously visible when the main panel is shown. But we can chose “default” subpanels to show when the main panel is shown again.
The tool here is BUTTON OFF SETS TO DEFAULT under relationships. This is a useful supercontrol relationship, since it only works in one direction. If we need it to work in the ON direction, we just need to add an intermediate control to invert the status. And you have to ensure the default value for the control is what you want.
For all the sub panel SHOW / HIDE buttons, select the main panel show hide button in BUTTON OFF SETS TO DEFAULT and ensure the sub panel show hide button default value is off.
You can do this for as many subpanels as needed.
For “or” subpanels, just add a supercontrol grouping the sub panel SHOW / HIDE buttons. We need a dummy button for the no panels shown case. That dummy button is the one that has the main panel SHOW / HIDE button selected for BUTTON OFF SETS TO DEFAULT, it is hidden in play mode, unless there is the user option to turn off all subpanels.
To re-show default subpanels when the main panel is shown, we need to invert the value of the main show hide button to turn off an added sub control, then use that button going off to activate a super control to show desired subpanels. For the and case:
- Panel show hide button, midi inverted 127 - 0, super control ->
- Control 1, sub control of above, toggle
- Control 2 - default value on, control 1 off resets to default, super control of ->
- Desired default shown subpanels
For the “or” case presets, we again use the main panel show hide button, inverted midi values, to drive an intermediate control. That control is selected on the sub panel grouping knob for BUTTON OFF SETS TO DEFAULT, selecting the desired default value there.