Forums > MaxMSP

using pcontrol to move forward and back- not working :(

June 13, 2013 | 1:34 am

Hi,

Have a patch where 4 patched are linked through pcontrol. I can move from pcontrol_1 to pcontrol_2 etc (i.e. moving forward) no problem. However when on pcontrol_3, if I want to move back to pcontrol_2 it doesn’t work. Am I doing something wrong, or doesn’t it work like this?

Josh


June 13, 2013 | 11:05 am

We need to see the patch. Are you just bringing each patch to the front?


June 13, 2013 | 12:24 pm

I have a patch named pcontrol_1 (see code/attachment). In this I have a open next patch message (pcontrol_2). In turn pcontrol_2 patch has object to open pcontrol_1 (see code/attachment). I would like to be able to go back and forth between these patches. I can open pcontrol_2 from pcontrol_1 fine, and can open pcontrol_1 from pcontrol_2, but after that it stops working and I get the message attached.

code for pcontrol_1 patch:
<code>

– Pasted Max Patch, click to expand. –

</code>

code for pcontrol_2 patch:
<code>

– Pasted Max Patch, click to expand. –

</code>

Attachments:
  1. window
  2. patch2
  3. patch1

June 13, 2013 | 12:44 pm

You’re doing just what it says: you can’t save a patch (like pcontrol_1) that has an instance of itself in it. In this case, because pcontrol_2 has pcontrol_1 in it (and vice-versa), the duplicate is down one level in the hierarchy, but it’s there. Not allowed…infinite recursion.

You should just have the four patches and use send/receive back and forth from a master patch that contains all of them. Use the [pcontrol] object only at the master patch level to open them. You can still use the message boxes "open next patch" and "open previous patch" if you want. Or why not have a [tab] in each that lets you open any of the 4, instead of going forward and back? Simple enough, just use [send] and the chosen tab number, then at the master patch level, use [select] to open the correct patch.

You can also use "wclose" to [thispatcher] within each patch if you want another "close" button besides the standard one in the window title bar. This is sometimes handy for less mouse movement, and it also lets you use windows without title bars…which can have semi-transparent backgrounds…niiiiice.

You might also look at [bpatcher] for some other ideas, though usually in that case you only see one at a time and you use bringtofront/sendtoback to switch between them.


June 14, 2013 | 4:46 am

Hi,

Thanks for advice seejay. i had thought of this.. However, the patch is to try out some different interaction methods and i need to have the patches so you cant access patch 4 directly from patch 1; you have to open the next patch and one after that to reach patch 4 and visa versa. I know its a long way, but i’m deliberatley trying to slow down navigation.

would the methods you mentioned allow this?


June 14, 2013 | 5:00 am

P.s. what you’re saying about:

"lets you use windows without title bars…which can have semi-transparent backgrounds…niiiiice."

Anychance you could give me an example of that please- might be really useful.

cheers


Viewing 6 posts - 1 through 6 (of 6 total)