[PD] Dynamic Object Connections through OSC

Enrique Erne enrique at netpd.org
Thu Feb 21 02:07:20 CET 2008


Jonny Martyr wrote:
> Hi there, I'm new to this mailing list and I have a question 
> regarding dynamically connecting objects together using OSC 
> commands. I would appreciate any help that anyone can provide.
>  
> Essentially I am building a Flash application in which the 
> user can connect together different blocks to build synths, 
> much like a simplified version of PD. I am able to pass messages 
> between Flash and PD using OSC, and so can dynamically create 
> objects and edit their parameters from Flash. However, I do not 
> know how to create the connections between the various objects 
> in PD without actually drawing them manually.
>  
> Does anyone know of a way around this? Possibly using send 
> and receive commands?


Hi Jonny

i have good experience with dynamically created and chained abstraction 
that talk to each other. im using [send], [receive], [send~], [receive~] 
inside the abstractions. i.e. a [notes] abstraction triggers [waveform~] 
and [envelope~] the output goes down to a [delay~] abstraction and so on.

you could receive the commands from flash and use them to dynamically 
create abstractions. give each abstraction an ID as argument. use 
something like:

[addmorefunk id-12]

and inside:

[r $1-r]
|
[r~ dummy-send]
|
[pd addfunk]
|
[s~ $1-s]

now you can tell your abstraction where to listen with the setable 
receive~ i.e. [;id-12-r set id-11-s( would connect/listen to the last 
created abstraction. a [s~ dummy-send] should prevent from
error: receive~ no matching send

see how abstractions can be created dynamically Help/mauals/pd-msg/ or 
[dyn~] in pd-extended. don't forget to send a [loadbang band( to the abs 
after creation. if you need to remove abstractions you have to keep each 
created abs in it's own subpatch to clear it later. see attached patch.

good luck eni


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: addnremoveabs.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080221/dc4ec81b/attachment.txt>


More information about the Pd-list mailing list