[PD] initialization arguments and defaults
IOhannes m zmoelnig
zmoelnig at iem.at
Fri Feb 20 20:51:22 CET 2004
matthew shanley wrote:
> hi all,
>
> i'm trying to make a patch that includes as a creation argument, a file
> to be loaded into playsf~ (but my question is valid for a symbol
> argument for anything i think). in addition, i also want a default file
> loaded if no creation argument is supplied. i've included a patch that
> accomplishes everything i need. what i'm wondering is if there is a more
> elegand solution. as i'm getting more fluent with pd, i'm trying to
> learn the best practices i can.
>
the problem with your patch is, that it is dependent on the execution
order of the 2 [init] objects.
you shouldn't have 2 competing [loadbang]s ([init] is just a special
case of [loadbang]) in one patch. it breaks your patch if you
re-instantiate the [ii stevie.aif] - you will load stevie.aif no matter
what you type into your object.
rather use [trigger] to schedule it.
the attached derivation of your patch fixes this (and is only about half
of the size)
mfg.asd.r
IOhannes
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testinit.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20040220/07920568/attachment.txt>
More information about the Pd-list
mailing list