closebang > pattrstorage > savedialog

Feb 8, 2006 at 10:15am

closebang > pattrstorage > savedialog

here’s a strange behaviour with pattrstorage (on win xp and osx with max 4.5.6).

The main idea is to use a loadbang and a closebang to recall and store the settings of a patch into a file located in the same directory as the patch itself.

If there is no xml file (or the xml is too different than the patch settings) the attached patch will show a save dialog when you close it. The xml file will be saved even when this dialog is canceled.

I don’t know why this dialog shows up at all.

I’ve found two modifications to avoid the save dialog:
- remove the “r loadbang” inside the da_slots patcher (on windows it works immediately, osx-max needs to reload the patch)
- or de-encapsulate the da_brain patcher inside the da_slots patcher

I’ve tried it on one osx and two winxp systems. Can someone else confirm this? Have I patched something wrong?

regards
sam

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 60 87 53 196617 s loadbang;
#P newex 60 64 45 196617 loadbang;
#P newex 136 87 58 196617 s closebang;
#P newex 136 64 50 196617 closebang;
#N vpatcher 30 46 1232 696;
#P origin 71 -15;
#P window setfont “Sans Serif” 9.;
#N vpatcher 534 321 1134 814;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 136 204 51 196617 r loadbang;
#P message 245 155 82 196617 storagewindow;
#P message 181 155 73 196617 clientwindow;
#P message 215 226 87 196617 write slots.xml;
#P message 135 226 81 196617 read slots.xml;
#P newex 215 202 56 196617 r closebang;
#P message 110 155 26 196617 read;
#B color 6;
#P message 147 155 43 196617 write;
#B color 6;
#P window linecount 0;
#P newex 60 112 66 196617 t b i i b b;
#P window linecount 1;
#P comment 45 358 14 196617 5;
#P window linecount 0;
#P newex 60 363 30 196617 zl reg;
#P window linecount 1;
#P comment 344 172 17 196617 3;
#P window linecount 0;
#P newex 319 189 27 196617 i;
#P window linecount 1;
#P comment 305 173 17 196617 2;
#P message 319 215 56 196617 store $1;
#P window linecount 0;
#P newex 520 214 30 196617 zl reg;
#P window linecount 1;
#P newex 60 317 64 196617 pattr slots;
#B color 5;
#X prestore 32 0 11 75 104 167 143 128 78 41 0 0 0 0 0 202 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0;
#P objectname slots;
#P comment 120 270 160 196617 here are the slot presets stored;
#P comment 113 326 165 196617 and here those slot states come out;
#P newex 60 263 72 196617 pattrstorage;
#B color 5;
#X autorestore slots.xml;
#X client_rect 292 113 978 273;
#X storage_rect 152 103 899 371;
#P objectname u177000067;
#P outlet 60 396 15 0;
#P inlet 88 56 15 0;
#P inlet 60 56 15 0;
#P window linecount 0;
#P comment 506 197 17 196617 1;
#P comment 67 223 14 196617 4;
#P comment 366 189 100 196617 the ‘i’ remembers the PREVIOUSLY selected slot;
#P comment 91 362 327 196617 it would also work without this zl reg , but otherwise the old fader state would be transmitted again (coming from [1]) , before the new state will be delivered;
#P connect 4 0 18 0;
#P fasten 25 0 7 0 250 182 115 182 115 244 65 244;
#P fasten 24 0 7 0 186 182 115 182 115 244 65 244;
#P fasten 18 1 7 0 79 166 65 166;
#P lcolor 15;
#P fasten 12 0 7 0 324 238 324 238 324 250 65 250;
#P fasten 20 0 7 0 115 244 65 244;
#P fasten 19 0 7 0 152 182 115 182 115 244 65 244;
#P fasten 22 0 7 0 137 244 65 244;
#P fasten 23 0 7 0 221 244 65 244;
#P fasten 11 0 10 0 525 299 65 299;
#P fasten 18 0 16 0 65 158 39 158 39 355 65 355;
#P lcolor 15;
#P connect 16 0 6 0;
#P fasten 10 0 16 1 65 346 85 346;
#P connect 26 0 22 0;
#P connect 21 0 23 0;
#P fasten 18 3 14 0 107 144 324 144;
#P lcolor 15;
#P connect 14 0 12 0;
#P fasten 18 2 14 1 93 151 341 151;
#P lcolor 15;
#P fasten 18 4 11 0 121 135 525 135;
#P lcolor 15;
#P fasten 5 0 11 1 93 96 545 96;
#P pop;
#P newobj 3 314 51 196617 p da_brain;
#P objectname da_brain;
#P newex 3 71 40 196617 split 1 8;
#P message 102 41 100 196617 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0;
#P newex 101 21 51 196617 r loadbang;
#P outlet 3 501 15 0;
#P inlet 3 40 15 0;
#P inlet 419 42 15 0;
#P fasten 4 0 5 0 105 61 8 61;
#P connect 1 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 2 0;
#P fasten 0 0 6 1 424 173 49 173;
#P connect 3 0 4 0;
#P pop;
#P newobj 111 215 64 196617 p da_slots;
#B color 5;
#P objectname da_slots;
#P connect 1 0 2 0;
#P connect 3 0 4 0;
#P window clipboard copycount 5;

#24321
Feb 9, 2006 at 10:21am

I can confirm this under 4.5.6. My development version of
pattrstorage doesn’t feature this behavior, so I guess I fixed this
bug… It will be released soon.

jb

#70177
Feb 9, 2006 at 10:34am

great news!! thanks Jeremy!

#70178

You must be logged in to reply to this topic.