[PD] abstractions which have their own memory

Chuckk Hubbard badmuthahubbard at gmail.com
Tue Jul 4 18:32:12 CEST 2006


I had to do the opposite.  My preset arrays were huge, and if I made
any changes to my patch and saved it, next time I opened it Pd
couldn't read the whole file, and all the connections on the main
patch were lost.  I put a message box stating [;presetmemory clear
;JI.pd menusave ;JI.pd menuclose( and that seemed to solve it.

You could make an abstraction that would keep memory for every
instance, but $0 wouldn't work, only $1.  Any two instances with the
same argument would load the same.  You could actually keep a separate
subpatch where every save of an abstraction created a new subpatch
within it containing all the data for that $1.  Probably not real
useful to anyone though.

On 7/5/06, padawan12 <padawan12 at obiwannabe.co.uk> wrote:
>
>
> Arrays are not the best thing to use for data
> persistence. Messages constructed using "set"
> and then textfiles are preferable.
> Alexandre Quessy just posted a method yesterday
> that implements a per patch memory. You might like
> to study the "bag'o'tricks" GOP abstractions to see
> another effective example of doing this.
>
>
> On Tue, 4 Jul 2006 17:43:54 +0300
> sokratesla <ugurguney at gmail.com> wrote:
>
> > # Hi everybody!
> > # I tried to build an abstraction which remembers its previous state before
> > closing the patch. I put an array in the abstraction with its "save
> > contents" option checked and saved the state of the abstraction in this
> > array of which name starts with $0- in order to make each table unique. A
> > [loadbang] outputs the values stored in the array.
> > # But this doesn't seems to work. I made an example of this structure.
> > abswmem.pd is a very simple abstraction, and test.abswmem.pd have two of
> > them. After giving the arrays of the abstractions different values, saving
> > the patch, closing it, and loading again. Nothing happens :-) The values
> > aren't stored in the arrays.
> > # And I see the ambiguity. There is only one .pd file for the abstraction,
> > so, only one file for storing the values of the array. Which abstraction
> > object's array will be saved etc?
> >
> > # Can anybody help with these?
> > -ugur guney-
> >
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>


-- 
"Far and away the best prize that life has to offer is the chance to
work hard at work worth doing."
-Theodore Roosevelt




More information about the Pd-list mailing list