Forums > MaxMSP

Dynamically Instantiating a Subpatch

March 22, 2011 | 8:26 pm

Is it possible to dynamically instantiate a subpatch in Max 5? I need to create numerous instances of a subpatch on the fly using the ‘thispatcher’ object or some other method. The only way I can think of doing this is creating an external that can be instantiated through scripting commands sent to ‘thispatcher’. Any thoughts?


March 22, 2011 | 8:36 pm

If you’d be a bit more specific on to how/what this subpatch is or is going to do i could probably answer your question a bit more specific but for now i think "poly~" will do. As this will, like your request, instantiate multiple instances of the same patch. If thats all you want using poly compared to thispatcher is a hassle and creating your own external even more so.

HTH

FRid


March 22, 2011 | 8:37 pm

Sorry…

it’s the other way around "using thispatcher is a hassle compared to poly"


March 22, 2011 | 9:11 pm

First off thanks for your prompt response, I’m pretty new to these forums. I’m looking at poly` but I don’t know if it’s quite exactly what I’m looking for.

My aim right now is to create a series of overlapping video matrices that can be instantiated/resized on the fly so it resembles a tunnel in perspective (and each matrix would be a different video). It would look like you’re reversing out of the tunnel; the newest instance of the video matrix would be the largest one and the oldest instance would be the smallest one.

I’ve worked up a subpatch that can calculate the correct perspectival dimensions and output it as dstdimend and dstdimstart values for a jitter matrix. But in order to maintain the tunnel-like illusion, I need to be able to give different dimensions to each matrix.

Also, is there any jit object that can display multiple overlapping videos? I’ve been using jit.Lumakey but I don’t know if that’s appropriate to what I’m trying to do.

My patch right now is giant mess, but here it is if you’d like to take a look.

– Pasted Max Patch, click to expand. –

Thanks again.


March 22, 2011 | 9:54 pm

Your patch doesn’t work, something about a missing connection but i think i got the idea. How much layers of "depth" are you going to use? Plus what’s also important is the number of videofiles you’ll be using, i assume the jit.dx.grab was merely to present the idea?

I’m starving right now so i’m going to do some cooking but i’ll get back to you soon and see if i can help further.

Good luck,
FRid


March 22, 2011 | 10:03 pm

I was going to determine that after testing–but I’m thinking about 10-15 layers of depth with about 10-15 different video files.


March 23, 2011 | 2:37 am

I think this is somewhat the desired effect? So what’s left now is loading in the movies, blend them so they’ll display all at once. I am using jit.alphablend for this but i’m a little stuck setting up a proper matrix for the alpha-channel. (also check out jit.op)

Now regarding poly, in the examples-folder is a patch using poly~ to load in three different movies, however it will only display one of them at once (only one output). I think you can get around that by naming each jit.matrix inside the poly differently and send each matrix individually to the parent-patch by having a matrix with the same name in the parent patch.

FRid

– Pasted Max Patch, click to expand. –

March 24, 2011 | 3:44 am

Yup, this is exactly the kind of effect I’m looking for. I’m doing some experimenting with the js object to see if I can get the jit.qt.movie, jit.lumakeys instantiated and sorted dynamically. The idea is to have a new layer triggered by a user’s motion and possibly have the user control the distance between the layers.


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