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.
here is a sub_sound.pd simple example:
#N canvas 0 0 454 304 12; #X obj 79 130 osc~ 440; #X floatatom 74 91 5 0 0 0 - - -; #X obj 79 44 inlet; #X obj 79 195 outlet~; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 2 0 1 0;
here is a little patch with some of the sub patches on
#N canvas 218 136 722 441 12; #X obj 32 114 sub_sound; #X obj 117 115 sub_sound; #X obj 209 114 sub_sound; #X obj 53 251 *~ 0.5; #X obj 50 300 dac~; #X floatatom 107 218 5 0 0 0 - - -; #X floatatom 32 82 5 0 0 0 - - -; #X floatatom 117 82 5 0 0 0 - - -; #X floatatom 209 83 5 0 0 0 - - -; #X text 29 51 here are a few simple sub-patches; #X text 318 158 trying to launch a subpatch dynamically , with individual names so that the frequency of each can be controlled seperately; #X msg 319 273 ; pd-x.pd menuclose; #X msg 321 226 ; pd open sub_sound.pd /tmp; #X connect 0 0 3 0; #X connect 1 0 3 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 4 1; #X connect 5 0 3 1; #X connect 6 0 0 0; #X connect 7 0 1 0; #X connect 8 0 2 0;
Does anyone have any tips, or could point in the direction of some reading, that would help me find my solution?
Chris
Hi Chris, for this i can recommend dyn~, which is an external object that uses a sandbox patcher where you can throw your patchers in, associated with a name symbol.
best greetings, Thomas
----- Original Message ----- From: "Chris O'Shea" chris@pixelsumo.com To: pd-list@iem.at Sent: Wednesday, February 09, 2005 9:14 AM Subject: [PD] newbie dynamic subpatch launcher
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.
here is a sub_sound.pd simple example:
#N canvas 0 0 454 304 12; #X obj 79 130 osc~ 440; #X floatatom 74 91 5 0 0 0 - - -; #X obj 79 44 inlet; #X obj 79 195 outlet~; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 2 0 1 0;
here is a little patch with some of the sub patches on
#N canvas 218 136 722 441 12; #X obj 32 114 sub_sound; #X obj 117 115 sub_sound; #X obj 209 114 sub_sound; #X obj 53 251 *~ 0.5; #X obj 50 300 dac~; #X floatatom 107 218 5 0 0 0 - - -; #X floatatom 32 82 5 0 0 0 - - -; #X floatatom 117 82 5 0 0 0 - - -; #X floatatom 209 83 5 0 0 0 - - -; #X text 29 51 here are a few simple sub-patches; #X text 318 158 trying to launch a subpatch dynamically , with individual names so that the frequency of each can be controlled seperately; #X msg 319 273 ; pd-x.pd menuclose; #X msg 321 226 ; pd open sub_sound.pd /tmp; #X connect 0 0 3 0; #X connect 1 0 3 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 4 1; #X connect 5 0 3 1; #X connect 6 0 0 0; #X connect 7 0 1 0; #X connect 8 0 2 0;
Does anyone have any tips, or could point in the direction of some reading, that would help me find my solution?
Thanks
Chris
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
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?
Frank Barknecht _ ______footils.org__
_ __latest track: fqdn _ http://footils.org/cms/show/38