Hi,
I am just building one or two objects I have been wishing for and I have a quick question. Is it possible to set up an inlet (not the left most one though) to accept both a float and a list so that I can do one thing if I get one or another if I get the other?
how would I declare this?
cheers
mark
Sorry, you can only do that with great difficulty (build your own auxilliary "proxy" object that the inlet passes all messages to.) In general, the "inlet" idea was to use inlet position to specify functionality. However, for some objects like Max-style gate, you really have to do the proxy object thing.
Note that "float" is equivalent to a list with one element, so you may have trouble disambiguating the two even in the rightmost inlet in some cases...
cheers Miller
On Tue, Jan 29, 2002 at 04:06:51PM -0000, mark wrote:
Hi,
I am just building one or two objects I have been wishing for and I have a quick question. Is it possible to set up an inlet (not the left most one though) to accept both a float and a list so that I can do one thing if I get one or another if I get the other?
how would I declare this?
cheers
mark
Am Dienstag, den 29. Januar 2002 um 08:25:24 Uhr (-0800) schrieb Miller Puckette:
Sorry, you can only do that with great difficulty (build your own auxilliary "proxy" object that the inlet passes all messages to.) In general, the "inlet" idea was to use inlet position to specify functionality. However, for some objects like Max-style gate, you really have to do the proxy object thing.
I would like to know, how to implement the proxy, your're mentioning. I had the same problem, trying to mimik the list objects from Max/MSP like join and append. There is a way around that, like adding a "set" message at the left inlet to set the right part of the list which gets joined or appended. But I consider it being easier and clearer to read to send the right hand part of the list to the right inlet (apart from making it easier to port to and from MAX). And in this usage, inlet position actually marks functionality.
Or would you discourage to do that as it opposes some of the ideas behind pd?
Yours, Orm
Hi List With 35 -P8 audio closes after a few moments at the 11025 sampling rate. i use this rate frequently when using the vstPV dlls and plugin~ patch so the audio does not click after a few seconds pd sticks and closes audio also at 22050
35 -P7 does not exhibit the same behavior cheers Pat
HI Pat,
This is on Windows, right..?
cheers Miller
On Tue, Jan 29, 2002 at 04:44:33PM -0500, ppagano@bellsouth.net wrote:
Hi List With 35 -P8 audio closes after a few moments at the 11025 sampling rate. i use this rate frequently when using the vstPV dlls and plugin~ patch so the audio does not click after a few seconds pd sticks and closes audio also at 22050
35 -P7 does not exhibit the same behavior cheers Pat
hi Orm,
append (and prepend) has only one inlet, and I do not know about join. But anyway having other than leftmost inlet to accept various messages is not that difficult. To give you a clue how this may be done, here is an excerpt from my `spying' code:
static void *spy_new(...) { t_spy *x = (t_spy *)pd_new(spy_class); t_spy *x1 = (t_spy *)pd_new(s2y_class); /* proxy for 2nd inlet messages */ ... (there are more...)
/* here goes something like: x->x_shadow = x1 */ inlet_new(&x->x_ob, &x1->x_ob.ob_pd, 0, 0); /* create 2nd inlet */ ... }
static void spy_free(t_spy *x) { ... /* here goes something like: x1 = x->x_shadow */ pd_free(&x1->x_ob.ob_pd); /* this has to be done explicitly */ ... }
void spy_setup(void) { ... spy_class = class_new(gensym("spy"), (t_newmethod)spy_new, (t_method)spy_free, sizeof(t_spy), 0, ..., 0); ... s2y_class = class_new(gensym("spy (second inlet)"), 0, 0, sizeof(t_spy), /* this may need to be changed */ CLASS_PD | CLASS_NOINLET, 0); ... class_addmethod(spy_class, ... ... class_addmethod(s2y_class, ... ... }
Krzysztof
Orm Finnendahl wrote: ...
I would like to know, how to implement the proxy, your're mentioning. I had the same problem, trying to mimik the list objects from Max/MSP like join and append. There is a way around that, like
Hi Krzysztof,
thanks a lot for the code (and the comments!). That's not too complicated. I'll probably go ahead and implement both ways to do it (the general list-ops and the more specific objects as it is more or less the same code just rearranged).
Orm
Am Mittwoch, den 30. Januar 2002 um 14:38:16 Uhr (+0100) schrieb Krzysztof Czaja:
hi Orm,
append (and prepend) has only one inlet, and I do not know about join. But anyway having other than leftmost inlet to accept various messages is not that difficult. To give you a clue how this may be done, here is an excerpt from my `spying' code:
static void *spy_new(...) { t_spy *x = (t_spy *)pd_new(spy_class); t_spy *x1 = (t_spy *)pd_new(s2y_class); /* proxy for 2nd inlet messages */ ... (there are more...)
/* here goes something like: x->x_shadow = x1 */ inlet_new(&x->x_ob, &x1->x_ob.ob_pd, 0, 0); /* create 2nd inlet */ ... }
static void spy_free(t_spy *x) { ... /* here goes something like: x1 = x->x_shadow */ pd_free(&x1->x_ob.ob_pd); /* this has to be done explicitly */ ... }
void spy_setup(void) { ... spy_class = class_new(gensym("spy"), (t_newmethod)spy_new, (t_method)spy_free, sizeof(t_spy), 0, ..., 0); ... s2y_class = class_new(gensym("spy (second inlet)"), 0, 0, sizeof(t_spy), /* this may need to be changed */ CLASS_PD | CLASS_NOINLET, 0); ... class_addmethod(spy_class, ... ... class_addmethod(s2y_class, ... ... }
Krzysztof
Orm Finnendahl wrote: ...
I would like to know, how to implement the proxy, your're mentioning. I had the same problem, trying to mimik the list objects from Max/MSP like join and append. There is a way around that, like