[PD] $0 and Data Structure Templates

Mike McGonagle mjmogo at gmail.com
Mon Dec 1 07:53:30 CET 2008


Luke,

I think this should be allowed, hell, even the use of other $
arguments. It would be nice to be able to allow abstractions to create
their own private data structures, or at least ones that could be
named based on a creation argument.

If nothing else, it would prevent any kind of structure naming clashes
between objects that define structure with the same name.

I had, like you, tried this same thing only to find that the saves
files were then having those structures renamed.

It would also be nice if you could store a reference to any type of
data structure within one of these "private" data structures... of
course, the abstraction being passed this arbitrary pointer to a data
structure wouldn't know what to do with it, but it could be sent out
an outlet to some outside processing code. Could this be done by
adding a 'pointer' type to the structure definition? Something like:

[struct my-struct float value pointer object]

Mike

On Sun, Nov 30, 2008 at 9:32 PM, Luke Iannini <lukexipd at gmail.com> wrote:
> Hallo all,
>
> I'm working on my complex DS sequencer, and the time has come that I'd
> like to read and write sequences from it.
>
> The problem is this: all of my templates are written like [pd
> $0.note-template] to allow multiple instances of the sequencer, but
> this seems to be incompatible with reading and writing data from a
> subpatch ( like [write my-data.structure( - [pd $0.data] ), because
> the $0 is expanded in the written file (so it's full of "template
> 90953loopMarkerTemplate;" etc. rather than "template
> \$0loopMarkerTemplate;").
>
> The immediate thought was to split the templates into a separate patch
> altogether, and spawn it before creating the sequencer or use a
> singleton approach.  But, this ruins using [change( messages from
> [struct]s as well as selectively turning on and off [draw*]n elements
> on a per-sequencer basis.
>
> The only other option AFAICT is to forget DS reading and writing and
> just mirror the data in lists with SSSAD, but that would be a shame
> considering the capability exists already.
>
> It seems to me that the written datastructure definition should
> preserve $0, no?  Anyone have any other ideas?
>
> (apologies if this is unclear, I'm very tired at the moment)
> Best
> Luke
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>



-- 
Peace may sound simple—one beautiful word— but it requires everything
we have, every quality, every strength, every dream, every high ideal.
—Yehudi Menuhin (1916–1999), musician




More information about the Pd-list mailing list