set route?

teqy's icon

hi all : )

Is there an object like route or a method that can have its argument changed or set with a message box?

eg: (route this) can be changed to > (route that) with a message box (set that) ?

thanks for your help :)

Roman Thilenius's icon

it works with "set foo" when [route] has only one argument, otherwise you
could use [if] for up to eight arguments (but with a maximum of only 2 possible
outlets to choose from.)

my way is to make an abstraction with 8 or more [route] with no arguments
and then use 8 set messages into the 8 right inlets.

in case you need to work with symbols, [zl] is your friend to build all kind of
comparing and routing abstractions, of course including a potion of [gate]
and the like.

-110

Chris Muir's icon

In Max 6, route has an inlet for each output so that you can set them independently.

teqy's icon

hi thanks

not sure how 'set foo' works , i am on max 5, so i am trying to use (if)

here is my problem:

I have a stream of numbers 4,2,7,0,5,6,7,8,9,

these are given a (prepend) for example the letter 'h' so it becomes:

h 4, h 2, h 7, h 0, h 5, h 6, h 7, h 8, h 9,

with route ,I could simply say (route h)

And I would get my number stream back again on the otherside of udp port. The idea is to stream multiple channels of numbers through a single udp port prepending them a,b,c,d,e,f,g,and so on. hundreds of them.

but on max 5 I cannot change route from 'h' to 'i' or 'j' when need be, to be able to do that via a message box would be great.

so (if) might work, but I am having trouble finding the correct wording.

i thought.

(if $i1 == $i2 then $i2 ) $i1 being ht stream of numbers and $i2 being 'h' or 'i' or 'j'

but no luck so far.

hope this make sense.

: )

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This requires [strcmp] from the Jasch objects:

It's funny how clunky Max 5 feels after living in Max 6 for a while.

teqy's icon

wow, thanks so much Chris , I shall try this out asap.

: P , : )

teqy's icon

real nice bit of patching : )

well done, even for knowing about the module, and then bringing it all together to make it work just like route, with the ability to assign from a msg box : )

Cool. thank you : P

Roman Thilenius's icon

"but on max 5 I cannot change route from 'h' to 'i' or 'j' when need be, to be able to do that via a message box would be great."

well it should work with "set i", but if you dont have the balls to try it (or to look in the reference) ...

Chris Muir's icon

Roman, I don't think that route accepts a set message. Did _you_ try it or look at the reference?

Roman Thilenius's icon

my bad, sorry: memory error in 110.brain!

that was not [route] but [select], and it is not a set messag, it is just an extra inlet.

but you must admit that i was close!

and the other 15 people i have been telling this since 2001 did never complain.

-110

p.s. ah, i know why that happened. back in the days when you were changing a
select to a route object, it sometimes kept that extra inlet - and then it "didnt work"!

teqy's icon

Roman yes, close again : )

I tried (select) and (route) and loads of other things,

you mention (select) but it appears to have an extra inlet to 'set' numeric values, not letters/words from a message box, hence I needed help. Maybe check your reference as my max 5 doesn't mention it. are you on max 6 or 4? or maybe your on a mac?

Anyway, problem was resolved thanks to Chris's clever tweak. maybe you didn't see that before you posted? check it out, its really cool.

incidentally, chris's idea will work with (strcmp2) also, if you do not have (strcmp).

peace :)

broc's icon

You can use [zl compare] instead of [strcmp]. So there is no external needed.

teqy's icon

thanks : )