[PD] memory with native objects

Frank Barknecht fbar at footils.org
Thu May 11 00:16:38 CEST 2006


Hallo,
patco hat gesagt: // patco wrote:

>    next step in my crusader for replacing externals
>   with native objects will be about replacing memento with ssad,
>   textfile for this stuff is obviously necessary,
>   thank you, Frank,  for this great work.
>   
>   I keep on saying that using a message box is more usefull
>   for fixed memory settings,
>    like in the GOP menu patch submitted before,
>   than being in need of a textfile.
>   
>   Any memory used for things that doesn't need
>   to be saved under a preset, have absolutely no reason
>   to be in an external file, it's irrelevant.

True, but they also have no need to be in a message box, if they are
temporary anyway. You can just as well use a [textfile] without ever
touching the "file" functionality of it: Just use it as a container
for messages like you would use a message box. It's much easier to
work with the textfile, because you can rewind it, get messages one by
one etc. Attached is how this is done. You could also try to remove
duplicates by using the "setable-route" idiom to filter out keys
that already exist, but that is a bit more tricky.

Actually I'm currently using Georg's PDContainers a
lot for storing and retrieving in-memory patterns and similar things.
I have a feeling, that sometimes I'm just rebuilding [qlist] though,
but h_multimap and h_list are just too tasty to ignore them for these
purposes. A kind of "map" container is really something that is
missing in core Pd IMO. 

>   If it's relevant, but I don't see how it is.
>   
>   Anyone knows a trick for replacing zexy/drip, and ggee/concat with internal objects?

[list] equals [concat] and [list]-abs is a collection of
list-operations done with native objects in pd-0.39 and up. Zexy's
drip is called list-drip.pd there.  (The setable route from above is
part of [list]-abs as well where it is called sroute.pd. In the
attached patch I made it into a subpatch for simplicity.)

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 299 174 758 560 10;
#X obj 264 329 textfile;
#N canvas 0 0 450 300 setable_route 0;
#X obj 148 99 inlet;
#X obj 90 54 list split 1;
#X obj 90 31 inlet;
#X obj 90 188 outlet;
#X obj 90 154 list;
#X obj 148 188 outlet;
#X obj 148 156 list;
#X obj 90 124 select;
#X connect 0 0 7 1;
#X connect 1 0 7 0;
#X connect 1 1 4 1;
#X connect 1 1 6 1;
#X connect 2 0 1 0;
#X connect 4 0 3 0;
#X connect 6 0 5 0;
#X connect 7 0 4 0;
#X connect 7 1 6 0;
#X restore 264 360 pd setable_route;
#X obj 313 290 list trim;
#X obj 313 268 list prepend add;
#X obj 166 266 until;
#X msg 166 241 100;
#X msg 216 223 rewind;
#X obj 313 248 list prepend;
#X obj 313 183 t b a;
#X obj 313 218 list;
#X obj 313 164 hradio 15 1 0 8 empty empty save_at_slot 0 -6 0 8 -262144
-1 -1 0;
#X obj 166 195 t b b f;
#X symbolatom 476 204 10 0 0 1 store_me - -;
#X obj 166 166 hradio 15 1 0 8 empty empty load_slot 0 -6 0 8 -262144
-1 -1 0;
#X floatatom 477 223 5 0 0 1 store_number - -;
#X text 475 151 Data to store;
#X msg 476 178 list foo bar store me;
#X obj 264 408 print STORED;
#N canvas 0 0 805 547 advanced 0;
#X obj 281 389 textfile;
#X obj 330 350 list trim;
#X obj 330 328 list prepend add;
#X obj 231 366 until;
#X msg 229 341 100;
#X msg 260 341 rewind;
#X obj 330 308 list prepend;
#X obj 330 243 t b a;
#X obj 330 278 list;
#X symbolatom 493 264 10 0 0 1 store_me - -;
#X floatatom 494 283 5 0 0 1 store_number - -;
#X text 492 211 Data to store;
#X msg 493 238 list foo bar store me;
#X obj 281 468 print STORED;
#N canvas 0 0 450 300 setable_route_with_symbol 0;
#X obj 204 102 inlet;
#X obj 90 54 list split 1;
#X obj 90 31 inlet;
#X obj 90 188 outlet;
#X obj 90 154 list;
#X obj 148 188 outlet;
#X obj 148 156 list;
#X obj 90 124 select junksymbol;
#X connect 0 0 7 1;
#X connect 1 0 7 0;
#X connect 1 1 4 1;
#X connect 1 1 6 1;
#X connect 2 0 1 0;
#X connect 4 0 3 0;
#X connect 6 0 5 0;
#X connect 7 0 4 0;
#X connect 7 1 6 0;
#X restore 281 420 pd setable_route_with_symbol;
#X obj 241 321 t b b a;
#X symbolatom 216 292 10 0 0 0 reload_by_symbol - -;
#X symbolatom 329 222 10 0 0 0 store_by_symbol - -;
#X msg 399 158 c;
#X msg 364 158 b;
#X msg 329 158 a;
#X obj 329 200 list;
#X msg 181 202 c;
#X msg 146 202 b;
#X msg 111 202 a;
#X obj 111 244 list;
#X text 172 75 You can also store using a symbol key \, but not both
num and syn keys at the same time because [select] doesn't like it.
;
#X connect 0 0 14 0;
#X connect 0 1 3 1;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 0 0;
#X connect 4 0 3 0;
#X connect 5 0 0 0;
#X connect 6 0 2 0;
#X connect 7 0 8 0;
#X connect 7 1 6 1;
#X connect 8 0 6 0;
#X connect 9 0 8 1;
#X connect 10 0 8 1;
#X connect 12 0 8 1;
#X connect 14 0 13 0;
#X connect 15 0 4 0;
#X connect 15 1 5 0;
#X connect 15 2 14 1;
#X connect 16 0 15 0;
#X connect 17 0 7 0;
#X connect 18 0 21 0;
#X connect 19 0 21 0;
#X connect 20 0 21 0;
#X connect 21 0 17 0;
#X connect 22 0 25 0;
#X connect 23 0 25 0;
#X connect 24 0 25 0;
#X connect 25 0 16 0;
#X restore 541 383 pd advanced;
#X msg 155 308 print;
#X text 25 243 100 to avoid loops;
#X connect 0 0 1 0;
#X connect 0 1 4 1;
#X connect 1 0 17 0;
#X connect 2 0 0 0;
#X connect 3 0 2 0;
#X connect 4 0 0 0;
#X connect 5 0 4 0;
#X connect 6 0 0 0;
#X connect 7 0 3 0;
#X connect 8 0 9 0;
#X connect 8 1 7 1;
#X connect 9 0 7 0;
#X connect 10 0 8 0;
#X connect 11 0 5 0;
#X connect 11 1 6 0;
#X connect 11 2 1 1;
#X connect 12 0 9 1;
#X connect 13 0 11 0;
#X connect 14 0 9 1;
#X connect 16 0 9 1;
#X connect 19 0 0 0;


More information about the Pd-list mailing list