dynamically create / spawn subpatch

levky's icon

is it possible to dynamically create a spawn in real-time a subpatch? I am looking into maybe creating a effect and house it under a subpatch and want to dynamically spawn the subpatch in real-time. Not exactly sure how this can be done.

thanks.

dtimns's icon

you could use poly~ and then have up to 1023 instances spawned. you can shut the DSP off for poly~ so it's not really an "MSP" object as well.

MuShoo's icon

It's certainly possible - and I'm not sure Poly~ will work for what you want, as they'll all be instances of the SAME subpatch. Scripting of [thispatcher] would be able to do it, but the routing will be... interesting. Essentially, you'll need to make an abstraction, saved in your search path, and then you can script [thispatcher] to create an instance of that abstraction. Routing and connections could also be scripted, or you could probably do some magic with [send] and [receive].