Forums > MaxMSP

Data routing

May 10, 2006 | 1:13 pm

Hello everyone,

Does anyone know if there is any way to route data in the same way you would signals, when using matrix~ and matrixctrl? I want to be able to route the data from a key object to one of four select objects. But the data needs to be routed to one at a time, with only one select object receiving the data at any given moment.

Can anyone help as i’ve nearly chewed my teeth out trying to work it out?

Cheers

Jay

Here is what I mean:

max v2;
#N vpatcher 15 55 757 641;
#P origin 0 26;
#P toggle 442 38 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 863 160 56 9109513 Turn off 1: L & 1: R;
#P comment 759 160 56 9109513 Turn on 2: L & 2: R;
#P comment 656 162 56 9109513 Turn off 2: L & 2: R;
#P window linecount 1;
#P comment 567 456 100 9109513 2: R Signal Out;
#P comment 554 472 100 9109513 2: L Signal Out;
#P comment 539 494 100 9109513 1: R Signal Out;
#P outlet 551 456 15 0;
#P outlet 538 472 15 0;
#P outlet 523 494 15 0;
#P outlet 509 510 15 0;
#P comment 604 336 52 9109513 R Signal In;
#P inlet 588 336 15 0;
#P inlet 523 336 15 0;
#P button 562 100 15 0;
#P button 509 109 15 0;
#P message 854 142 29 9109513 0 1 0;
#P message 824 142 29 9109513 0 0 0;
#P message 614 142 29 9109513 0 2 0;
#P message 647 143 29 9109513 0 3 0;
#P newex 509 70 116 9109513 route 0 1;
#P message 750 142 29 9109513 0 3 1;
#P message 720 142 29 9109513 0 2 1;
#P message 539 142 29 9109513 0 1 1;
#P message 509 142 29 9109513 0 0 1;
#P user matrixctrl 509 259 18 66 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 18 66 16 16 1 4 16 16 1 1 48 2 5120 0;
#P newex 509 377 66 9109513 matrix~ 2 4 1.;
#P comment 538 336 49 9109513 L Signal In;
#P comment 524 510 100 9109513 1: L Signal Out;
#P window linecount 5;
#P comment 577 378 205 9109513 2 Ins , 4 Outs , 1. enables soft switching. Matrix control object is in non-binary mode with 1. (third arguement) in place. The connections are gain stages , with the value set to 1. no gain loss occurs and no clicks are audible.;
#P window linecount 2;
#P comment 548 161 56 9109513 Turn on 1: L & 1: R;
#P toggle 94 386 15 0;
#P toggle 77 386 15 0;
#P toggle 60 386 15 0;
#P toggle 111 386 15 0;
#P window linecount 1;
#P newex 264 387 67 9109513 sel 37 14 0 49;
#P newex 196 369 67 9109513 sel 37 14 0 49;
#P newex 128 351 67 9109513 sel 37 14 0 49;
#P newex 60 333 67 9109513 sel 37 14 0 49;
#P number 291 146 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 276 116 40 9109513 key;
#P comment 80 82 100 9109513 Deck 4;
#P comment 80 66 100 9109513 Deck 3;
#P comment 80 50 100 9109513 Deck 2;
#P number 60 110 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 60 137 66 9109513 sel 0 1 2 3;
#P user radiogroup 60 34 18 64;
#X size 4;
#X offset 16;
#X inactive 0;
#X itemtype 0;
#X flagmode 0;
#X set 0;
#X done;
#P user gswitch2 180 246 39 32 1 0;
#P user gswitch2 140 246 39 32 1 0;
#P user gswitch2 100 246 39 32 1 0;
#P user gswitch2 60 246 39 32 1 0;
#P comment 80 34 100 9109513 Deck 1;
#P window setfont "Sans Serif" 18.;
#P window linecount 6;
#P comment 16 421 461 9109522 I want to be able to route the data from the key object to one of four select objects. But the data needs to be routed to one at a time , with only one select object receiving the data at any given moment , like the objects on the right highlighted by the red area (but this only works for signals , i think?).;
#P inlet 509 35 15 0;
#P user panel 486 22 444 549;
#X brgb 231 7 1;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P connect 9 0 4 0;
#P connect 4 0 16 0;
#P connect 16 0 21 0;
#P connect 16 1 22 0;
#P connect 15 0 4 1;
#P connect 16 2 23 0;
#P connect 16 3 20 0;
#P connect 5 0 17 0;
#P connect 15 0 5 1;
#P connect 15 0 6 1;
#P connect 6 0 18 0;
#P connect 15 0 7 1;
#P connect 7 0 19 0;
#P connect 14 1 15 0;
#P connect 1 0 34 0;
#P connect 54 0 34 0;
#P connect 34 0 39 0;
#P fasten 39 0 30 0 514 132 514 132;
#P fasten 38 0 29 0 859 221 514 221;
#P fasten 37 0 29 0 829 221 514 221;
#P fasten 36 0 29 0 619 221 514 221;
#P fasten 35 0 29 0 652 221 514 221;
#P fasten 33 0 29 0 755 251 514 251;
#P fasten 32 0 29 0 725 251 514 251;
#P fasten 31 0 29 0 544 251 514 251;
#P fasten 30 0 29 0 514 251 514 251;
#P connect 29 0 28 0;
#P fasten 41 0 28 0 528 364 514 364;
#P connect 28 0 44 0;
#P connect 28 1 45 0;
#P connect 28 2 46 0;
#P fasten 39 0 31 0 514 132 544 132;
#P connect 28 3 47 0;
#P connect 34 1 40 0;
#P fasten 42 0 28 1 593 364 570 364;
#P fasten 39 0 36 0 514 132 619 132;
#P fasten 39 0 35 0 514 132 652 132;
#P fasten 40 0 32 0 567 128 725 128;
#P fasten 40 0 33 0 567 128 755 128;
#P fasten 40 0 37 0 567 128 829 128;
#P fasten 40 0 38 0 567 128 859 128;
#P pop;


May 10, 2006 | 1:32 pm

router


May 10, 2006 | 1:34 pm

Router, in the standard distribution, or if your on a Mac, Panaiotis’ matrix will also do the job – it’s at:
http://members.aol.com/panaiotis/Projects/Max/MaxDocs/index. html

cheers
Roger


May 10, 2006 | 1:37 pm


May 10, 2006 | 1:39 pm

Just noticed that router is NOT part of the standard
distribution, but is in fact a Jitter object.
However, I think it’s one of those like jit.cellblock
that you can keep after the trial version of Jitter
runs out.
This info, btw, I gleaned from searching for the word
‘matrix’ at http://www.maxobjects com (‘cos i couldn’t
remember the name of router) – a top tip for any such
query,
cheers
Roger


May 10, 2006 | 1:42 pm

Sorry folks. Does router work in the same way as matrix~?

Edit:

Whoops. Thanks for the info folks. I have router and it does indeed work exactly as matrix~ for my needs. I can be so stupid! I did read the help file but it suggested that it didn’t so I gave up.

Thanks again

Jay


May 10, 2006 | 2:31 pm

Sorry guy, see help file and reference (Max reference).


May 10, 2006 | 2:32 pm


May 10, 2006 | 2:46 pm

While you’re checking the docs on "router", look for "forward" too. Routing
one source to one destination and having it variable its all you need.

-thijs


May 10, 2006 | 4:28 pm

Thanks for your help, i’ve got it working just fine for what I wanted. Here is the code if anyone is interested or needs it:

max v2;
#N vpatcher 15 55 615 455;
#P window setfont "Sans Serif" 9.;
#P comment 143 108 100 9109513 Deck 4;
#P comment 143 92 100 9109513 Deck 3;
#P comment 143 76 100 9109513 Deck 2;
#P user radiogroup 123 60 18 64;
#X size 4;
#X offset 16;
#X inactive 0;
#X itemtype 0;
#X flagmode 0;
#X set 0;
#X done;
#P comment 143 60 100 9109513 Deck 1;
#N vpatcher 15 55 926 701;
#P window setfont "Sans Serif" 9.;
#P number 91 377 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 76 347 40 9109513 key;
#P newex 77 450 60 9109513 s key_infoD;
#P newex 62 488 60 9109513 s key_infoC;
#P newex 49 526 59 9109513 s key_infoB;
#P newex 35 564 59 9109513 s key_infoA;
#P inlet 35 70 15 0;
#P button 452 176 15 0;
#P button 313 169 15 0;
#P message 545 222 29 9109513 0 3 1;
#P message 514 222 29 9109513 0 2 0;
#P message 483 222 29 9109513 0 1 0;
#P message 452 222 29 9109513 0 0 0;
#P message 406 222 29 9109513 0 3 0;
#P message 375 222 29 9109513 0 2 1;
#P message 344 222 29 9109513 0 1 0;
#P message 313 222 29 9109513 0 0 0;
#P message 267 222 29 9109513 0 3 0;
#P message 236 222 29 9109513 0 2 0;
#P message 205 222 29 9109513 0 1 1;
#P message 128 222 29 9109513 0 3 0;
#P message 97 222 29 9109513 0 2 0;
#P message 66 222 29 9109513 0 1 0;
#P message 174 222 29 9109513 0 0 0;
#P message 35 222 29 9109513 0 0 1;
#P number 35 104 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 77 433 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 63 470 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 49 508 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 35 546 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 35 409 66 9109513 router 1 4;
#P button 174 169 15 0;
#P button 35 169 15 0;
#P newex 35 130 566 9109513 route 0 1 2 3;
#P user matrixctrl 35 324 18 66 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 18 66 16 16 1 4 16 16 1 1 48 2 5120 0;
#P connect 28 0 9 0;
#P connect 9 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 10 0;
#P fasten 25 0 0 0 550 306 40 306;
#P fasten 24 0 0 0 519 306 40 306;
#P fasten 23 0 0 0 488 306 40 306;
#P fasten 22 0 0 0 457 306 40 306;
#P fasten 21 0 0 0 411 288 40 288;
#P fasten 20 0 0 0 380 288 40 288;
#P fasten 19 0 0 0 349 288 40 288;
#P fasten 18 0 0 0 318 288 40 288;
#P fasten 17 0 0 0 272 272 40 272;
#P fasten 16 0 0 0 241 272 40 272;
#P fasten 15 0 0 0 210 272 40 272;
#P fasten 11 0 0 0 179 272 40 272;
#P fasten 14 0 0 0 133 256 40 256;
#P fasten 13 0 0 0 102 256 40 256;
#P fasten 12 0 0 0 71 256 40 256;
#P fasten 10 0 0 0 40 256 40 256;
#P connect 0 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 29 0;
#P connect 4 1 6 0;
#P connect 6 0 30 0;
#P connect 7 0 31 0;
#P connect 4 2 7 0;
#P connect 2 0 12 0;
#P connect 4 3 8 0;
#P connect 8 0 32 0;
#P connect 33 1 34 0;
#P connect 34 0 4 1;
#P connect 2 0 13 0;
#P connect 2 0 14 0;
#P connect 1 1 3 0;
#P connect 3 0 11 0;
#P connect 3 0 15 0;
#P connect 3 0 16 0;
#P connect 3 0 17 0;
#P connect 1 2 26 0;
#P connect 26 0 18 0;
#P connect 26 0 19 0;
#P connect 26 0 20 0;
#P connect 26 0 21 0;
#P connect 1 3 27 0;
#P connect 27 0 22 0;
#P connect 27 0 23 0;
#P connect 27 0 24 0;
#P connect 27 0 25 0;
#P pop;
#P newobj 60 134 88 9109513 p keyboard_control;
#P connect 2 0 0 0;
#P pop;


May 10, 2006 | 4:47 pm


May 10, 2006 | 7:07 pm

In reply to the above:

Ermmmmmmm…… yes, yes it is!


May 10, 2006 | 7:15 pm

You know, you can set "only one cell per column" in the inspector for
the matrix object, and then the whole top portion of your patch is
unnecessary.

b


barry threw :: sound | (if you would see the stars clearly,
http://www.barrythrew.com | look hard at the surrounding darkness)
bthrew(at)gmail(dot)com | -Ooka Makoto
857-544-3967 |


May 10, 2006 | 8:39 pm

Thank you all. I have gone with the gate patch, as it’s nice and simple and does exactly what I need. Once again thank you.

Jay


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