Hi,
I have a patch like
[r $0_msg] | [print]
And would like to run Pd from command line (-nogui -send "....") and send something to the receive object.
How can I pass the '$0_msg' name in a way bash and Pd understand it?
Have tried different combinations of quotes and bars, but nothing works... :/
thanks! josé
$0 is a unique number that only the abstraction itself knows about. Typically you use it to keep things local. Just like you can't send a message to [r $0_msg] from another patch, you can't do it with "-send", either.
Just create a new patch, put your abstraction there and add a [receive foo] (without $0!) that will send the appropriate message to the abstraction. Now you can do
$ pd -nogui -send "foo 1"
Christof
On 12.12.2021 12:16, padovani wrote:
Hi,
I have a patch like
[r $0_msg] | [print]
And would like to run Pd from command line (-nogui -send "....") and send something to the receive object.
How can I pass the '$0_msg' name in a way bash and Pd understand it?
Have tried different combinations of quotes and bars, but nothing works... :/
thanks! josé
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
you can send something to $0-xxx variables, but you should only do it if it makes sense.
I often create abstractions using $0 as an argument, such as [line-seg 1 2 $0], and then $3 in the abstraction is the same as $0 in the parent. if you really want, you can export the individual $0-values to a text file to be read in the command line. But is it necessary?
$0 is a unique number that only the abstraction itself knows about. Typically you use it to keep things local. Just like you can't send a message to [r $0_msg] from another patch, you can't do it with "-send", either.
Just create a new patch, put your abstraction there and add a [receive foo] (without $0!) that will send the appropriate message to the abstraction. Now you can do
$ pd -nogui -send "foo 1"
Christof
On 12.12.2021 12:16, padovani wrote:
Hi,
I have a patch like
[r $0_msg] | [print]
And would like to run Pd from command line (-nogui -send "....") and send something to the receive object.
How can I pass the '$0_msg' name in a way bash and Pd understand it?
Have tried different combinations of quotes and bars, but nothing works... :/
thanks! josé
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-manageme
I often create abstractions using $0 as an argument, such as [line-seg 1 2 $0], and then $3 in the abstraction is the same as $0 in the parent.
That's a common pattern, yes. Your example doesn't contradict my point, though: because [line-seq] can't access the parent $0 *), you have to pass it from the outside.
if you really want, you can export the individual $0-values to a text file to be read in the command line.
Please don't. $0 are potentially different every time you open the abstraction. Currently, they start with 1000 and increment monotonically, but this is really an implementation detail that you shouldn't rely upon.
Christof
*) with [iemguts/canvasdollarzero] you can
On 12.12.2021 13:28, João Pais wrote:
you can send something to $0-xxx variables, but you should only do it if it makes sense.
I often create abstractions using $0 as an argument, such as [line-seg 1 2 $0], and then $3 in the abstraction is the same as $0 in the parent. if you really want, you can export the individual $0-values to a text file to be read in the command line. But is it necessary?
$0 is a unique number that only the abstraction itself knows about. Typically you use it to keep things local. Just like you can't send a message to [r $0_msg] from another patch, you can't do it with "-send", either.
Just create a new patch, put your abstraction there and add a [receive foo] (without $0!) that will send the appropriate message to the abstraction. Now you can do
$ pd -nogui -send "foo 1"
Christof
On 12.12.2021 12:16, padovani wrote:
Hi,
I have a patch like
[r $0_msg] | [print]
And would like to run Pd from command line (-nogui -send "....") and send something to the receive object.
How can I pass the '$0_msg' name in a way bash and Pd understand it?
Have tried different combinations of quotes and bars, but nothing works... :/
thanks! josé
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-manageme
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
Em dom., 12 de dez. de 2021 às 10:31, Christof Ressi info@christofressi.com escreveu:
*) with [iemguts/canvasdollarzero] you can
I've proposed this https://github.com/pure-data/pure-data/pull/828/commits/31d293142ed186766a95...
which is even better as it expands symbols, so "$$0_something" gets expanded, I do this in my [else/dollsym] object.
the problem is that [receive] can't set its name yet, we also have PRs for that. Both of these would be very useful in these situations. I use it in my GUI abstractions to set built in send/receive names.
cheers