Hi
I'm a bit confused about *exactly the diference is between throw/catch and send/recieve. Also what is the meaning of the $0-something I se somewhere in the examples (my guess is locally send/recieve, but nor sure)?
the way I see it is that send and receive are just ways of cross connecting signals/variables across your patch or abstraction without having to connect them up with 'messy' patch cords or inlets and outlets. you can have as many send and receive objects as you want if they are non-signal type. if they are signal type, then think about it: if you have two [send~ sig1] objects with two different signals connected to each inlet, then what will the [receive~ sig1] object see? so you can only have one signal-type [send~] object with any one name.
however, throw and catch work a bit differently. here, you CAN have two [throw~] objects with the same name, and the associated [catch~] object SUMS up the two different 'thrown' signals.
locality is defined by giving the send, receive, throw, catch objects different names. the $0 symbols you see are a way of restricting the locality: if you have mutliple copies of an abstraction with sends and receives and you don't want them interacting, you put $0 at the beginning of the name so they won't interact and become local to their respective abstractions. PD replaces (even though you don't see it) each with a specific name to each abstraction.
$1 and $2 etc are used to manually change the names via creation arguments, so $1 corresponds to the first creation argument of the patch. if I got anything wrong, please let me know....!
matt
-=-=-=-=-=-=-=-=-=-=-=-=- http://www.loopit.org/ -=-=-=-=-=-=-=-=-=-=-=-=- ----- Original Message ----- From: "Atte André Jensen" atte@ballbreaker.dk To: "pd mailing list" pd-list@iem.at Sent: Wednesday, August 20, 2003 1:58 PM Subject: [PD] throw/catch vs send/recieve
Hi
I'm a bit confused about *exactly the diference is between throw/catch and send/recieve. Also what is the meaning of the $0-something I se somewhere in the examples (my guess is locally send/recieve, but nor sure)?
-- peace, love & harmony Atte
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
atte,
catch~ sums the inputs from many instances of a throw~ object, while send~ and receive~ do the opposite: one send~ can go to many instances of the same receive~ object. it is an error to have two sends of the same name.
in short: many throws, one catch one send, many receives
of course, send and receive [without the ~] are for data, not audio, and if you tried to send many different messages through it at the same time, you would have to pack them. a throw/catch for a non-audio signal does not exist in PD.
does this help? derek
Quoting Atte André Jensen atte@ballbreaker.dk:
Hi
I'm a bit confused about *exactly the diference is between throw/catch and send/recieve. Also what is the meaning of the $0-something I se somewhere in the examples (my guess is locally send/recieve, but nor sure)?
-- peace, love & harmony Atte
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
This mail sent through IMP: http://horde.org/imp/
dollar signs can be used to pass creation arguments to objects within a patch.
thus [delwrite $1 $2] inside a patch named [mypatch 10 1000] is the same as [delwrite 10 1000]
for more info, check the documentation control examples: 14. dollarsigns
d.
Quoting Atte André Jensen atte@ballbreaker.dk:
Hi
I'm a bit confused about *exactly the diference is between throw/catch and send/recieve. Also what is the meaning of the $0-something I se somewhere in the examples (my guess is locally send/recieve, but nor sure)?
-- peace, love & harmony Atte
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
This mail sent through IMP: http://horde.org/imp/
Hallo, derek@x-i.net hat gesagt: // derek@x-i.net wrote:
dollar signs can be used to pass creation arguments to objects within a patch.
thus [delwrite $1 $2] inside a patch named [mypatch 10 1000] is the same as [delwrite 10 1000]
for more info, check the documentation control examples: 14. dollarsigns
Yes, but $0 is special in that it is replaced by a unique number for each abstraction (not for each subpatch!).
Also it is worth mentioning that argument passing like you described only works for abstractions (real *.pd-files) but can not be used for passing args to subpatches like [pd somesubpatch args]:
In [pd somesubpatch 10 1000] 10 and 1000 will simply get ignored.
Frank Barknecht _ ______footils.org__
Quoting Frank Barknecht fbar@footils.org:
Yes, but $0 is special in that it is replaced by a unique number for each abstraction (not for each subpatch!).
ok, now i am a bit confused ;-) how does this work? where does the variable for this $ come from then? d.
This mail sent through IMP: http://horde.org/imp/
Hallo, derek@x-i.net hat gesagt: // derek@x-i.net wrote:
Quoting Frank Barknecht fbar@footils.org:
Yes, but $0 is special in that it is replaced by a unique number for each abstraction (not for each subpatch!).
ok, now i am a bit confused ;-) how does this work? where does the variable for this $ come from then?
It's internal to Pd. I cannot test right now, but I think, that the first $0 used when Pd is running internally is replaced with 1000, the second with 1001 and so on. But this might change in the future. What is important is that $0 is really unique for an abstraction. I use this a lot to let patches have local values. For example, you can name a table $0-settings and then store local settings in it. The abstraction then can be used multiple times and still each one has their own settings table that does not interfere with the others. Also local send and receive is a common usage: [s $0-note] and [r $0-note] will not send globally through patch boundaries but only inside one abstraction.
Another trick, to end this list, is to combine $x-arguments and $0 together with makefilename. Say you want to give an argument to an abstraction but also use this for some local operations. You can then use:
[f $1] | [makefilename $0-%d] | ... do something with $0-$1
This can give headaches, but it's very cool sometimes. ;)
Frank Barknecht _ ______footils.org__