Forums > Dev

messy inlets

August 13, 2008 | 2:21 pm

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


August 13, 2008 | 2:43 pm

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


August 13, 2008 | 7:31 pm

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


Viewing 3 posts - 1 through 3 (of 3 total)