How to know which patcher tab is open?

TFL's icon

Hey,

From my reading, it seems that the patcher tab feature has first been implemented for helper patches, and hasn't been "fully" updated for a streamlined use, so maybe I should just use another approach. But before that, maybe one of you has a solution:

How can I know which tab of a patcher is open or closed?

[closebang] doesn't send anything when switching from a tab to another. Even closing the parent patcher window doesn't trigger its subpatchers [closebang].

[active] works, but it also updates when the whole window is on/out of focus. I just want to know the selected tab, regardless if the window is on focus or not.

I thought I could make something by combining the active state of subpatchers and of their parent patcher, but the parent patcher's active state is 0 when one of it's subpatchers tabs is selected (even though the window has the name of that parent patcher, as if it was still "active").

Any workaround?

I would avoid having to create bpatchers and scripting their position depending on the state of a live.tab.

Here is a patch to play with.

Max Patch
Copy patch and select New From Clipboard in Max.
Julien Vincenot's icon

Hello, did you find a way about this?

I have several help files with multiple tabs. Some of them have identical shortcuts to trigger a given sequence of actions (I use V to eValuate everywhere as a "standard").

But obviously I don't want them to trigger all tabs at once, so I started using [ active ] to only activate the one tab currently in view.

That works, but sometimes I wish I was also able to open some subpatchers in that given tab, and still be able to use the same shortcut… that's currently impossible without creating a big mess with some or conditions, I wish things were a bit cleaner.

Thanks !

Source Audio's icon

using active in tab patchers gives you selector for the shortcut focus.

If you open subpatches, which can be part of any of them,

then what would you want to assign shortcut to ?

last active tab patcher ?

even if subpatcher from another tab patcher is currently

active one ?

If so, then use a gate that reacts only to tab patchers .

active -> sel 1 -> send ID

Julien Vincenot's icon

Hi !

Sorry I just saw this, didn't get a notification.

Thank you sooo much, the solution is really elegant ! It took me a little while, but I figured a way to include that in with my "key_trigger" abstraction without breaking normal usage. It works beautifully now.

I use some dummy attribute (@tab1 or @tabn)to differenciate last open tabs instead of normal arguments (I use those to choose which key to watch). Five gates so close to each other seems overkill, but I need some sleep…

Here's a screenshot of the whole patch and how to use it. It's already on the last release of my package https://github.com/JulienVincenot/MOZLib with some credit in the abstraction :)

Many thanks again !

Julien