[PD] Default symbol if not set by arg

Hans-Christoph Steiner hans at eds.org
Mon Apr 24 15:49:47 CEST 2006


On Apr 24, 2006, at 12:51 PM, Chris McCormick wrote:

> Hey All,
>
> When taking integer arguments in an abstraction, it's nice  
> sometimes to
> set a default if the argument is not set. For this you can do  
> something
> like:
>
> [$1]
> |
> [select 0]
> |      /
> [45(  /
> |    /
> [f   ]
>
> Or maybe something even simpler.
>
> I would like to do something similar for symbolic arguments. I.e. if
> an argument is supplied, use it, otherwise use some default or take
> some other action. Unfortunately there seems to be no way to detect an
> 'empty' symbol. Has anyone got any ideas?

You want [float_argument], [symbol_argument], and [any_argument], in  
CVS: abstractions/purepd

This is how you test for a blank symbol:


|            [loadbang]
|             |
|            [symbol]
|             |
[select symbol]
|             |

.hc




>
> Best rgds,
>
> Chris.
>
> -------------------
> chris at mccormick.cx
> http://mccormick.cx
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/ 
> listinfo/pd-list


________________________________________________________________________ 
____

"Information wants to be free."
                                      -Stewart Brand





More information about the Pd-list mailing list