Hi list,
I have an abstraction named "overlap". It takes an argument, such as "first" or "second".
This abstraction outputs a list. I would like this list to contain the argument. I tried with $0 from inside the abstraction to no avail. It looks like $0 is available only to send and receive ?
Maybe this sounds obvious, but I can't find the answer.
Thanks,
The arguments start from $1. $0 is a unique identifier per instance of an abstraction. The $1,...,$N strings work differently in messages and objects. $0 does nothing inside messages.
Just create an object [$1], send it a bang, and it dumps out the 1st argument of the abstraction it's in. I use it this way for floats. I think you need to declare it differently for strings/symbols. How about [symbol $1]?
Chuck
On Mon, Oct 15, 2012 at 10:19 AM, Charles Goyard cg@fsck.fr wrote:
Hi list,
I have an abstraction named "overlap". It takes an argument, such as "first" or "second".
This abstraction outputs a list. I would like this list to contain the argument. I tried with $0 from inside the abstraction to no avail. It looks like $0 is available only to send and receive ?
Maybe this sounds obvious, but I can't find the answer.
Thanks,
-- Charlot
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
[list append] works with floats and symbols. ++
Jack
Le 15/10/2012 17:39, Charles Henry a écrit :
The arguments start from $1. $0 is a unique identifier per instance of an abstraction. The $1,...,$N strings work differently in messages and objects. $0 does nothing inside messages.
Just create an object [$1], send it a bang, and it dumps out the 1st argument of the abstraction it's in. I use it this way for floats. I think you need to declare it differently for strings/symbols. How about [symbol $1]?
Chuck
On Mon, Oct 15, 2012 at 10:19 AM, Charles Goyard cg@fsck.fr wrote:
Hi list,
I have an abstraction named "overlap". It takes an argument, such as "first" or "second".
This abstraction outputs a list. I would like this list to contain the argument. I tried with $0 from inside the abstraction to no avail. It looks like $0 is available only to send and receive ?
Maybe this sounds obvious, but I can't find the answer.
Thanks,
-- Charlot
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-10-15 17:39, Charles Henry wrote:
Just create an object [$1], send it a bang, and it dumps out the 1st argument of the abstraction it's in.
this really only works for floats. if the user calls [myabs moses], [$1] will evaluate to [moses] which will not dump it's name when banged.
I use it this way for floats. I think you need to declare it differently for strings/symbols. How about [symbol $1]?
the generic solution for this is to use [list prepend $1] it will output a float when you pass it a float and a symbol when you pass it a symbol (to be precise, it will output a "list" message with one atom (float or symbol), which will be interpreted by most objects as the correct type)
fgamsdr IOhannes
Le 15/10/2012 17:19, Charles Goyard a écrit :
Hi list,
I have an abstraction named "overlap". It takes an argument, such as "first" or "second".
This abstraction outputs a list. I would like this list to contain the argument. I tried with $0 from inside the abstraction to no avail. It looks like $0 is available only to send and receive ?
Maybe this sounds obvious, but I can't find the answer.
Thanks,
Salut Charles,
Are you looking for something like that ? (See attached). ++
Jack
Hi,
Charles Henry wrote:
The $1,...,$N strings work differently in messages and objects.
Ok, I think that was a missing concept in my understanding of pd.
How about [symbol $1]?
Works !
Salut Charles,
Salut Jack :),
Are you looking for something like that ? (See attached).
Yes, works !
Thanks to you two.
Charles
Le 15/10/2012 17:19, Charles Goyard a écrit :
Hi list,
I have an abstraction named "overlap". It takes an argument, such as "first" or "second".
This abstraction outputs a list. I would like this list to contain the argument. I tried with $0 from inside the abstraction to no avail. It looks like $0 is available only to send and receive ?
Maybe this sounds obvious, but I can't find the answer.
Thanks,
Or the same thing with a message... ++
Jack