Forums > MaxMSP

A select that works like route


November 12, 2008 | 10:04 am

Hello,

I am still novice with Max, and I would need some help. I have searched for a solution for some hours, and now I really don’t know how to do:

I have a regexp objects that decodes several matches from a udpreceive stream of data.
I would like to filter this stream from the first number of the list. To do that I would use a route object ("route 1" for example) and let the data go through the rest of the patch.

However, I would like to be able to choose the number I use as a criteria in the route object, and I have not found any solution to do so.

The select object would be ideal for me as I can plug a umenu and let the user select a number from 1 to 4.

So my question is: what would be a working equivalent of a route object with a variable argument triggered by a umenu?

Thank you very much for your help!

Best Regards,
Camille


f.e
November 12, 2008 | 10:35 am

November 12, 2008 | 10:42 am

That is a fast answer, thanks !
However I forgot to mention that I need a generic way to do this (without third-party externals).

Thanks again for this suggestion.

Best,
Cam

November 12, 2008 | 10:46 am

ok, I got it.
the code is in the abstraction, very cool.
I think I got my solution.

Best,
Cam


f.e
November 12, 2008 | 11:06 am

November 12, 2008 | 12:02 pm

Fredrik’s abstraction will work because you’re using numbers as the route destination, however if you’re interested in using anything as the route destination then this abstraction will help. It dynamically recreates an internal [route] object with your desired arguments.

lh

lh.route.maxpat:

– Pasted Max Patch, click to expand. –

lh.route.maxhelp:

– Pasted Max Patch, click to expand. –
November 12, 2008 | 7:38 pm

very clever, thanks !!!

November 13, 2008 | 2:02 am

And here’s a single destination version using the [zl] objects.

lh

– Pasted Max Patch, click to expand. –
November 13, 2008 | 4:52 am

– Pasted Max Patch, click to expand. –

On Nov 12, 2008, at 2:04 AM, Camille Troillard wrote:

>
> Hello,
>
> I am still novice with Max, and I would need some help. I have
> searched for a solution for some hours, and now I really don’t know
> how to do:
>
> I have a regexp objects that decodes several matches from a
> udpreceive stream of data.
> I would like to filter this stream from the first number of the
> list. To do that I would use a route object ("route 1" for example)
> and let the data go through the rest of the patch.
>
> However, I would like to be able to choose the number I use as a
> criteria in the route object, and I have not found any solution to
> do so.
>
> The select object would be ideal for me as I can plug a umenu and
> let the user select a number from 1 to 4.
>
> So my question is: what would be a working equivalent of a route
> object with a variable argument triggered by a umenu?
>
> Thank you very much for your help!
>
>
> Best Regards,
> Camille

May 27, 2011 | 3:23 am

Old thread, found it in a google search. If anyone else is searching for the same thing (a route with a single dynamic string argument), I modified Barry’s patch above to work with non-numbers:

– Pasted Max Patch, click to expand. –
Viewing 10 posts - 1 through 10 (of 10 total)

Forums > MaxMSP