hi frank, all.
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:
OSCroute $1
of course the example patch is an abstraction created like this [memento_test /abs1].
thank you. patrick
#N canvas 226 81 881 697 10; #X floatatom 37 77 5 0 0 1 aFloat - -; #X obj 38 203 hradio 15 1 0 8 empty empty aRadio 0 -6 0 8 -262144 -1 -1 3; #X symbolatom 86 154 10 0 0 2 - - -; #X obj 36 153 symbol; #X obj 36 129 commun /aSymbol $0; #X obj 36 96 commun /aFloat $0; #X obj 39 222 commun /aRadio $0; #X obj 36 21 hradio 15 1 0 8 empty empty empty 0 -6 0 8 -262144 -1 -1 0; #N canvas 558 524 450 300 substate 0; #X msg 21 72 set; #X msg 58 72 substate $1; #X obj 28 48 t b f; #X obj 21 97 originator $1 $0; #X obj 145 72 r dumpOSC; #X obj 28 25 inlet; #X connect 0 0 3 0; #X connect 1 0 3 0; #X connect 2 0 0 0; #X connect 2 1 1 0; #X connect 4 0 3 1; #X connect 5 0 2 0; #X restore 36 40 pd substate; #X connect 0 0 5 0; #X connect 1 0 6 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 4 0 3 0; #X connect 5 0 0 0; #X connect 6 0 1 0; #X connect 7 0 8 0; #X coords 0 0 0.00113507 0.00143472 200 140 0;
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.
Frank Barknecht _ ______footils.org__
_ __latest track: "scans" _ http://footils.org/cms/show/41