messy inlets

Aug 13, 2008 at 2:21pm

messy inlets

So a few of my granular externals seem to have inlet issues with Max messages. The messages do not change the parameter that is supposed to correspond to that inlet anymore.

I experienced it last week and before I could investigate, someone else emailed me about it today. Can someone take a look at the following code and tell me if something is wrong:

///

void grainstream_float(t_grainstream *x, double f)
{
if (x->x_obj.z_in == 0) // if inlet 1
{
x->next_grain_freq = f;
}
else if (x->x_obj.z_in == 1) // if inlet 2
{
x->next_grain_pos_start = f;
}
else if (x->x_obj.z_in == 2) // if inlet 3
{
x->next_grain_pitch = f;
}
}

/////

What happens is that I send something to inlet 2 and the parameter for inlet 3 is affected. Did something change in the SDK, because this used to work? The trouble is in 4.6 and 5, so not sure when the trouble started.

Thanks for any illumination.
–Nathan

#39262
Aug 13, 2008 at 2:43pm

Hey Nathan,

You should use proxy_getinlet() to get the inlet number in which a
message was received. Like so:
long inletnum = proxy_getinlet((t_object *)x);

Using the proxy_getinlet() function was the proper way to do this in
Max 4.6 as well. Let me know if that doesn’t get things fixed up for
you.
best,
Tim

On 2008 Aug 13, at 9:21 AM, nathan wolek wrote:

> So a few of my granular externals seem to have inlet issues with Max
> messages. The messages do not change the parameter that is supposed
> to correspond to that inlet anymore.
>
> I experienced it last week and before I could investigate, someone
> else emailed me about it today. Can someone take a look at the
> following code and tell me if something is wrong:
>
> ///
>
> void grainstream_float(t_grainstream *x, double f)
> {
> if (x->x_obj.z_in == 0) // if inlet 1
> {
> x->next_grain_freq = f;
> }
> else if (x->x_obj.z_in == 1) // if inlet 2
> {
> x->next_grain_pos_start = f;
> }
> else if (x->x_obj.z_in == 2) // if inlet 3
> {
> x->next_grain_pitch = f;
> }
> }
>
> /////
>
> What happens is that I send something to inlet 2 and the parameter
> for inlet 3 is affected. Did something change in the SDK, because
> this used to work? The trouble is in 4.6 and 5, so not sure when
> the trouble started.
>
> Thanks for any illumination.
> –Nathan
>
>
> –
> ——
> Nathan Wolek, PhD
> nathan@lowkeydigitalstudio.com
> http://www.lowkeydigitalstudio.com

#137940
Aug 13, 2008 at 7:31pm

I will try that when I get a chance and post back here. Thanks, Tim!

#137941

You must be logged in to reply to this topic.