Apparently, this seems to be a pretty rare thing to want to do in pd, because nowhere can I find where someone has asked this question online. I come from a programming background, so the idea of instances of an object containing unique objects seems fairly reasonable to me (to convert to pd terms: abstractions containing unique subpatches).
In C++ for example, you can pass objects into other objects as arguments, or even types into objects. So you could have class X that contains variable Y for an object. In instance A of that class, you could pass in type int, and Y would be of type int. While, in instance B, you could pass in type string, and Y would be of type string.
I know this isn't a direct 1 to 1, but how do I achieve this sort of functionality in PD?
This kinda difficult to explain, so I'll do my best. This is my situation (btw I'm using plugdata):
I'm building a cue system for a performance. I would like to create a "cue.pd" abstraction as essentially a class from which an arbitrary number of instances can be made. Each instance needs to have it's own completely custom functionality. I understand that I could achieve this by just making "cue1.pd", cue2.pd", etc or [pd cue] multiple times. But that would mean I have to create the exact number of subpatches as cues, and that's unscalable and inelegant if I were to reuse this system in the future.
I have multiple instances of a "cue.pd" abstraction within "cue_sequencer.pd", each with a number passed in as it's first argument.
Within the "cue.pd" abstraction, I assumed that if I made a [pd impl-$0] subpatch, each subpatch within each instance would be unique, as it's name is unique.
But this is not the case, as the same subpatches with different names contained within different instances of "cue.pd" have the same contents.
How would I make it such that each instance of "cue.pd" can contain it's own completely unique subpatch? Or at least achieve the same effect with a different method.
Thanks !! :3