I sent Miller an idea the other day about making data structures more expressive. Basically allowing subpatches (including abstractions) to be defined as a field of a struct.
[struct ex1 float y float i glist foo pd-bar] <-- glist field "foo" using [pd bar] as a template
So let's say you make a ds array using [struct ex1] above as the template for the elements. Now when you [setsize] to 40, each element has an associated "foo" field which is actually a subpatch. To define a "subpatch template" for foo, you'd just put [pd bar] in the same subpatch as [struct ex1].
The real power of this would come by being able to access the other ds fields from within the "foo" subpatch. So maybe having some objects for getting a scalar's data from "within" the scalar:
[getmy y i] <-- used within the "foo" subpatch, this will output the values of the fields when banged.
[setmy y i] <-- same for setting. (Since we're already inside the scalar there's no need for sending pointers.)
[notify] <-- output "change", "select", etc. messages only when they refer to this scalar
Local variables! Deleting abstraction instances with [setsize]! The possibilities are endless!
I have no idea how to program any of this!
-Jonathan
--- On Tue, 5/11/10, João Pais jmmmpais@googlemail.com wrote:
From: João Pais jmmmpais@googlemail.com Subject: Re: [PD] understanding graphics objects on canvas To: pd-list@iem.at, "Ivica Ico Bukvic" ico@vt.edu Date: Tuesday, May 11, 2010, 1:29 AM
for a very simple automatic scalar creation, look at my abs jmmmp/pd-colors. I'm sure you'll understand it easily.
there are many things that should be improved on data-s, so that they're really usable on more complex compositional contexts, and not only to draw some fancy guis. but since this is a very obscure area of pd, don't know if much energy will be put in there.
Never mind. Figure it out...
that said, FWIW this part may need better coverage under the "scalar" help file which pops up when one selects help on it. The other confusing thing is when you pull up properties for a scalar object on the graph that the window that pops up is titled misleadingly "Atom".
Ico
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
--Friedenstr. 58 10249 Berlin (Deutschland) Tel +49 30 42020091 | Mob +49 162 6843570 Studio +49 30 69509190 jmmmpais@googlemail.com | skype: jmmmpjmmmp
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list