[PD] [Pd] Writing subpatch contents, was Re: [Csnd] Writing subpatch contents

Chuckk Hubbard badmuthahubbard at gmail.com
Thu Nov 22 09:23:16 CET 2007


On Nov 21, 2007 11:28 PM, Roman Haefeli <reduzierer at yahoo.de> wrote:
> On Wed, 2007-11-21 at 18:36 +0900, hard off wrote:
> > yeah, but what chuck wants to know is WHICH objects are in his
> > subpatch.  so...if he puts a slider, 2 number boxes and 3 arrays in a
> > subpatch, he needs something that will tell him that the subpatch
> > contains a slider, 2 number boxes and 3 arrays.
> >
> > and then in another subpatch there might be 6 number boxes all
> > connected to a [pack] object going into a [send]
> > ssaad will only tell you the values OUTPUT by these objects...but it
> > won't tell you WHICH objects are in place.
>
> how comes that it is 'unkown', which objects are in the subpatch? either
> it is known, because there is a finite number of different kinds of
> subpatches or these are created dynamically by messages to canvas. in
> the latter case, the content of the subpatches is know, because it was
> created by another patch. so in either case the content is know. this
> also means, that you can put the list of known objects in one or more
> messages and thus can be saved by ssaad system.
>
> (sorry, if i missed an important point of that thread, but i just can't
> think of a case, where a list of objects is unkown)

Not sure I understand.
I have 8 subpatches, which could as well be 8 abstractions, though
I've set up a working system for now.
Each of those subpatches is to be a free playground while working on
any one piece.  Each is for sending control messages to Csound for one
of the 8 voices I may use in any one piece.  For each piece, I will
create a different patch; some will need [line] objects, some will
need sliders, some will need toggles, etc.  So when I load a piece
into my sequencer, I want to have the 8 patches I created for that
piece load automatically, and when I save the piece, I want the
objects and messages in that subpatch to save to a separate file for
the piece.

What I've done was, whenever saving a piece, sending "set #N canvas
etc" to a textfile object, then saving it as the name of the piece
plus number of instrument, then copying all the contents of each
subpatch and pasting into that file, then [;pd-file.pd menuclose 1(.
When I load, open the file, selectall, copy, close, open the subpatch,
paste, editmode 0, vis 0.
Works for me.  Only annoyance is that it now tells me my sequencer has
been edited and should be saved; since I'm pretty much done building
the sequencer, I just remind myself not to save it (if I save the
patch with an open piece, the list of notes makes the patch too big
for Pd to open and when I open it again half the stuff is missing).

So there is not always a list of objects; only when it is copied from
one existing patch to another.  They're initially created by me
playing around.

-Chuckk

-- 
http://www.badmuthahubbard.com




More information about the Pd-list mailing list