[PD] "set"ting messages with arguments
Frank Barknecht
fbar at footils.org
Tue Jun 15 12:29:20 CEST 2004
Hallo,
Tim Blechmann hat gesagt: // Tim Blechmann wrote:
> i'm currently working on a patch that's using set messages to build a
> message...
You might be interested in Cyclone's prepend as well here.
> but i've got a small problem. i can't set a message with a $1
> argument.
>
> i want to build a message like
> |resize $0-buffer $1(
You can't.
> since the $0 isn't working in messages i was building something like:
>
> |ii $0|
> |
> |set resize $1-buffer(
> |
> | (
> but i can't add the variable $1 i want to have...
>
> is there any point i'm missing? if not, what do you think of adding a
> \$1 feature to the message system that's not replaced by the variable?
I'm not sure if that's a good idea, and IMO it's not necessary.
Normally you better work in another idiom. For example:
|
[nbx]
|
[pack 0 $0]
|
[; $2-buffer resize $1 (
Then there's no need to "set" any messages, you'd just send a number
into the pack, and it will resize the local buffer $0-buffer to that
number.
If you store the number to the cold inlet of a float, you can even get
the exact same behaviour as your dynamic message would have: On bang
it would output a message [1001-buffer resize 200(
Of course you can also replace the "resize" in that message by using
[pack 0 $0 somesymbol] and [$2-buffer $3 $1(
Ciao
--
Frank Barknecht _ ______footils.org__
More information about the Pd-list
mailing list