Forums > MaxMSP

How do I route the data from coll with a dump output?

February 26, 2008 | 5:15 pm

I’m currently putting the data from the matrix into the coll object immediately and then dumping the contents to get the current row and value for each column "on the fly".

The problem is that I can’t figure out how to route the column number (or coll’s index) and the data associated with that index.

Can anyone help me?

max v2;
#N vpatcher 366 237 966 637;
#P origin 0 16;
#P button 444 323 15 0;
#P button 390 323 15 0;
#P button 336 323 15 0;
#P button 282 323 15 0;
#P button 228 323 15 0;
#P button 174 323 15 0;
#P button 140 323 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 114 372 34 196617 Value;
#P flonum 114 351 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 66 351 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 66 324 58 196617 unpack 0 0;
#P comment 181 98 13 196617 7;
#P comment 165 98 13 196617 6;
#P comment 150 98 13 196617 5;
#P comment 134 98 13 196617 4;
#P comment 118 98 13 196617 3;
#P comment 102 98 13 196617 2;
#P comment 86 98 13 196617 1;
#P message 66 226 33 196617 dump;
#P newex 66 199 47 196617 t b l;
#P newex 66 295 446 196617 route 0 1 2 3 4 5 6 7;
#P user matrixctrl 66 119 130 66 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 130 66 16 16 8 4 16 16 1 1 50 2 5120 0;
#N coll ;
#P newobj 66 259 53 196617 coll;
#P comment 68 98 13 196617 0;
#P comment 65 371 34 196617 Row;
#P window linecount 6;
#P comment 133 211 100 196617 How do I route the column data out of coll so I can get the row and the value of that row that are stored in coll?;
#P connect 4 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 3 0;
#P fasten 6 1 3 0 108 246 71 246;
#P connect 3 1 5 0;
#P connect 5 0 15 0;
#P connect 15 0 16 0;
#P connect 15 1 17 0;
#P connect 5 1 19 0;
#P connect 5 2 20 0;
#P connect 5 3 21 0;
#P connect 5 4 22 0;
#P connect 5 5 23 0;
#P connect 5 6 24 0;
#P connect 5 7 25 0;
#P pop;

Thanks,

Rhys


February 26, 2008 | 6:11 pm

Or perhaps this?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 466 286 34 196617 Value;
#P comment 417 285 34 196617 Row;
#P window setfont "Sans Serif" 20.;
#P comment 22 106 77 196628 or –>;
#P window setfont "Sans Serif" 9.;
#P flonum 438 337 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 390 337 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 390 310 58 196617 unpack 0 0;
#P comment 421 428 34 196617 Value;
#P flonum 421 407 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 373 407 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 373 380 58 196617 unpack 0 0;
#P comment 372 427 34 196617 Row;
#P comment 391 510 34 196617 Value;
#P flonum 391 489 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 343 489 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 343 462 58 196617 unpack 0 0;
#P comment 342 509 34 196617 Row;
#P comment 283 319 34 196617 Value;
#P flonum 283 298 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 235 298 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 235 271 58 196617 unpack 0 0;
#P comment 234 318 34 196617 Row;
#P comment 245 384 34 196617 Value;
#P flonum 245 363 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 197 363 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 197 336 58 196617 unpack 0 0;
#P comment 196 383 34 196617 Row;
#P comment 208 450 34 196617 Value;
#P flonum 208 429 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 160 429 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 160 402 58 196617 unpack 0 0;
#P comment 159 449 34 196617 Row;
#P comment 237 59 13 196617 7;
#P comment 221 59 13 196617 6;
#P comment 206 59 13 196617 5;
#P comment 190 59 13 196617 4;
#P comment 174 59 13 196617 3;
#P comment 158 59 13 196617 2;
#P comment 142 59 13 196617 1;
#P user matrixctrl 123 81 130 66 MatrixDefaultCell.pct
MatrixDefaultBkgnd.pct 130 66 16 16 8 4 16 16 1 1 50 2 5120 0;
#P comment 124 59 13 196617 0;
#P comment 441 357 34 196617 Value;
#P flonum 462 265 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 414 265 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 414 238 58 196617 unpack 0 0;
#P comment 392 356 34 196617 Row;
#P comment 171 517 34 196617 Value;
#P flonum 171 496 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 123 496 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 123 469 58 196617 unpack 0 0;
#P newex 123 193 306 196617 route 0 1 2 3 4 5 6 7;
#P comment 122 516 34 196617 Row;
#P fasten 1 5 41 0 313 230 378 230;
#P fasten 1 6 45 0 350 223 395 223;
#P connect 45 0 46 0;
#P connect 45 1 47 0;
#P fasten 1 4 36 0 276 239 348 239;
#P connect 1 3 31 0;
#P connect 1 2 26 0;
#P connect 1 1 21 0;
#P connect 41 1 43 0;
#P connect 41 0 42 0;
#P connect 36 0 37 0;
#P connect 36 1 38 0;
#P connect 31 1 33 0;
#P connect 31 0 32 0;
#P connect 26 0 27 0;
#P connect 26 1 28 0;
#P connect 21 1 23 0;
#P connect 21 0 22 0;
#P connect 12 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 2 1 4 0;
#P connect 7 1 9 0;
#P connect 7 0 8 0;
#P fasten 1 7 7 0 387 216 419 216;
#P window clipboard copycount 51;

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


February 26, 2008 | 6:19 pm

Hey Rhys,

I’m guessing that you want the state of the whole matrixctrl object
each time you change something.
Do need only the messages of the value=1 cells or the messages for
all changing cells?

cheers,
piet


February 26, 2008 | 6:31 pm

Thanks Gary, that’s perfect. I was making things too complicated as usual.

On a side note, does anyone know of a free mspaint like tool for mac osx so I can edit the matrix images and create new ones?

Thanks very much,

Rhys

PS. I require all the data associated with that column, piet.


February 26, 2008 | 6:38 pm

A dump message to matrixctrl gives the entire state.

On 2/26/08 1:19 PM, "Piet Johan Meyer"

wrote:

> Hey Rhys,
>
> I’m guessing that you want the state of the whole matrixctrl object
> each time you change something.
> Do need only the messages of the value=1 cells or the messages for
> all changing cells?
>
> cheers,
> piet

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


February 26, 2008 | 7:02 pm

On Feb 26, 2008, at 9:15 AM, Rhys Perkins wrote:

> I’m currently putting the data from the matrix into the coll object
> immediately and then dumping the contents to get the current row and
> value for each column "on the fly".
>
> The problem is that I can’t figure out how to route the column
> number (or coll’s index) and the data associated with that index.

I guess I’m a little unclear on your goals. Do you want to get row
data or column data? Do you want to reconstruct a row, based on the
columnar data in the coll?

Right now, the data stored in the coll is cell_number and value, with
the column number as the index.

If you said what your goals are, there might be a better solution, but
here’s an edit of your patch that decodes the data that you have:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 751 394 34 196617 Value;
#P flonum 751 373 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 703 373 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 703 346 58 196617 unpack 0 0;
#P comment 702 393 34 196617 Row;
#P comment 662 395 34 196617 Value;
#P flonum 662 374 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 614 374 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 614 347 58 196617 unpack 0 0;
#P comment 613 394 34 196617 Row;
#P comment 573 396 34 196617 Value;
#P flonum 573 375 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 525 375 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 525 348 58 196617 unpack 0 0;
#P comment 524 395 34 196617 Row;
#P comment 484 397 34 196617 Value;
#P flonum 484 376 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 436 376 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 436 349 58 196617 unpack 0 0;
#P comment 435 396 34 196617 Row;
#P comment 395 398 34 196617 Value;
#P flonum 395 377 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 347 377 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 347 350 58 196617 unpack 0 0;
#P comment 346 397 34 196617 Row;
#P comment 306 399 34 196617 Value;
#P flonum 306 378 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 258 378 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 258 351 58 196617 unpack 0 0;
#P comment 257 398 34 196617 Row;
#P comment 217 400 34 196617 Value;
#P flonum 217 379 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 169 379 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 169 352 58 196617 unpack 0 0;
#P comment 168 399 34 196617 Row;
#P newex 80 304 27 196617 + 1;
#P hidden message 39 77 33 196617 clear;
#P comment 128 401 34 196617 Value;
#P flonum 128 380 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 80 380 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 80 353 58 196617 unpack 0 0;
#P comment 181 98 13 196617 7;
#P comment 165 98 13 196617 6;
#P comment 150 98 13 196617 5;
#P comment 134 98 13 196617 4;
#P comment 118 98 13 196617 3;
#P comment 102 98 13 196617 2;
#P comment 86 98 13 196617 1;
#P message 66 226 33 196617 dump;
#P newex 66 199 47 196617 t b l;
#P newex 80 324 638 196617 gate 8;
#P user matrixctrl 66 119 130 66 MatrixDefaultCell.pct
MatrixDefaultBkgnd.pct 130 66 16 16 8 4 16 16 1 1 50 2 5120 0;
#N coll ;
#P newobj 66 259 53 196617 coll;
#P comment 68 98 13 196617 0;
#P comment 79 400 34 196617 Row;
#P window linecount 6;
#P comment 379 91 100 196617 How do I route the column data out of
coll so I can get the row and the value of that row that are stored in
coll?;
#P window linecount 1;
#P comment 121 261 100 196617 index is column;
#P connect 6 1 23 0;
#P connect 6 2 28 0;
#P connect 6 3 33 0;
#P connect 6 4 38 0;
#P connect 6 5 43 0;
#P connect 6 6 48 0;
#P connect 6 7 53 0;
#P connect 53 0 54 0;
#P connect 53 1 55 0;
#P connect 48 1 50 0;
#P connect 48 0 49 0;
#P connect 43 0 44 0;
#P connect 43 1 45 0;
#P connect 38 1 40 0;
#P connect 38 0 39 0;
#P connect 33 0 34 0;
#P connect 33 1 35 0;
#P connect 28 1 30 0;
#P connect 28 0 29 0;
#P connect 23 0 24 0;
#P connect 23 1 25 0;
#P fasten 4 0 6 1 71 289 713 289;
#P connect 21 0 6 0;
#P connect 4 1 21 0;
#P connect 6 0 16 0;
#P hidden connect 20 0 5 0;
#P connect 5 0 7 0;
#P connect 16 1 18 0;
#P connect 16 0 17 0;
#P fasten 7 1 4 0 108 246 71 246;
#P connect 8 0 4 0;
#P connect 7 0 8 0;
#P window clipboard copycount 57;

Chris Muir
cbm@well.com


February 26, 2008 | 7:11 pm

On 26.02.2008, at 19:38, Gary Lee Nelson wrote:

> A dump message to matrixctrl gives the entire state.

no, it doesn’t. have you tried?

cheers,
Piet


February 26, 2008 | 8:57 pm


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