MSP object with no audio inlets or outlets
here I am stumbling upon something that I thought I knew, but seemingly I don’t… I need to write an UI MSP object with no audio inlets or outlets. The only reason why it needs to be an MSP object is because I need to retrieve the sampling rate… exactly like filtergraph~ does it.
So in my new_method I write:
obj->inletnum = 0;
obj->proxy = proxy_new((t_object *)x, 1, &x->inletnum);
dsp_setupjbox((t_pxjbox *)x, 0);
x->out = listout((t_object *)x);
This should give me 2 non-audio proxy inlets and 1 list outlet, and it does…
Problem is that in my dsp method I need to write something like:
void myobj_dsp(t_myobj *x, t_signal **sp, short *count)
x->samplerate = sp->s_sr;
and at this point Max crashes.
So my question is do I need to instantiate a dummy signal inlet or outlet in order to retrieve the sampling rate from the t_signal structure ?
If I write:
dsp_setupjbox((t_pxjbox *)x, 1);
then everything works fine.
Is there a reason you don’t want a dummy signal inlet? As far as I’m aware, a signal inlet is a proxy anyway, so you can retrieve max messages through it
Will this not work? :
1 – create only one proxy inlet and a signal in
2 – don’t tell anyone that it’s an audio inlet
Someone can connect a signal to the input without it complaining, but that’s probably true anyway. Check this example:
----------begin_max5_patcher---------- 362.3ocqSsraCCBD7L9q.wY2HiccaRu0uipnJBljPkMXYHp4gR+1KrXxiJ6l pndYM6vJ1Ylc8gDDYgdqvPvufeCiPGRPH.xCf5yQjF1VdMy.kQD6YU7uHogq jU.ndwGOTDwTaZjpZgEpm1C1xr70R0p26DbaneEEYSxRwyf3ikwHd942QuwF en7dz.jcWqH7JDibkhUSROcBO2W4wjDeH8OJKk3SmHhRvJ1Bjjv2wqECo17H 1RsxpXM.aHu1I8TY.eHebeHuDzNMC9TLCRlNpQPunwF4dnwTuG969yc4JKk0 VQ2pNV65gLA5fRc5sk5TXlmW9DjkOtXedLUUKMV+LeYslcqCwZkJGMN0mf1t xRMBa.MzDG2JczK0evubBjlBLeh6BHcjvUtMzSGKT+7OMvg73WOBL5Mc7nP6 W1vmcnJgwJULqTqtnF2r.SOUyZYUk.tNtWzHqZ0NGnmBirN7eynr6jQtjiIe CTWNRLM -----------end_max5_patcher-----------
Turn audio on – check max window – no complaints.
Looks like this is the way to do this!
No, I have no problem with creating a signal inlet.
However, I want to make sure that’s the proper way you handle the situation in this case. Even if the dummy inlet makes it work maybe I am overlooking something else and there is a way to make it work without signal inlets or outlets at all. This would be the preferred way since it doesn’t make sense that any signals are allowed to connect.
However it might turn out being a feature since – as I read your reply to the previous thread – we can then force DSP chain order this way… Just thinking out loud…
You’re probably right that the one dummy inlet is the way to go…
Forums > Dev