[PD] $0 and Data Structure Templates

Luke Iannini lukexipd at gmail.com
Mon Dec 1 04:32:11 CET 2008


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




More information about the Pd-list mailing list