[PD] memento : [pd substate] in an abstraction?

Frank Barknecht fbar at footils.org
Wed May 18 05:53:02 CEST 2005


Hallo,
patrick hat gesagt: // patrick wrote:

> can you have a look at my patch? there's a sub-patch called [pd
> substate]. how can i turn this into an abstraction, so if i have to do a
> modification, i will just have do it in this patch. i tried to convert
> the [pd substate] into an abstraction, but got this error:
> 
> * OSC-route: float arguments are not OK.
>  OSCroute $1
> 
> of course the example patch is an abstraction created like this
> [memento_test /abs1].

If you call the abstraction as that, [memento_test /abs1], you will
not get this error. At least I don't get one. 

Generally you need to consider both arguments of [originator]: 

The first one has to be a possible OSC-target, that is, it needs to be
a symbol starting with "/". If you intend to use several instances of
your abstraction, then you can create the [originator] with $1 as
first argument, so that the real first argument is specified by the
user of your abstraction.  Like in [memento_test /abs1]

The second argument to [originator] acts like a kind of filter on
which [commun]-objects to talk to. Only [commun]s with a matching
number will be seen by a certain [originator].

That is [originator /something 12] will only talk to [commun /x 12]
but not to [commun /x 13]. 

Exploiting the special number "$0" here, you can create a kind of
local storage area which is only valid inside one abstraction
instance. 

Not about your patch: If you just convert [pd subpatch] to an
abstraction, say to "sub-abstraction.pd" you will also need to change
the originator arguments, because otherwise they will use a different
"$0" than the [commun] objects in your patch and the communication
will be broken. Are you sure, that you really want to convert only
this subpatch to an abstraction? IMO [memento_test] is perfectly
usable as it is. To use it several times, just give it different
arguments. 

To make a global "substate switcher", it's better to use OSC messages
like: "/*/preset $1" send to all [memento_test] instances. There is a
hidden  global receive target available for this: "RRADICAL-OSC",
which is a bit beta-quality, as it's not completely tested. Another
hidden receiver is SET_ALL_RRADICALS which acts like a target for all
[originator]s. Just use "setsub $1"---[s SET_ALL_RRADICALS] to switch
substates. 

Ciao
-- 
 Frank Barknecht                               _ ______footils.org__
             
          _ __latest track: "scans" _ http://footils.org/cms/show/41




More information about the Pd-list mailing list