Simple routing of data type?

Brian H.'s icon

Hi,
I'm wondering if there's a object or technique for taking any kind of input, determining its type, and sending it on to the appropriate outlet? For example, any int goes to outlet 1, signal to outlet 2, symbol to outlet 3, etc.

Thanks,
Brian

Brian H.'s icon

Ah! I must have missed that in the help file, thanks!

Tj Shredder's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Almost the same, but with a safe and elegant dsp part:

OCH's icon

should anyone else be looking at this in the future too: see typeroute~ object.

Roman Thilenius's icon


the second post probably aready contained the solution, but is gone now.

[route int float list]

"symbol" does not work, but you can use the forth outlet for it if you write the other three.

OCH's icon

@Roman what about signals?
I'm just geeking right now about message boxes in signal chains, haha...

Roman Thilenius's icon


the last out ("doesnt match") will output a mixed salad of symbols, signals, jitter matrixes / gl, and possibly (havent tried yet) mc connections.*)

if you need to sort that kind of stuff you would either need to prepend the signal with a symbol / name the jitter matrix - or know the names of jitter connections and symbols which will come in.

in my opinion, using custom index symbols for stuff which is sent to subpatchers is a good practice anyway, most of the time.

if you name your integer numbers, you can create different "subtypes" for your integers.

and if you name your signals and jitter connections you can use more than one of them, too, and send a complete set of R, G, B, A videoplanes and 5.1 audio together with midi notes and "dimension 0 0" style commands through a single connection in max.

*)
route will also route [tapin~] connections to the last outlet, but not [grab] connections.


Roman Thilenius's icon


the missing route help file ;)

route select

Roman Thilenius's icon

and to pass lists, use
route ... list ... -> router

OCH's icon

Did you just create this patch or were you actually somehow able to retrieve the second post?
if the latter, your "waybackmachine-like" skills are truly impressive :)
Thx

Roman Thilenius's icon

no i just made that new (i guess the missing post was from somebody who removed all of his posts)

Roman Thilenius's icon


oh i think i am wrong about nan/inf. no idea to test now but they prolly come out of int/float

LSka's icon

if you want to check for nan/inf, [spat5.isnan~] from Ircam's Spat package

Holland Hopson's icon

Thanks, Roman. I never knew about using named audio or matrixes via route. Looks very useful!

Jean-Francois Charles's icon

You can also use [typeroute~]. For matrices, another option is [routepass jit_matrix].