[PD] newbie dynamic subpatch launcher

Frank Barknecht fbar at footils.org
Wed Feb 9 18:31:38 CET 2005


Hallo,
Chris O'Shea hat gesagt: // Chris O'Shea wrote:

> I am new to dynamic patches. I've gone through some examples of 
> dynamically adding objects to the canvas etc, but have decided this 
> isn't what I need to do.
> 
> Essentially I need to be able to dynamically load a subpatch, each with 
> an individual name, so that I can send each one values, then connect it 
> to the dac. I can see in my head how to do it, just don't know the 
> method in pd.

What you are talking about actually are called "abstractions".
Subpatches are the subwindows you create inside a patch by using [pd
something]. Abstraction OTOH are real files on their own. They are
actually less "abstract" and quite "concrete" in this regard: 

  Every abstraction is a file. 
  Subpatches are never files (on their own). 

The difference between both is one of the most important things to
understand fully after you have made your first steps in Pd, so I
suggest to read the relevant parts of the html documentation at least
three times. No joke - it really is that important. 

One useful thing possible with abstractions, but not with subpatches,
is, that you can pass other things into them, so called "arguments". 

Arguments are everything, that follows after the name of the
abstraction in a patch, that uses this abstraction. Example: 

[sub_sound 440]

[sub_sound 220]

Here "440" is an argument, 220 is another. You can access the value of
the first argument in your abstraction by creating objects (*not*
messages) that use "$1" in it. You can access the second arg with $2
and so on.

So if you replace [osc~ 440] in sub_sound.pd with [osc~ $1] and create 

[sub_sound 440]

[sub_sound 220]

you have in fact created one [osc~ 220] and one [osc~ 440] inside. 

After this lecturing excourse: To me it is not clear, why you are
trying to use some dynamic stuff in your patch. Opening the
abstraction to be visible does not really do something new: You still
only can control, what you also can control through the inlet. I am
probably just misunderstanding what you are trying to achieve, maybe
you could elaborate a bit more about this?

Ciao
-- 
 Frank Barknecht                               _ ______footils.org__
             
             _ __latest track: fqdn _ http://footils.org/cms/show/38




More information about the Pd-list mailing list