[PD] memory with native objects

Frank Barknecht fbar at footils.org
Wed May 10 20:50:32 CEST 2006


Hallo,
patco hat gesagt: // patco wrote:

> Well, we could also use an array and check in properties 
>   "save content"
>   Or we could use two messages boxes
>   [set $1(---[ (
>   and a loadbang (like in the little bagoftricks memory)
>   Or we could use the object [init] with using the second inlet
>   for setting the memorized value,
>   ect...

I would really recommend to take a look at [sssad]: For a simple
general purpose state saving it is much more flexible than the
solutions above and still only uses builtin objects (with pd 0.39).

if you use various [textfile]s to do the actual state management with
sssad or if you wouldn't mind to access the harddisk with
preset-switching it even allows storing different presets, not just a
"snapshot" of the current state of things, which is the original
motivation of [sssad]. I attached a little example how to do this.

>   But if we need to store several lists of parameters, that could become very complicated, 
>   Anyway, the last patch submitted fits very well the patch
>    I am experimenting that needs a little memory, 

Here I would recommend to use a [textfile] instead of the message box.
It's quicker than changing the message box all the time, and the
messages to [textfile] are very similar to those you send to a message
box.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 0 0 590 570 10;
#X obj 106 127 sssad store_me;
#N canvas 566 166 599 674 saveme 0;
#X obj 321 386 textfile;
#X msg 210 287 clear;
#X msg 395 369 print;
#X obj 321 310 list prepend add;
#X obj 321 336 list trim;
#X obj 188 387 s SSSAD_ADMIN;
#X obj 321 242 r SSSAD_ADMIN;
#X obj 321 286 route persist;
#X obj 321 264 list trim;
#X msg 188 321 save;
#X msg 202 360 set;
#X obj 166 251 t a b b;
#X msg 166 434 write \$1;
#X obj 107 129 hradio 15 1 0 8 empty empty save 0 -6 0 8 -262144 -1
-1 0;
#X obj 107 543 until;
#X msg 107 522 100;
#X obj 107 499 t b a;
#X msg 155 543 read \$1 \, rewind;
#X text 139 522 Avoid loops. A bang normally also works.;
#X obj 107 159 hradio 15 1 0 8 empty empty load 0 -6 0 8 -262144 -1
-1 2;
#X obj 166 220 makefilename state-%d.sssad;
#X obj 107 457 makefilename state-%d.sssad;
#X obj 319 433 s SSSAD;
#X obj 386 430 s SSSAD_ADMIN;
#X msg 386 405 set;
#X connect 0 0 22 0;
#X connect 0 1 24 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X connect 6 0 8 0;
#X connect 7 0 3 0;
#X connect 8 0 7 0;
#X connect 9 0 5 0;
#X connect 10 0 5 0;
#X connect 11 0 12 0;
#X connect 11 1 9 0;
#X connect 11 2 1 0;
#X connect 12 0 0 0;
#X connect 13 0 20 0;
#X connect 14 0 0 0;
#X connect 15 0 14 0;
#X connect 16 0 15 0;
#X connect 16 1 17 0;
#X connect 17 0 0 0;
#X connect 19 0 21 0;
#X connect 20 0 11 0;
#X connect 21 0 16 0;
#X connect 24 0 23 0;
#X coords 0 -1 1 1 155 80 1 100 100;
#X restore 344 171 pd saveme;
#X floatatom 171 91 5 0 0 0 - - -;
#X obj 94 197 sssad store_me_too;
#X obj 154 166 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 1800 1;
#X obj 227 272 pack 0 0;
#X obj 248 251 t b f;
#X floatatom 227 225 5 0 0 0 - - -;
#X floatatom 266 225 5 0 0 0 - - -;
#X obj 104 293 sssad store_a_list;
#X obj 104 318 unpack 0 0;
#X connect 0 0 2 0;
#X connect 2 0 0 1;
#X connect 3 0 4 0;
#X connect 4 0 3 1;
#X connect 5 0 9 1;
#X connect 6 0 5 0;
#X connect 6 1 5 1;
#X connect 7 0 5 0;
#X connect 8 0 6 0;
#X connect 9 0 10 0;
#X connect 10 0 7 0;
#X connect 10 1 8 0;


More information about the Pd-list mailing list