Completly unpacking matrixctrl

Apr 1, 2007 at 10:04am

Completly unpacking matrixctrl

Hi all,

is there a way of unpacking each column of each row in a matrixctrl?

I’ve attached a patch to give you an idea of what i need.

Thank you
Chris

max v2;
#N vpatcher 20 74 1024 711;
#P window setfont “Sans Serif” 9.;
#P window linecount 4;
#P comment 542 282 100 196617 If two columns are selected on a row then it cancels out the toggle;
#P number 130 203 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 512 456 277 196617 route 1 2 3 4 5 6 7 8;
#P newex 512 430 29 196617 gate;
#P button 724 501 15 0;
#P button 691 501 15 0;
#P button 658 501 15 0;
#P button 625 501 15 0;
#P newex 724 478 29 196617 gate;
#P newex 691 478 29 196617 gate;
#P newex 658 478 29 196617 gate;
#P newex 625 478 29 196617 gate;
#P button 592 502 15 0;
#P button 559 502 15 0;
#P button 526 502 15 0;
#P button 493 502 15 0;
#P newex 592 479 29 196617 gate;
#P newex 559 479 29 196617 gate;
#P newex 526 479 29 196617 gate;
#P newex 493 479 29 196617 gate;
#P newex 63 447 277 196617 route 1 2 3 4 5 6 7 8;
#P toggle 475 292 15 0;
#P toggle 457 292 15 0;
#P toggle 439 292 15 0;
#P toggle 421 292 15 0;
#P toggle 403 292 15 0;
#P toggle 385 292 15 0;
#P toggle 367 292 15 0;
#P toggle 349 292 15 0;
#P newex 349 262 156 196617 route 0 1 2 3 4 5 6 7;
#P newex 63 421 29 196617 gate;
#P newex 507 262 47 196617 route 0 1;
#P toggle 525 292 15 0;
#P toggle 507 292 15 0;
#P button 275 495 15 0;
#P button 242 495 15 0;
#P button 209 495 15 0;
#P button 176 495 15 0;
#P newex 275 471 29 196617 gate;
#P newex 242 471 29 196617 gate;
#P newex 209 471 29 196617 gate;
#P newex 176 471 29 196617 gate;
#P button 143 496 15 0;
#P button 110 496 15 0;
#P button 77 496 15 0;
#P button 44 496 15 0;
#P newex 143 472 29 196617 gate;
#P newex 110 472 29 196617 gate;
#P newex 77 472 29 196617 gate;
#P newex 44 472 29 196617 gate;
#P user matrixctrl 462 120 132 36 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 132 36 16 16 8 2 16 16 2 2 56 2 0 0;
#P number 552 233 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 507 233 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 462 233 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 462 204 101 196617 unpack 0 0 0;
#P number 82 278 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 82 200 15 0;
#P newex 82 226 58 196617 metro 700;
#N counter 1 8;
#X flags 0 0;
#P newobj 82 251 66 196617 counter 1 8;
#P window linecount 4;
#P comment 249 278 100 196617 If two rows are selected of a column then it cancels out the toggle;
#P fasten 31 0 10 0 354 389 49 389;
#P connect 10 0 14 0;
#P fasten 26 0 29 0 512 361 68 361;
#P connect 29 0 39 0;
#P connect 39 0 10 1;
#P fasten 32 0 11 0 372 389 82 389;
#P connect 11 0 15 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 4 0 29 1;
#P connect 39 1 11 1;
#P fasten 33 0 12 0 390 389 115 389;
#P connect 12 0 16 0;
#P connect 39 2 12 1;
#P connect 58 0 2 1;
#P fasten 34 0 13 0 408 389 148 389;
#P connect 13 0 17 0;
#P connect 39 3 13 1;
#P fasten 35 0 18 0 426 389 181 389;
#P connect 18 0 22 0;
#P connect 39 4 18 1;
#P fasten 36 0 19 0 444 389 214 389;
#P connect 19 0 23 0;
#P connect 39 5 19 1;
#P fasten 37 0 20 0 462 389 247 389;
#P connect 20 0 24 0;
#P connect 39 6 20 1;
#P fasten 38 0 21 0 480 389 280 389;
#P connect 21 0 25 0;
#P connect 39 7 21 1;
#P connect 6 0 30 0;
#P connect 30 0 31 0;
#P connect 30 1 32 0;
#P connect 30 2 33 0;
#P connect 30 3 34 0;
#P connect 30 4 35 0;
#P connect 30 5 36 0;
#P connect 30 6 37 0;
#P connect 9 0 5 0;
#P connect 5 0 6 0;
#P connect 30 7 38 0;
#P fasten 31 0 40 0 354 389 498 389;
#P connect 40 0 44 0;
#P connect 5 1 7 0;
#P connect 7 0 28 0;
#P fasten 28 0 26 0 512 289 512 289;
#P fasten 27 0 56 0 530 361 517 361;
#P connect 56 0 57 0;
#P connect 57 0 40 1;
#P connect 28 1 27 0;
#P fasten 32 0 41 0 372 389 531 389;
#P connect 41 0 45 0;
#P fasten 4 0 56 1 87 361 536 361;
#P connect 57 1 41 1;
#P connect 5 2 8 0;
#P fasten 33 0 42 0 390 389 564 389;
#P connect 42 0 46 0;
#P connect 57 2 42 1;
#P fasten 34 0 43 0 408 389 597 389;
#P connect 43 0 47 0;
#P connect 57 3 43 1;
#P fasten 35 0 48 0 426 389 630 389;
#P connect 48 0 52 0;
#P connect 57 4 48 1;
#P fasten 36 0 49 0 444 389 663 389;
#P connect 49 0 53 0;
#P connect 57 5 49 1;
#P fasten 37 0 50 0 462 389 696 389;
#P connect 50 0 54 0;
#P connect 57 6 50 1;
#P fasten 38 0 51 0 480 389 729 389;
#P connect 51 0 55 0;
#P connect 57 7 51 1;
#P pop;

#31113
Apr 1, 2007 at 10:44am

At 4:04 AM -0600 4/1/07, Chris Hipgrave wrote:
>Hi all,
>
>is there a way of unpacking each column of each row in a matrixctrl?

It looks like you’re trying to build a pulse sequencer of sorts. On that assumption:

#P button 355 134 15 0;
#P button 355 116 15 0;
#P button 377 253 15 0;
#P button 359 253 15 0;
#P button 341 253 15 0;
#P button 323 253 15 0;
#P button 305 253 15 0;
#P button 287 253 15 0;
#P button 269 253 15 0;
#P button 251 253 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 251 231 140 196617 gate 8;
#P button 171 253 15 0;
#P button 153 253 15 0;
#P button 135 253 15 0;
#P button 117 253 15 0;
#P button 99 253 15 0;
#P button 81 253 15 0;
#P button 63 253 15 0;
#P button 45 253 15 0;
#P newex 45 231 140 196617 gate 8;
#P newex 381 183 32 196617 sel 1;
#P newex 339 183 32 196617 sel 1;
#P newex 339 160 52 196617 unpack i i;
#P newex 217 96 93 196617 prepend getcolumn;
#P user matrixctrl 217 117 132 36 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 132 36 16 16 8 2 16 16 2 2 56 2 0 0;
#P number 93 72 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 45 147 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 45 69 15 0;
#P newex 45 95 58 196617 metro 700;
#N counter 1 8;
#X flags 0 0;
#P newobj 45 120 66 196617 counter 1 8;
#P connect 9 0 29 0;
#P connect 9 0 19 1;
#P connect 3 0 10 0;
#P connect 3 0 6 0;
#P connect 3 0 19 0;
#P connect 8 0 10 1;
#P connect 8 0 28 0;
#P connect 19 0 20 0;
#P connect 19 7 27 0;
#P connect 19 6 26 0;
#P connect 19 5 25 0;
#P connect 19 4 24 0;
#P connect 19 3 23 0;
#P connect 19 2 22 0;
#P connect 19 1 21 0;
#P connect 10 1 12 0;
#P connect 10 2 13 0;
#P connect 10 3 14 0;
#P connect 10 4 15 0;
#P connect 10 5 16 0;
#P connect 10 6 17 0;
#P connect 10 7 18 0;
#P connect 10 0 11 0;
#P connect 5 1 7 0;
#P connect 7 0 8 0;
#P connect 7 1 9 0;
#P connect 6 0 5 0;
#P connect 2 0 1 0;
#P connect 1 0 0 0;
#P connect 0 0 3 0;
#P connect 4 0 1 1;
#P window clipboard copycount 30;


Chris Muir | “There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue.” – Brian Eno

#100647
Apr 1, 2007 at 6:32pm

Perhaps I shouldn’t post things as late as I did with the above solution. There are a couple issues with what I posted above. Here’s one that works:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 45 140 27 196617 t i i;
#P newex 217 75 27 196617 – 1;
#P message 73 99 14 196617 1;
#P button 45 98 15 0;
#P button 355 136 15 0;
#P button 355 118 15 0;
#P button 377 253 15 0;
#P button 359 253 15 0;
#P button 341 253 15 0;
#P button 323 253 15 0;
#P button 305 253 15 0;
#P button 287 253 15 0;
#P button 269 253 15 0;
#P button 251 253 15 0;
#P newex 251 231 140 196617 gate 8;
#P button 171 253 15 0;
#P button 153 253 15 0;
#P button 135 253 15 0;
#P button 117 253 15 0;
#P button 99 253 15 0;
#P button 81 253 15 0;
#P button 63 253 15 0;
#P button 45 253 15 0;
#P newex 45 231 140 196617 gate 8;
#P newex 381 183 32 196617 sel 1;
#P newex 339 183 32 196617 sel 1;
#P newex 339 160 52 196617 unpack i i;
#P newex 217 96 93 196617 prepend getcolumn;
#P user matrixctrl 217 117 132 36 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 132 36 16 16 8 2 16 16 2 2 56 2 0 0;
#P number 93 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 45 176 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 45 49 15 0;
#P newex 45 75 58 196617 metro 700;
#N counter 1 8;
#X flags 0 0;
#P newobj 45 120 66 196617 counter 1 8;
#P fasten 33 0 32 0 50 165 196 165 196 67 222 67;
#P connect 33 1 3 0;
#P connect 0 0 33 0;
#P connect 32 0 6 0;
#P connect 31 0 0 2;
#P connect 30 0 0 0;
#P connect 1 0 30 0;
#P connect 9 0 29 0;
#P connect 9 0 19 1;
#P connect 7 1 9 0;
#P connect 19 7 27 0;
#P connect 19 6 26 0;
#P connect 8 0 10 1;
#P connect 8 0 28 0;
#P connect 19 5 25 0;
#P connect 7 0 8 0;
#P connect 5 1 7 0;
#P connect 19 4 24 0;
#P connect 19 3 23 0;
#P connect 19 2 22 0;
#P connect 19 1 21 0;
#P connect 19 0 20 0;
#P connect 3 0 10 0;
#P connect 3 0 19 0;
#P connect 6 0 5 0;
#P connect 10 7 18 0;
#P connect 10 6 17 0;
#P connect 10 5 16 0;
#P connect 10 4 15 0;
#P connect 10 3 14 0;
#P connect 4 0 1 1;
#P connect 10 2 13 0;
#P connect 10 1 12 0;
#P connect 10 0 11 0;
#P connect 2 0 1 0;
#P window clipboard copycount 34;

#100648
Apr 1, 2007 at 6:42pm

Ah yes, i was scratching my head. This one is perfect.

Thank you
Chris

#100649

You must be logged in to reply to this topic.