Hi guys,

Thanks for all your suggestions and explanations ([trigger], [;semicolon message( acting a senders, dollars init variables vs. other dollar variables, the magic of $0, ...). Since I'll probably put a lot of scrolling graphs in my app, I think I'll go with the initialization argument solution and modify pdd_scroll as needed.

Cyrille, I did not have time to test mapping/timeroll yet. I guess this is in SVN extensions/abstractions/externals/.... I need to dig extensions in order to find ones I could use (widgets like gauges, knob, etc...).


Cheers,
Seb

Hi Sebastien,

Sebastien Lelong hat gesagt: // Sebastien Lelong wrote:

 
I have one question though (not related to [trigger]). In your example, as
in Martin's, you use $0-a16 to name the array. I understand $0 is used when
building an abstraction and creating multiple instances of this abstraction.
My question is how can I configure this array, from the parent (from the
patch using the abstraction) ? For instance, I'd like to add "xticks",
"ylabel", etc... I usually use a message, like:
_________________
[array1 ylabel -1 0 1 (

but the same with $0-a16 obsviously doesn't work, since $0 is not known (I
understand it's a counter incremented at each creation).    

if there aren't too many of those arrays in your patch, probably Frank's solution is far more simple and convenient.

another possibility would be using creation arguments as names. you would then use $1-arrayname in an abstraction instead of $0-arrayname which uses the first creation argument of the abstraction in your parent patch. (so $2 stands for the second creation argument and so on)

if you create an object [myabstraction something]  in your parent patch you can access the array's properties by sending for example

[ylabel -1 0 1(
|
[s something-arrayname]

or like you wrote before using
[; something-arrayname ylabel -1 0 1(]

also have a look at /doc/2.control.examples/14.dollarsigns.pd for more stuff with dollar signs as creation arguments. (i found it kind of confusing the first time, so perhaps better don't try too hard and have a look later again)

notice that dollar signs in messages like

[$1 $2 (

are not the same as dollar signs from creation arguments. That's one thing which can also seem strange when learning pd...

Just try the below to understand what dollar signs stand for in messages.

[one two three four(
|
[$2 $3 $1(
|
[print]

Dollar sings in messages like the above are not affected by creation arguments, by default they return 0 (and an error message, just click on the message [$2 $3 $1( directly to see that).

in the ppd_scroll abstraction you would have to change each $0-graph into $3-graph (because $1 and $2 are already in use) and then create instances of it like [ppd_scroll 10 1 myname] and send settings to myname-graph then.

cheers,
Martin



--
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org