Switching between patches

May 5, 2006 at 3:50am

Switching between patches

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?

#25787
May 5, 2006 at 5:54pm

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

http://www.cycling74.com/story/2006/2/14/161736/108

best,
dan


***
http://danwinckler.com
http://share.dj

http://gunshowimprov.com

#76375
May 5, 2006 at 6:11pm

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
gl.objects.

Cheers,
Andrew B.

#76376
May 5, 2006 at 8:10pm

#76377
May 5, 2006 at 11:36pm

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?

#76378
May 6, 2006 at 2:47am

#76379
May 6, 2006 at 5:03pm

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.

#76380
May 6, 2006 at 6:03pm

You don’t need to use automatic 0 for the jit.gl.render object.
The fact that things stay on your screen probably has to do with
the erase_color of the jit.gl.render 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
jit.gl.gridshape and a text using jit.gl.2dtext, 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 jit.gl.something 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 jit.gl.render, 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 jit.gl.render again which puts the
resulting image in your window.

Hope this clears things up a bit…

#76381
May 6, 2006 at 6:11pm

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 jit.gl.gridshape test @automatic 0 @shape cube 0.1;
#P newex 343 175 250 196617 jit.gl.gridshape test @automatic 0 @shape sphere 0.1;
#P newex 21 136 79 196617 jit.window test;
#P newex 21 116 281 196617 jit.gl.render 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;

#76382
May 6, 2006 at 6:48pm

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;

#76383
May 6, 2006 at 8:10pm

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

#76384
May 6, 2006 at 10:18pm

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.

#76385

You must be logged in to reply to this topic.