Message: 8 Date: Tue, 17 Aug 2004 12:14:15 -0000 To: pd-list@iem.at Subject: Re: [PD] trigger / pak From: "gerard van dongen" gml@xs4all.nl
IT would be nice if you could build abstractions with a variable number of
inlets/outlets, depending on the argumentsciao Gerard
No one seems to have mentioned this again, but I think it's a good idea too. Maybe [inlet x] could be created only if creation argument $x exists? E.g.
[inlet 1] [inlet 2] [inlet 3] ...etc
creates an inlet per creation argument? Same thing for outlets?
Stefan
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
No one seems to have mentioned this again, but I think it's a good idea too. Maybe [inlet x] could be created only if creation argument $x exists? E.g.
[inlet 1] [inlet 2] [inlet 3] ...etc
creates an inlet per creation argument? Same thing for outlets?
it should be possible to do that with dynamic patching using messages to pd ...
cheers... tim
it should be possible to do that with dynamic patching using messages to
pd
...
the problem is, that then you have to do the wiring outside of the object dynamically too (because the connections are made before you can create the iolets)
variable in/outlets are possible with dyn~, where the outbound number of connection is given at dyn~ creation, but you can adjust the inbound connectivity (and all the objects inside) to your likings.
best greetings, Thomas
On Fri, 20 Aug 2004 18:11:41 +0200, Thomas Grill gr@grrrr.org wrote:
variable in/outlets are possible with dyn~, where the outbound number of connection is given at dyn~ creation, but you can adjust the inbound connectivity (and all the objects inside) to your likings.
The original idea was that you can make an abstraction to act (for
instance) like pack but will all inlets active.
Hiding a bunch of [t b a]'s inside. And that it would be nice if you can
make a single abstraction like this with a variable number of inlets, so
that you don't have to make a seperate one for each case.
Can this be done at all?
BTW dyn~ is very nice, but doesn't seem to work with GEM for some reason.
best Gerard
Hi Gerard,
BTW dyn~ is very nice, but doesn't seem to work with GEM for some reason.
Hmmm, it works for me... can you send me a simple demonstration patch?
The original idea was that you can make an abstraction to act (for instance) like pack but will all inlets active. Hiding a bunch of [t b a]'s inside. And that it would be nice if you can make a single abstraction like this with a variable number of inlets, so that you don't have to make a seperate one for each case.
Can this be done at all?
one way would be to use py/pyext
# Python script: pak.py
import pyext
class pak(pyext._class): def __init__(self,n): # n should be type-checked self._inlets = n self._outlets = 1 # initialize list self.lst = [0 for x in range(n)]
def _anything_(self,n,args):
# args should be type-checked!
self.lst[n-1] = args
self._outlet(1,self.lst)
PD patch:
#N canvas 463 293 278 228 12; #X obj 17 32 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 18 256; #X obj 34 52 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 11 256; #X obj 56 68 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 13 256; #X obj 68 88 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 21 256; #X obj 118 29 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 13 256; #X obj 135 49 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 13 256; #X obj 157 65 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 10 256; #X obj 169 85 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 11 256; #X obj 36 168 print; #X obj 37 129 pyx pak pak 8; #X connect 0 0 9 1; #X connect 1 0 9 2; #X connect 2 0 9 3; #X connect 3 0 9 4; #X connect 4 0 9 5; #X connect 5 0 9 6; #X connect 6 0 9 7; #X connect 7 0 9 8; #X connect 9 0 8 0;
best greetings, Thomas