Forums > MaxMSP

Matrix Saving

June 19, 2006 | 8:35 pm

SO sorry to bring this up yet again, BUT I’m still hoping that someone can help a brother out…

OK… mega big patch – which has within it 8 matrixctrl objects, each of which is 128 X 64.

This is the final stumbling block on a patch that has taken me months. HOW THE HECK can I save matrixctl states.

My obstacles thus far:

The pattrstor won’t save info from matrixctl object that are that large.

Preset objects DO save it, but are so flakey, I’ve never seen them able to recall data prperly, after writing and reloading. Most recently, I’ve used this method, and it works fine, until I save, quit, and reload, then… nothing. The preset object seems to have presets, but they don’t do anything.

I’m desperate here … this patch is awesome, but unless I can save, it’s all for naught…

Could there be anything, anything anything I’ve over looked?

Cheers,
Joel


June 19, 2006 | 8:47 pm

if you have jitter: just save them as jitter matrices.
else: lots and lots of colls.


June 19, 2006 | 8:52 pm

On 19 Jun 2006, at 21:35, joelsquare wrote:

> This is the final stumbling block on a patch that has taken me
> months. HOW THE HECK can I save matrixctl states.

If pattr and presets don’t do it: how about iterating the cell values
to/from a coll?

(Sorry if that’s been suggested before; I’ve not been paying too much
attention to this thread.)

– N.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


June 19, 2006 | 8:59 pm

what if you save it as an actual jitter binary matrix, and use some
javascript to iterate through the cells?

you could do a jit.matrix 1 char 128×64 and store the states with
setcell and recall with getcell maybe?

if you have jitter that is.

v a d e //

http://www.vade.info
abstrakt.vade.info


June 19, 2006 | 9:06 pm

Hey thanks for the fast responses.

I don’t have Jitter, and for now, I can’t justify buying it for one object.

There’s no way to just use that one object, is there?

I’m really hoping – naive, perhaps – for a quick solution, akin to PRESET or PATTRSTORAGE. Mostly because there are so many layers to this patch…

I did think about using COLL, but I’m confused as to the most ergonomic way to use it in this case. Again, this is where a ‘setcolumn’ command would rock my world. Any thoughts as to the best way to convert Matrix settings into COLL-able data, and back again?

Cheers,
Joel


June 19, 2006 | 9:09 pm

You can also write a javascript to do the same thing as a coll would
but has more intelligence.

wes


June 19, 2006 | 9:18 pm

It might be worth checking to see if Nick (Rothwell) ‘s registry
objects will deal with datasets that large.
Nick?

David


June 19, 2006 | 10:32 pm

On 19 Jun 2006, at 22:18, David Stevens wrote:

> It might be worth checking to see if Nick (Rothwell) ‘s registry
> objects will deal with datasets that large.

I did think about that – I suspect my code has the same list length
limitations as other externals (255 atoms?) – but if a solution using
‘coll’ looks like working at all, then registry would probably work
as well – it’s implemented against the same API – and might be more
convenient. (Registry is OS X only, though.)

On the other hand: you could always (*ahem*) use an SQL database:

http://www.loadbang.net/space/Software/net.loadbang-SQL

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


June 19, 2006 | 10:47 pm

sorry,

If you use long lists , thinks about this

max v2;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 90 61 48 196617 loadbang;
#P newex 120 232 61 196617 zl group 10;
#P newex 137 133 44 196617 uzi 100;
#P newex 120 109 27 196617 t i b;
#P newex 90 86 40 196617 uzi 10;
#N coll ;
#P newobj 120 257 53 196617 coll;
#P newex 120 205 61 196617 zl join;
#P newex 171 180 51 196617 tosymbol;
#P newex 171 157 67 196617 zl group 100;
#P connect 8 0 4 0;
#P connect 4 2 5 0;
#P connect 5 0 2 0;
#P connect 2 0 7 0;
#P connect 7 0 3 0;
#P connect 5 1 6 0;
#P connect 6 2 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 1;
#P pop;

best

huts

( )
~ O ~ http://www.kineticsoundsystem.com
( )


June 20, 2006 | 2:16 am


June 20, 2006 | 6:22 am

here is a way!

happy birthday and merry christmas
//yac

_________________________________________

#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 242 172 253 196617 I didn’t test this mthod with a large matrix , but it sould do it
the same;
#P comment 242 133 253 196617 unless the store [int] message which is routed , all the other
messages in left inlet goes to the coll;
#P window linecount 1;
#P comment 143 49 40 196617 recall;
#P message 67 338 127 196617 1 3 0;
#P newex 67 318 62 196617 prepend set;
#P message 81 174 30 196617 open;
#P message 81 221 33 196617 clear;
#P message 81 154 30 196617 read;
#P message 81 134 35 196617 write;
#P button 145 64 15 0;
#P newex 145 82 27 196617 i;
#P number 162 64 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 67 64 15 0;
#P newex 67 82 27 196617 i;
#P number 84 64 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 67 104 49 196617 store $1;
#P user matrixctrl 67 241 130 66 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 130 66 16 16 8 4 16
16 1 1 48 2 5120 0;
#N vpatcher 92 72 1078 861;
#P window setfont "Sans Serif" 9.;
#P newex 240 620 22 196617 b 1;
#P newex 296 618 22 196617 b 1;
#N counter;
#X flags 0 0;
#P newobj 240 645 66 196617 counter;
#P newex 168 525 64 196617 fromsymbol;
#P newex 168 505 25 196617 iter;
#P newex 109 53 61 196617 route store;
#P number 109 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 321 427 62 196617 prepend set;
#P newex 245 455 54 196617 prepend 1;
#P newex 245 426 62 196617 zl group;
#P newex 245 399 55 196617 tosymbol;
#P message 50 724 52 196617 $1 $3 $2;
#P newex 136 621 22 196617 b 1;
#P newex 157 693 48 196617 pack i i i;
#P newex 192 619 22 196617 b 1;
#N counter;
#X flags 0 0;
#P newobj 136 646 66 196617 counter;
#P newex 168 599 25 196617 iter;
#P newex 85 301 27 196617 – 1;
#P message 69 680 57 196617 getrow $1;
#P newex 85 278 40 196617 uzi;
#P message 154 249 14 196617 2;
#P number 108 226 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 108 200 34 196617 zl len;
#P message 73 79 14 196617 1;
#P newex 108 180 47 196617 gate 2 1;
#N coll ;
#P newobj 234 477 53 196617 coll;
#P message 1 701 62 196617 getcolumn 1;
#P inlet 109 33 15 0;
#P inlet 361 33 15 0;
#P outlet 24 745 15 0;
#P fasten 6 0 3 0 78 107 6 107;
#P fasten 18 0 0 0 55 742 29 742;
#P fasten 11 0 0 0 74 718 29 718;
#P fasten 3 0 0 0 6 730 29 730;
#P fasten 16 0 18 0 162 720 55 720;
#P fasten 12 0 11 0 90 327 74 327;
#P fasten 24 0 6 0 114 73 78 73;
#P fasten 8 0 10 0 113 274 90 274;
#P fasten 10 2 12 0 120 298 90 298;
#P fasten 6 0 5 0 78 150 113 150;
#P fasten 9 0 5 0 159 268 170 268 170 176 113 176;
#P connect 5 0 7 0;
#P connect 7 0 8 0;
#P connect 2 0 24 0;
#P connect 24 0 23 0;
#P fasten 13 0 17 0 173 618 141 618;
#P fasten 17 0 14 0 141 642 141 642;
#P fasten 1 0 5 1 366 117 150 117;
#P fasten 8 0 9 0 113 244 159 244;
#P fasten 14 0 16 0 141 678 162 678;
#P fasten 15 0 14 2 197 641 169 641;
#P fasten 4 0 25 0 239 499 173 499;
#P connect 25 0 26 0;
#P fasten 26 0 13 0 173 572 173 572;
#P fasten 13 0 16 1 173 623 181 623;
#P fasten 26 0 15 0 173 582 197 582;
#P fasten 27 0 16 2 245 677 200 677;
#P fasten 21 0 4 0 250 474 239 474;
#P connect 24 1 4 0;
#P fasten 25 0 29 0 173 524 245 524;
#P fasten 29 0 27 0 245 641 245 641;
#P fasten 5 1 19 0 150 298 250 298;
#P connect 19 0 20 0;
#P fasten 20 0 21 0 250 449 250 449;
#P fasten 22 0 21 0 326 449 250 449;
#P fasten 28 0 27 2 301 640 273 640;
#P fasten 4 0 28 0 239 501 301 501;
#P fasten 8 0 20 1 113 274 302 274;
#P fasten 23 0 22 0 114 103 326 103;
#P pop;
#P newobj 67 200 84 196617 p matrix_preset;
#B color 5;
#P comment 65 49 40 196617 store;
#P connect 7 0 8 1;
#P connect 9 0 8 0;
#P connect 4 0 5 1;
#P connect 1 0 2 0;
#P fasten 12 0 2 0 86 238 72 238;
#P connect 3 0 1 0;
#P fasten 11 0 1 0 86 171 72 171;
#P fasten 10 0 1 0 86 151 72 151;
#P fasten 8 0 1 0 150 125 72 125;
#P fasten 13 0 1 0 86 191 72 191;
#P connect 5 0 3 0;
#P connect 6 0 5 0;
#P connect 2 0 14 0;
#P connect 14 0 15 0;
#P fasten 2 1 1 1 192 310 201 310 201 196 146 196;
#P window clipboard copycount 19;


June 20, 2006 | 9:31 am

joelsquare wrote:
> Preset objects DO save it, but are so flakey, I’ve never seen them
> able to recall data prperly, after writing and reloading. Most
> recently, I’ve used this method, and it works fine, until I save,
> quit, and reload, then… nothing. The preset object seems to have
> presets, but they don’t do anything.

You should connect the matrixctrl’s with the left outlet of preset, that
will asure you that the content is not scrumbled. As each time you add
UI elements, the order of preset might be displaced. (I once made a
little abstarction (still in St.ools) which could help out there, but in
your case, just save only the matrixctl states and nothing else…)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


June 20, 2006 | 1:33 pm

Hey all,

Thank you so much for contributing… this has been the final headache in a large project. SOME headaches, I like – I love to solve problems, but this headache was getting too big!

I will check some of these solutions out! I really appreciate it. Yacine – I had played with something like this, but I think my MAX/MSP knowledge limited me a bit… your patch looks good, and might just be the solution. How much do I owe you?!

Cheers and thanks again all,
Joel


June 20, 2006 | 11:14 pm

>How much do I owe you?!

a bear will fine when we meet someday…
‘hope your headaches will leave you for a while!

ciao
//yac


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