Dear all,
I would want to create a message that transmits a list to an object "canvas", but the object "canvas" to which it must transmit, changes to every time, therefore also the message must change to every time (it take the parts that change of the message from the creation arguments of the abstraction).
With "makefilename" and "pack" I am able to create a message like this:
|; |$0-cnv_in_01_01 vis_size 98(
but if I click on the message only a object like [r 0-cnv_in_01_01] (without the "$") receive the message.
Seem that the "$" come deleted from the sender.
How I can dynamically create a message for send lists to a canvas that has a "receive-symbol" like "$0-cnv_in_01_01" ?
Lazzaro
Hi,
|; |$0-cnv_in_01_01 vis_size 98(
but if I click on the message only a object like [r 0-cnv_in_01_01] (without the "$") receive the message.
Seem that the "$" come deleted from the sender.
How I can dynamically create a message for send lists to a canvas that has a "receive-symbol" like "$0-cnv_in_01_01" ?
The solution is to create a float $0, to link it to your message box and to bang it at startup :
[loadbang]
|
[f $0]
|
[pack f f]
|
[$2-cnv_in_01_01 vis_size 98 $1(
You can now receive the first value of the [pack f f] object with : [r $0-cnv_in_01_01 vis_size 98]
Cheers,
Nicolas
Nicolas Montgermont wrote:
Hi,
|; |$0-cnv_in_01_01 vis_size 98(
[$1( is not the same as [$1]
[$0( is not defined at all (and thus set to 0)
$-args in objects are expanded to the arguments of the abstraction; the 0th argument (which you cannot specify explicitly) is a "unique" number.
$-args in messages are expanded to the list-elements of the incoming list; there is no $0-element (well, this is wrong: $0 might be the selector of the list, but in the current implementation of pd it is not)
The solution is to create a float $0, to link it to your message box and to bang it at startup :
[loadbang] | [f $0] |
[pack f f] | [$2-cnv_in_01_01 vis_size 98 $1(
You can now receive the first value of the [pack f f] object with : [r $0-cnv_in_01_01 vis_size 98]
or use:
[vis_size 98 $1( | [s $0-cnv_in_01_01]
mfg,a,.sdr IOhannes
IOhannes m zmoelnig ha scritto:
or use:
[vis_size 98 $1( | [s $0-cnv_in_01_01]
thank you for the explanation (and thanks for the patience) but this don't solve my problem. I try to explain the problem in other words:
I have:
[vis_size 98( | [s $0-cnv_in_01_01]
I dont need to change (or expand) $0, I need to change the last part of the variable name to obtain:
[s $0-cnv_in_01_02] or [s $0-cnv_in_01_03] or [s $0-cnv_in_01_04]
The vis_size (98x98) is the always the same but the canvas that it must be resized always change.
Lazzaro
Lazzaro Nicolò Ciccolella wrote:
IOhannes m zmoelnig ha scritto:
I need to change the last part of the variable name to obtain:
oh, is see....
[s $0-cnv_in_01_02] or [s $0-cnv_in_01_03] or [s $0-cnv_in_01_04]
try something like
[0
|
[makefilename %%d-cnv_in_01_%d]
|
[t b s]
| |
[$0] [set $1(
| |
+-----+
|
[makefilename]
|
[; $1 vis_size 98(
you can stack several [makefilename]s via the "set"-message; (e.g. if you want to change the "in_01_" too) "%%" is used for escaping "%".
mfg..asd IOhannes
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
Lazzaro Nicolò Ciccolella wrote:
IOhannes m zmoelnig ha scritto:
I need to change the last part of the variable name to obtain:
oh, is see....
[s $0-cnv_in_01_02] or [s $0-cnv_in_01_03] or [s $0-cnv_in_01_04]
try something like
[0
| [makefilename %%d-cnv_in_01_%d] | [t b s] | | [$0] [set $1( | | +-----+ | [makefilename] | [; $1 vis_size 98(
(Maybe we just love ASCII art patching a bit too much, where a Pd patch attachment would be easier? ;-P )
Acutally this is overly complicated, as in this case:
[0
|
[makefilename $0-cnv_in_01_%d]
|
[; $1 vis_size 98(
is enough.
(Uhm, Ascii, too, but 'cause I'm ssh'ing without access to a Pd instance.)
Still it's good to know about the %% "trick", which can be a real problem solver e.g. if you need something like: "pd-$0-dataX" to script a [pd $0-dataX] subpatch, when "X" might change as well.
Frank Barknecht _ ______footils.org__
_ __latest track: "scans" _ http://footils.org/cms/show/41