Forums > Jitter

Switching between patches

May 05 2006 | 3:50 am

I need to be able to switch between jitter patches. I’m pretty sure I can use poly to achieve this. The only problem is that poly is very complicated.

Can anyone show me an example?

I just hope I can switch 3d patches without leaving full screen.
Do I just need to name my windows the same thing?

May 05 2006 | 5:54 pm

poly~ is for managing multiple instances of the *same* patch. For
switching between different patches, look at the drawto message to, the thispatcher object, and Andrew’s Recipe 24:



May 05 2006 | 6:11 pm

Most likely the best solution would be to set @automatic 0 on all of
your gl.objects, and explicitly bang each object. Then, you simply gate
off the objects that you don’t want to see for any given scene. Another
solution would be to use the enable attribute to turn on and off your

Andrew B.

May 05 2006 | 8:10 pm

May 05 2006 | 11:36 pm

Thanks for the responses guys.

Do any of these solutions save on CPU cycles? This is why I thought of poly~ because it actually turns things off instead of things just looking like they are off.

The problem I am having is that poly~ doesn’t seem to turn off normal messages. It turns off signals fine, but normal messages that come out seem to keep flowing even when a mute is received at thispoly~.

Any help would be great. I’m not quite sure how to use thispatcher but that seems like it might work too. Scripts maybe?

May 06 2006 | 2:47 am

May 06 2006 | 5:03 pm

I’m working on trying to get automatic 0 to work. Again, I’m dumb and can’t get it to work right. Do I need to place it on every gl object or just the ones running to the main screen?

Router would just be a tool to organize it all, right?

I can’t find out how to use the enable command to clear everything.
Using automatic 0 things still seem to get stuck in the screen. I looked at the GL feedback and that didn’t seem to help me even though it seemed to do what I wanted. It really didn’t seem to run right. I think it might be a Mac only patch.

To summarize my gl objects are getting stuck in the window and won’t transition to a new gl object. Any help on how to clear them would be great.

May 06 2006 | 6:03 pm

You don’t need to use automatic 0 for the object.
The fact that things stay on your screen probably has to do with
the erase_color of the object. The message should be :
erase_color 0. 0. 0. 1. (with the first 3 zero’s for r, g, b, the
fourth nr. is the one which cause the screen not to clear entirely
when it is set below 1., depending on how low it is, 0 being the
lowest, things will stay on screen longer or ‘fade away’ slowly.
Furthermore, make sure you use the ‘deph_enable’ 0 or 1 depending on
what you want to accomplish

when using the automatic 0 argument, you need to individually bang
every GL object in which you use it. Say you draw a primitive using and a text using, both with automatic
0 enabled, you will see the following :
when banging the gridshape first, the shape will be drawn on screen,
then you bang the gl.text, which will be rendered on top of your shape.
If you send them a bang in the other order, you’ll render the text
first, and then the shape on top of it, blocking out the text.
The best way to do this is to send the bangs of the qmetro to a
trigger object. Where you use the amount of bangs needed according to
the amount of objects you use.
In the above example that would be : t b b b erase The most right
outlet of the object is connected to the, clearing the
scene, then the following two bangs to the gridshape and text object,
depending which one you render first, you connect the third outlet to
the first one you want to render on screen, and the seconde outlet to
the one you wish to bang next.
Finally, the first bang goes into again which puts the
resulting image in your window.

Hope this clears things up a bit…

May 06 2006 | 6:11 pm

and/or like this :

#P user gswitch2 102 135 39 32 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 102 175 240 196617 test @automatic 0 @shape cube 0.1;
#P newex 343 175 250 196617 test @automatic 0 @shape sphere 0.1;
#P newex 21 136 79 196617 jit.window test;
#P newex 21 116 281 196617 test @erase_color 0. 0. 0. 1. @camera 0. 0. -5;
#P newex 21 80 58 196617 t b b erase;
#P toggle 21 36 15 0;
#P number 68 37 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 21 57 57 196617 qmetro 20;
#P connect 3 1 8 1;
#P fasten 3 2 4 0 74 106 26 106;
#P connect 0 0 3 0;
#P connect 3 0 4 0;
#P fasten 8 1 6 0 136 172 348 172;
#P connect 8 0 7 0;
#P connect 1 0 0 1;
#P connect 2 0 0 0;
#P window clipboard copycount 9;

May 06 2006 | 6:48 pm

Thanks for all the help guys. I’m just trying to chug along with my limited knowledge.

Brecht I couldn’t get the example patch to open.

Is it missing header information something like:

max v2;
#N vpatcher 118 283 975 638;

May 06 2006 | 8:10 pm

select it, copy, in max select file > new from clipboard

May 06 2006 | 10:18 pm

Thanks a lot guys, I really appreciate it. I’m finally getting somewhere.

The only problem is that on full screen the object duplicates and starts flashing. Otherwise it works fine in a normal window. If all else fails I will just make the window really big.

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

Forums > Jitter