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?
Many thanks,
Jonny Martyr _________________________________________________________________ Telly addicts unite! http://www.searchgamesbox.com/tvtown.shtml
it is possible, but it is tricky. another way would be to turn on and off connections with spigot or switch~. anyways, what you want is documented in help - browser - manuals/pd-msg (if you have pd-extended). here's the short version: put all your dynamically created objects in a subpatch outside the subpatch create an object [send pd-mysubpatch] to wich you send all you commands as messages. obj 100 100 metro 999 will create a new object at position 100/100. all your objects get index numbers and you connect 2 objects with connect ID1 OUTLET1 ID2 INLET2 for example connect 0 0 1 0 will connect the first objects first outlet (start counting with 0) to the second's object first inlet. the difficult part is to keep track of your ID numbers, esp. when you add or delete objects. if not, then it should be easy... marius.
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?
Many thanks,
Jonny Martyr
Messenger on the move. Text MSN to 63463 now! <http://mobile.uk.msn.com/pc/messenger.aspx >
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
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
#N canvas 386 22 600 572 10; #N canvas 17 28 355 263 sub 0; #X restore 43 42 pd sub; #X msg 43 452 ; pd-sub clear; #X msg 42 282 ; pd-sub loadbang; #X floatatom 43 117 5 0 0 0 - - -; #X obj 75 174 * 20; #X obj 43 134 t f f f; #X obj 43 154 makefilename pd-%d-subsub; #X obj 43 194 pack s f f; #X msg 43 214 ; pd-sub obj 10 $2 pd $3-subsub ; $1 obj 10 10 foo $3; #X obj 43 385 makefilename pd-%d-subsub; #X msg 43 407 ; $1 clear; #X floatatom 43 366 5 0 0 0 - - -; #X text 43 15 add and remove abstractions; #X msg 40 91 1; #X msg 80 91 2; #X msg 116 91 3; #X text 168 91 a) create some subsubpatches and abstractions; #X text 166 286 b) if your abstractions use loadbang you have to do that manually; #X msg 40 341 1; #X msg 80 341 2; #X msg 116 341 3; #X text 161 458 (clear pd-sub before saving this patch); #X text 161 340 c) clear subsubpatch where your abstractions are; #X text 47 514 d) if your abstraction have a gui inside that you want to vis sepparately you use either namecanvas or put the gui in an subpatch [pd $1-something] and use an arguemnt as id to refenrence the subpatch ; #X connect 3 0 5 0; #X connect 4 0 7 1; #X connect 5 0 6 0; #X connect 5 1 4 0; #X connect 5 2 7 2; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 9 0 10 0; #X connect 11 0 9 0; #X connect 13 0 3 0; #X connect 14 0 3 0; #X connect 15 0 3 0; #X connect 18 0 11 0; #X connect 19 0 11 0; #X connect 20 0 11 0;