[PD] receiver with two or more arguments

Enrique Erne pd at mild.ch
Thu Apr 13 13:20:25 CEST 2006


with a abstracion in an abstraction you could make a [r 1-2-test]
but it's a rather ugly solution.

main patch:

[nb\
|
[s 1-2-test]

[firstabstraction 1]



firstabstraction:

[secondabstraction $1-2]



secondabstraction:

[r $1-test]





-------------- next part --------------
A non-text attachment was scrubbed...
Name: mainpatch.pd
Type: application/octet-stream
Size: 307 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20060413/291438de/attachment.obj>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: firstabstraction.pd
Type: application/octet-stream
Size: 143 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20060413/291438de/attachment-0001.obj>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: secondabstraction.pd
Type: application/octet-stream
Size: 101 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20060413/291438de/attachment-0002.obj>
-------------- next part --------------





On Apr 13, 2006, at 11:49 AM, vincent rioux wrote:

> dear list,
> i know this has already been adressed but i still wonder how can one 
> build a receiver with two or more initialization arguments.
>
> nb
> |
> [s 0-1-test]
>
> and in abstraction [pd test 0 1]
> [r $1-$2-test]
> does not work.
>
> i solved this pb with a simple and uncomplete pyext script (r.py, 
> attached):
> to be used like that:
>
> nb
> |
> [s 0-1-test]
>
> and in abstraction [pd test 0 1]
> [pyx r r $1 $2 test]
>
> but i wish i could get a genuine pd solution.
> vincent
>
> import pyext
> class r(pyext._class):
>     _inlets=0
>     _outlets=1
>
>     def __init__(self, *args):
>         r = ''
>         for arg in args:
>             r += str(arg)+'-'
>         self._bind(r[0:-1], self.recv)
>
>     def recv(self, *args):
>         if len(args)==2:
>             self._outlet(1, str(args[0]), (str(args[1]),))
>         elif len(args)==1:
>             self._outlet(1, args)
>         else:
>             self._outlet(1, args)
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> http://lists.puredata.info/listinfo/pd-list


More information about the Pd-list mailing list