[PD] loadbang not sent for dynamically created objects?

Frank Barknecht fbar at footils.org
Mon Feb 21 09:50:00 CET 2011


On Sat, Feb 19, 2011 at 07:49:09PM +0000, Pedro Lopes wrote:
> >yes, this is known.
> By known you mean.. Is it on the bug tracker already?

As Cyrille wrote, it's not a bug, but a feature: Usually when you use an
abstraction in your patch and you load that patch, everything inside of that
abstraction is loaded first, including its loadbangs, then the surrounding
patch goes through its own loadbangs. Normally you don't recognize this, but
the order becomes important, when the abstraction sends something to the
surrounding patch for example through its outlet. Then the rule is: First the
abstractions sends through the outlet, possibly influencing stuff in the main
patch, then the main patch loadbangs. See the attachement "main.pd" for an
illustration of this behaviour.

Now dynamic patching basically is the same as loading a patch: The messages are
almost the same, only now they get sent to a [pd something] subpatch-receiver
instead of to Pd's internal objectmaker. You can see this in the second
example, main-dynamic.pd, whic just patches the contents of main.pd into a
subpatch.

The important difference is the handling of loadbangs: If an abstraction like
[lb-abs] would execute its loadbang immediatly, then it would bang to an
outlet, that is not yet connected!  So in the end your result would be
different from the result you get when loading main.pd, although it's the same
construction. 

To overcome this ambiguity, loadbanging in dynamic patching is an explicit
action: You have to initiate the loadbangs at an appropriate time that you
decide on your own. Ususally it's fine to do that by sending a "loadbang"
message at the end of your dynamic patching cycle, to the same receiver. This
way also the execution order of the construct you've build will be preserved in
execution of the loadbangs and initialisation.

> When such things are discovered (and by things I mean issues), shouldn't
> they be documented inside the help patches?

There are no official help patches for dynamic patching, only the tutorial
floating around somewhere, which I can't find ATM. The loadbang explanation
should probably be inside of this, if it isn't already.

Ciao
-- 
 Frank Barknecht            Do You RjDj.me?          _ ______footils.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dynamic-loadbang.tgz
Type: application/x-gtar
Size: 686 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20110221/048b7ea9/attachment.tgz>


More information about the Pd-list mailing list