pcontrol & thispatcher conflict?

Sep 11, 2010 at 2:11pm

pcontrol & thispatcher conflict?

Hi there,
I have been trying to solve this on my own for days but now I have to give up… :(

I need to open a patcher (subpatcher) in fullscreen, meaning that if the patcher is closed I want it to open “directly” in fullscreen.
I thought this was so easy as having an “open” message to pcontrol triggered right before the fullscreen message… boys I was wrong… :(

1. the open message to pcontrol AND the double click on the “p” objectbox opens the subpatcher REGARDLESS of the window size previously set by messaging thispatcher
2. subpatcher will conform to window size only if this is set once the patcher is open

I tried many combinations of triggers in order to have first the open message to pcontrol, then the window size message to thispatcher and then the fullscreen message to thispatcher… but everything was proved useless because…

3. (the SADDEST of all…) there is no way of getting a proper fullscreen until the “open” messagebox is connected to the same branch of the “fullscreen $1″ message (!!!)

I can’t see what I’m doing wrong…
I’m begging for help on this, because if I cannot fix it I’m going to get a user severely un-friendly application!

here is an example patch:

{
“patcher” : {
“fileversion” : 1,
“rect” : [ 29.0, 69.0, 649.0, 488.0 ],
“bglocked” : 0,
“defrect” : [ 29.0, 69.0, 649.0, 488.0 ],
“openrect” : [ 0.0, 0.0, 0.0, 0.0 ],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“gridonopen” : 0,
“gridsize” : [ 15.0, 15.0 ],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“enablehscroll” : 1,
“enablevscroll” : 1,
“devicewidth” : 0.0,
“boxes” : [ {
"box" : {
"maxclass" : "comment",
"text" : "this message works only once the subpatcher is open...",
"linecount" : 2,
"patching_rect" : [ 400.0, 423.0, 194.0, 34.0 ],
“id” : “obj-11″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “…it will still ignore the window size settings, but at least you can get a real fullscreen!”,
“linecount” : 5,
“patching_rect” : [ 199.0, 245.0, 116.0, 75.0 ],
“id” : “obj-10″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “loadbang”,
“outlettype” : [ "bang" ],
“patching_rect” : [ 398.0, 366.0, 60.0, 20.0 ],
“id” : “obj-9″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “< try disconnecting the rightmost outlet of trigger from pcontrol and opening the subpatcher with the open message...",
“linecount” : 5,
“patching_rect” : [ 161.0, 171.0, 154.0, 75.0 ],
“id” : “obj-8″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “open”,
“outlettype” : [ "" ],
“patching_rect” : [ 161.0, 257.0, 37.0, 18.0 ],
“id” : “obj-23″,
“fontname” : “Arial”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “comment”,
“text” : “= ” f “”,
“patching_rect” : [ 156.0, 58.0, 44.0, 23.0 ],
“id” : “obj-20″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 14.0,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “t 1 open”,
“outlettype” : [ "int", "open" ],
“patching_rect” : [ 104.0, 170.0, 54.0, 20.0 ],
“id” : “obj-18″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 2
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “sel 1″,
“outlettype” : [ "bang", "" ],
“patching_rect” : [ 104.0, 124.0, 36.0, 20.0 ],
“id” : “obj-17″,
“fontname” : “Arial”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 2
}

}
, {
“box” : {
“maxclass” : “toggle”,
“outlettype” : [ "int" ],
“patching_rect” : [ 104.0, 91.0, 20.0, 20.0 ],
“id” : “obj-16″,
“numinlets” : 1,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “sel 102″,
“outlettype” : [ "bang", "" ],
“patching_rect” : [ 104.0, 59.0, 49.0, 20.0 ],
“id” : “obj-14″,
“fontname” : “Arial”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 2
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “key”,
“outlettype” : [ "int", "int", "int", "int" ],
“patching_rect” : [ 104.0, 25.0, 59.5, 20.0 ],
“id” : “obj-7″,
“fontname” : “Arial”,
“numinlets” : 0,
“fontsize” : 12.0,
“numoutlets” : 4
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “fullscreen $1″,
“outlettype” : [ "" ],
“patching_rect” : [ 311.0, 366.0, 79.0, 18.0 ],
“id” : “obj-6″,
“fontname” : “Arial”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “pcontrol”,
“outlettype” : [ "" ],
“patching_rect” : [ 139.0, 289.0, 53.0, 20.0 ],
“id” : “obj-5″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “window size 0 0 600 400, window exec”,
“outlettype” : [ "" ],
“patching_rect” : [ 398.0, 397.0, 217.0, 18.0 ],
“id” : “obj-4″,
“fontname” : “Arial”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “s patcher”,
“patching_rect” : [ 311.0, 428.0, 60.0, 20.0 ],
“id” : “obj-2″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “p”,
“patching_rect” : [ 139.0, 323.0, 18.0, 20.0 ],
“id” : “obj-1″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 0,
“patcher” : {
“fileversion” : 1,
“rect” : [ 0.0, 0.0, 600.0, 400.0 ],
“bglocked” : 0,
“defrect” : [ 0.0, 0.0, 600.0, 400.0 ],
“openrect” : [ 0.0, 0.0, 0.0, 0.0 ],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“gridonopen” : 0,
“gridsize” : [ 15.0, 15.0 ],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“enablehscroll” : 1,
“enablevscroll” : 1,
“devicewidth” : 0.0,
“boxes” : [ {
"box" : {
"maxclass" : "message",
"text" : "window size 0 0 600 400, window exec",
"outlettype" : [ "" ],
“patching_rect” : [ 313.0, 130.0, 217.0, 18.0 ],
“id” : “obj-4″,
“fontname” : “Arial”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “inlet”,
“outlettype” : [ "" ],
“patching_rect” : [ 147.0, 96.0, 25.0, 25.0 ],
“id” : “obj-3″,
“numinlets” : 0,
“numoutlets” : 1,
“comment” : “”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “r patcher”,
“outlettype” : [ "" ],
“patching_rect” : [ 251.0, 129.0, 58.0, 20.0 ],
“id” : “obj-2″,
“fontname” : “Arial”,
“numinlets” : 0,
“fontsize” : 12.0,
“numoutlets” : 1
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “thispatcher”,
“outlettype” : [ "", "" ],
“patching_rect” : [ 251.0, 199.0, 69.0, 20.0 ],
“id” : “obj-1″,
“fontname” : “Arial”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 2,
“save” : [ "#N", "thispatcher", ";", "#Q", "end", ";" ]
}

}
],
“lines” : [ {
"patchline" : {
"source" : [ "obj-3", 0 ],
“destination” : [ "obj-1", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-2", 0 ],
“destination” : [ "obj-1", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-4", 0 ],
“destination” : [ "obj-1", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
]
}
,
“saved_object_attributes” : {
“default_fontname” : “Arial”,
“fontname” : “Arial”,
“default_fontsize” : 12.0,
“globalpatchername” : “”,
“fontface” : 0,
“fontsize” : 12.0,
“default_fontface” : 0
}

}

}
],
“lines” : [ {
"patchline" : {
"source" : [ "obj-18", 1 ],
“destination” : [ "obj-5", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-17", 0 ],
“destination” : [ "obj-18", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-18", 0 ],
“destination” : [ "obj-6", 0 ],
“hidden” : 0,
“midpoints” : [ 113.5, 358.0, 320.5, 358.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-23", 0 ],
“destination” : [ "obj-5", 0 ],
“hidden” : 0,
“midpoints” : [ 170.5, 281.5, 148.5, 281.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-17", 1 ],
“destination” : [ "obj-6", 0 ],
“hidden” : 0,
“midpoints” : [ 130.5, 159.0, 320.5, 159.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-16", 0 ],
“destination” : [ "obj-17", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-14", 0 ],
“destination” : [ "obj-16", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-7", 0 ],
“destination” : [ "obj-14", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-6", 0 ],
“destination” : [ "obj-2", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-5", 0 ],
“destination” : [ "obj-1", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-4", 0 ],
“destination” : [ "obj-2", 0 ],
“hidden” : 0,
“midpoints” : [ 407.5, 421.5, 320.5, 421.5 ]
}

}
, {
“patchline” : {
“source” : [ "obj-9", 0 ],
“destination” : [ "obj-4", 0 ],
“hidden” : 0,
“midpoints” : [ 407.5, 391.5, 407.5, 391.5 ]
}

}
]
}

}

So I realized the

#52265
Sep 11, 2010 at 4:19pm

Try this.

Attachments:
  1. screentest.maxpat
#187835
Sep 11, 2010 at 4:31pm

Or try this

– Pasted Max Patch, click to expand. –
#187836
Sep 12, 2010 at 2:11pm

Thank you guys!!! :)
@MIB: your patch works great, I tried with defer but it didn’t work at all… I suppose that’s the price I paid for having never really understood the difference between the two objects… shame on me.

@Christopher: I’m not sure I got the point of your patch, and I’m afraid it does not either work as you expected? :| Anyway you introduced me to a useful unknown object, screensize, shame on me again! :D

cheers

#187837
Sep 12, 2010 at 3:34pm

Yeah, I see that my patch doesn’t work on some display configurations, apparently because thispatcher doesn’t like setting its top-left window coordinates to 0,0 or something. (If you change $1 $2 to 100 100, for example, it works.) So MIB’s solution is better. Oddly, though, with MIB’s patch, on my computer at least, typing ‘f’ twice to open and close the subpatch window leaves NO window selected and renders the key object inoperative until its window is re-selected with a mouse click.

#187838
Sep 12, 2010 at 8:22pm

No window selected is an unfortunate side effect. but it should be easy to remedy with a look at the pcontrol and thispatcher helpfiles… don’t want to take all the fun away from you guys ;)

#187839
Sep 13, 2010 at 4:34am

Sure, it’s easy enough to solve, but I’m not sure why it occurs.

#187840

You must be logged in to reply to this topic.