[PD] saving arrays

Miller Puckette mpuckett at man104-1.ucsd.edu
Wed Jul 18 20:03:56 CEST 2001


Hi Greg,

I think the best way is to keep the arrays _outside_ the abstractions and
just have the abstractions refer to them by name.   Abstractions themselves
can't save internal "state"; two instances of the same abstraction are, by
design, identical except in their arguments.

It's also possible to save and restore arrays within abstractions manually,
but I think it's almost always better to have the calling patch own the 
data.

cheers
Miller

On Tue, Jul 17, 2001 at 10:46:58PM -0400, Greg Rippin wrote:
> A restatement of a previous question, with some added clarification:
> 
> Attached are two files, "arraytest.pd" and "arraytesttwo.pd".
> "arraytest" contains a small array, called "test".  "arraytesttwo"
> contains a copy of the abstraction "arraytest" and a tabwrite object to
> modify the array "test" that exists inside of "arraytest."  My question
> is: having modified the array "test," how can I save the modified array
> without a) writing it's contents to a text file, or b) manually opening
> up and saving "arraytest" ?
> 
> Since (I believe) an array is saved when the patch that contains it is
> saved, a more direct question is: is there a way to save the contents of
> a sub-patch without actually opening up the sub-patch and telling it to
> save?
> 
> I checked the pd list archive and the pd documentation but couldn't find
> answers to these questions, so any suggestions would be greatly
> appreciated.
> 
> Thanks,
> Greg
> NYU
> 
> --
> Greg Rippin, Graduate Assistant
> Music Technology Program
> New York University
> 35 West 4th Street, Suite 777
> New York, NY 10012
> 
> phone 212-998-5422
> fax 212-995-4043
> musictechgrad.info at nyu.edu
> www.nyu.edu
> 

> #N canvas 0 0 458 308 12;
> #X obj 266 74 arraytest;
> #X obj 56 133 tabwrite test;
> #X floatatom 56 73 4 -2 2;
> #X floatatom 155 75 4 0 4;
> #X connect 2 0 1 0;
> #X connect 3 0 1 1;

> #N canvas 0 0 460 310 12;
> #X graph graph11 0 -2 4 2 100 160 300 20;
> #X array test 5 float 1;
> #A 0 1.68571 -0.0571429 -1.88571 1.22857 2;
> #X pop;




More information about the Pd-list mailing list