[PD] can signal inlets that aren't the main inlet have float or message methods?

Derek Kwan derek.x.kwan at gmail.com
Sun Mar 27 07:21:59 CEST 2016


Hello,

Thanks for pointing me to the concept of proxy inlets.

I've tried to implement a test external using this code:
http://puredata.info/Members/mjmogo/proxy-example-for-pd.zip/view

In the linked code, they're basically making another class of type t_proxy:

typedef struct _proxy {
    t_pd l_pd;
    // if you want to maintain a pointer to your main class,
    // if not, besure to change the 'init' function
    void *yourclass;
} t_proxy;

This struct is declared as a member of the main class's struct:

typedef struct _yourclass {
    t_object x_obj;
    t_proxy pxy;
} t_yourclass;

and the new inlet is created in the "new" method of the main class
(yourclass_new) but with the destination pointing to the proxy rather than
the main class. This is done via:

inlet_new(&x -> x_obj, &x -> pxy.l_pd, 0, 0);
with no selectors passed. However, this only makes a control inlet.

Trying out:

inlet_new(&x -> x_obj, &x -> pxy.l_pd, &s_signal, &s_signal);
makes a signal inlet, but it seems like the signal values are only
accessible via the main class's dsp/perform methods and not via the
dsp/perform methods i tried to make for proxy (I call CLASS_MAINSIGNALIN in
both the setup of the main class and the proxy class). That's not a huge
deal, but I also declared a float method within proxy's setup via
class_addfloat(proxy_class, (t_method)proxy_post); where proxy_post just
posts to the pd window whenever it receives a float and this method only
seems to be called when I declare the inlet the first way with no selectors
(when it's a control inlet) and not the second way passing the signal
selectors (making it a signal inlet). In the second way, the float just
acts like a substitute for a signal (which is what I don't want).

My main goal is to have a second signal inlet that can also accept floats
not as a substitute for a signal but calls a separate method. Any ideas?
Thanks!

Derek
-- 

www.derekxkwan.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20160326/b3d0a105/attachment.html>


More information about the Pd-list mailing list