[PD] simple dynamic instancing and connection of abstractions

João Pais jmmmpais at gmail.com
Wed Dec 8 16:13:52 CET 2021

I'm not an expert, but here some loose pointers (no pun intended) on 
this topic which might or might not fit into your concept:

- I use only pd's internal messaging, not the iem libraries for it, 
which probably allow for more interesting things.

- have a look at [jmmmp/dacm~] (dynamic) and [jmmmp/dacc~] (not dynamic) 
for very simple concepts on connecting to audio output. The problem with 
internal messages is that you have to know exactly what is the number/ID 
of the object if you want to make connections between objects. I'm not 
sure now if the ID always increases in each session, even if objects 
created before are deleted, or if the ID adjusts to how many objects are 
active - probably the latter.

- I have deleted objects with dynamic messages by simulating mouse 
actions (click and drag, then delete). Not very user-friendly.

- when creating objects, I usually put them into a subpatch dedicated 
for that, which can be reset with [clear(. But won't be possible in your 
case, if you want to delete some objects and keep others.

- instead of using dynamic connections, consider using $x arguments in 
your abstractions for send/receive variables instead. Probably easier to 

- an option could be for the patch to have all objects inside it (no 
more dynamic patching needed), and make the connections by dynamic 
routing instead.


> hi folks, since Alexander was just covering dynamic patching in PD on 
> the puredata.info <http://puredata.info> site i thought i might 
> inquire about options for dynamic patching. i've perused a few 
> libraries like iemguts, and a new one called clj-puredata using 
> Clojure. i sent this to the dev about my use case and i thought i'd 
> post it here for some advice:
> i want the player/user to be able to dynamically add or remove 
> instruments from a patch that is already loaded, in a live performance 
> situation.
> i'm planning to have a master module patch with 8 slots for 8 
> instruments with approximately 10 control inlets and 2 signal outlets. 
> i have currently 3 unique instruments to load, and planning on more. 
> all of the instruments have exactly the same amount of inlets/outlets. 
> all i need to do is load them up, hook the I/O up to the slot, and 
> delete them when desired. the instruments will be abstractions, not 
> subpatches.
> i would just need a way for the slot to know when an abstraction is 
> loaded or deleted. i can uniquely name each slot if that would work 
> better for this, though i could probably have a flag, number or string 
> indicating what state the slot is in - like 'add', 'remove', 'active' 
> and 'disabled' or whatever.
> i have briefly watched a bit of the Youtube video on dynamic patching, 
> but rather than roll my own i thought i'd inquire about libraries or 
> externals that could handle it. i think iemguts can handle the 
> querying it seems, but the docs don't make it clear how objects 
> (abstractions) are instanced and deleted or connected. i don't need to 
> move anything - just load and connect an abstraction directly under a 
> slot or delete it. any help appreciated!
> scott
> _______________________________________________
> Pd-list at lists.iem.at  mailing list
> UNSUBSCRIBE and account-manageme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20211208/a003b76a/attachment.htm>

More information about the Pd-list mailing list