Hello list,
I am working with messages to create objects inside a patch, I think I have solved the creation of the objects, but I don't know how to connect them. When I create an object, its "number" depends on the objects created before, and the order of creation, how can I know what is the number of a certain object?
With number I mean the fields A and B in the message [connect A X B Y( , I already know what A, B, X and Y are, but I don't know how to know A and B, for the objects I want to connect.
Do you know what other things can I modify in a patch through messages?
Thanks,
Ricardo D.
On Tue, 2008-08-05 at 19:18 -0500, Ricardo Dueñas Parada wrote:
Hello list,
I am working with messages to create objects inside a patch, I think I have solved the creation of the objects, but I don't know how to connect them. When I create an object, its "number" depends on the objects created before, and the order of creation, how can I know what is the number of a certain object?
With number I mean the fields A and B in the message [connect A X B Y( , I already know what A, B, X and Y are, but I don't know how to know A and B, for the objects I want to connect.
Do you know what other things can I modify in a patch through messages?
dynamic object creation is not yet officially supported and probably therefore not well documented.
the only way to know the number id of each object is by implementing a reference counter yourself, that counts up by one each time you create an object. however, this will get quite tricky as soon as you start to remove objects, because then need to keep track, _which_ object you removed.
personally, i recommend to not bother with 'connect' messages at all, but to use [send]s and [receive]s (and their tilde counterparts) in your dynamically created abstractions. it makes dynamic creation much more feasible and labelling stays consistent, even when removing objects.
afaik, there is a section called pd-msg-05 somewhere in the help browser of pd-extended, that has a list and examples of messages to pd and canvasses.
roman
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
Roman Haefeli wrote:
On Tue, 2008-08-05 at 19:18 -0500, Ricardo Dueñas Parada wrote:
Hello list,
I am working with messages to create objects inside a patch, I think I have solved the creation of the objects, but I don't know how to connect them. When I create an object, its "number" depends on the objects created before, and the order of creation, how can I know what is the number of a certain object?
With number I mean the fields A and B in the message [connect A X B Y( , I already know what A, B, X and Y are, but I don't know how to know A and B, for the objects I want to connect.
Do you know what other things can I modify in a patch through messages?
dynamic object creation is not yet officially supported and probably therefore not well documented.
But isn't that how all pd patches get loaded, sending the lines of the pd file t pd?
anyway, I can also recommend [dyn] for doing stuff like that. osx and windows binaries at http://grrrr.org/ext/beta/pd/ marius.
the only way to know the number id of each object is by implementing a reference counter yourself, that counts up by one each time you create an object. however, this will get quite tricky as soon as you start to remove objects, because then need to keep track, _which_ object you removed.
personally, i recommend to not bother with 'connect' messages at all, but to use [send]s and [receive]s (and their tilde counterparts) in your dynamically created abstractions. it makes dynamic creation much more feasible and labelling stays consistent, even when removing objects.
afaik, there is a section called pd-msg-05 somewhere in the help browser of pd-extended, that has a list and examples of messages to pd and canvasses.
roman
___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
dynamic object creation is not yet officially supported and probably therefore not well documented.
i like the frivolous use of "yet".
But isn't that how all pd patches get loaded, sending the lines of the pd file t pd?
well yes, but this doesn't mean much here. someone might change the way Pd builds a patch from a file. or change the fileformat.
being inofficial/unsupported doesn't meant that it does not work. it means that it is your (the user's) fault if it stops working in future versions.
fgamdr IOhannes
an object. however, this will get quite tricky as soon as you start to remove objects, because then need to keep track, _which_ object you removed.
Yes it is, at certain point, I don´t know which have I erased.
I found the help patch about creating new abstractions through messages, and it was really helpful, but I couldn't use [dyn~], I copied it to the respective folder, and when I try to create, pd says:
dyn~ 0.1.2 - dynamic object management, (C)2003-2006 Thomas Grill
dyn~ - Syntax: dyn~ sig-ins msg-ins sig-outs msg-outs dyn~ ... couldn't create
any idea?
Thanks for your answers
Ricardo D.
dynamic object creation is not yet officially supported and probably therefore not well documented.
i like the frivolous use of "yet".
But isn't that how all pd patches get loaded, sending the lines of the pd file t pd?
well yes, but this doesn't mean much here. someone might change the way Pd builds a patch from a file. or change the fileformat.
being inofficial/unsupported doesn't meant that it does not work. it means that it is your (the user's) fault if it stops working in future versions.
fgamdr IOhannes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Am 06.08.2008 um 16:08 schrieb Ricardo Dueñas Parada:
I found the help patch about creating new abstractions through
messages, and it was really helpful, but I couldn't use [dyn~], I copied it to
the respective folder, and when I try to create, pd says:dyn~ 0.1.2 - dynamic object management, (C)2003-2006 Thomas Grill
dyn~ - Syntax: dyn~ sig-ins msg-ins sig-outs msg-outs dyn~ ... couldn't create
any idea?
Yes, you need to specify the number of inputs and outputs, as
demonstrated in the help patch.
e.g.
[dyn~ 0 1 0 1] for having one message input, one message output and no
signal IO.
gr~~~
-- Thomas Grill http://grrrr.org
Ricardo Dueñas Parada wrote:
an object. however, this will get quite tricky as soon as you start to remove objects, because then need to keep track, _which_ object you removed.
Yes it is, at certain point, I donŽt know which have I erased.
I found the help patch about creating new abstractions through messages, and it was really helpful, but I couldn't use [dyn~], I copied it to the respective folder, and when I try to create, pd says:
dyn~ 0.1.2 - dynamic object management, (C)2003-2006 Thomas Grill
dyn~ - Syntax: dyn~ sig-ins msg-ins sig-outs msg-outs dyn~ ... couldn't create
any idea?
try to give arguments for inlets and outlets, be precise, whether you want signal in/outs or message in/outs. the syntax is [dyn~ 1 2 3 4]
don't be scared of the syntax, basically you give every object a name/id, and that lets you delete the objects without knowing the order, in which you created them. marius.