[PD] best way to do 1/x

Frank Barknecht fbar at footils.org
Wed Jul 2 22:33:17 CEST 2008


Hallo,
Atte André Jensen hat gesagt: // Atte André Jensen wrote:

> Frank Barknecht wrote:
> 
> > As far as I see it, here you may have an execution order problem, at
> > least the first tim you bang that ascii art. ;)
> 
> Is that because of "depth first", which would mean that / sees the 1 at 
> hot inlet first and then carries out 1/0 before the 10 arrives at cold 
> inlet?

Yes: Everytime you have connections fanning out of a message outlet,
the order the connections "fire" is not specified. It's practically
undefined. 

The current implementation of Pd uses the creation order to sort the
patch cords, but that's an implementation detail which might change
anytime without further notice. So don't rely on it! Instead you have
to use a [trigger] to sort the execution order as needed. That's why
patches by Pd "pros" use tons of [t b b a b a ...] objects. ;)

See attached example patch which exploits the current implementation
to make the issue visible.

Ciao
-- 
 Frank Barknecht                                     _ ______footils.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: execution-order.pd
Type: application/puredata
Size: 1844 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080702/217f4242/attachment.bin>


More information about the Pd-list mailing list