Hi, Brad. The problem is depth-first message passing. And, in PD, if one outlet connects to two things, the messages are sent in the order the connections were made... which you can't tell by looking. If you insert a [print] object after your [+ 1] object, you will see that it always outputs 0 before outputting another number. This is because it first sends its output to the [route], which follows its chain of messages through all the way to the [-1( message, BEFORE sending the same output to the [float] object. So after 4, it outputs 0 and 5, then 0 and 6, etc. It sends its result twice, and the second one replaces the -1 message to the float. Solving it would be as simple as deleting the connection to the [route] object and reconnecting it, so that that message is sent last. Also, I don't know if it matters, but the loadbang means that a 0 is sent on opening. You could just make the float object -1 instead of 0, and delete the loadbang, unless you want an initial 0 output on opening. -Chuckk
Date: Sat, 5 Nov 2005 20:36:20 +0100
From: Brad Kligerman bkligerman@gmail.com Subject: [PD] Building a counter problem To: pd-list@iem.at Message-ID: 9afc437d0511051136x2bdf06bi50fe74584f14651d@mail.gmail.com Content-Type: text/plain; charset="iso-8859-1"
Skipped content of type multipart/alternative-------------- next part
A non-text attachment was scrubbed... Name: counter-1.pd Type: application/octet-stream Size: 1186 bytes Desc: not available Url : http://lists.puredata.info/pipermail/pd-list/attachments/20051105/adc49dff/c...
Oops, I mean deleting and reconnecting the connection between the +1 and the number box, not the connection to the route object.
On 11/6/05, Chuckk Hubbard badmuthahubbard@gmail.com wrote:
Hi, Brad. The problem is depth-first message passing. And, in PD, if one outlet connects to two things, the messages are sent in the order the connections were made... which you can't tell by looking. If you insert a [print] object after your [+ 1] object, you will see that it always outputs 0 before outputting another number. This is because it first sends its output to the [route], which follows its chain of messages through all the way to the [-1( message, BEFORE sending the same output to the [float] object. So after 4, it outputs 0 and 5, then 0 and 6, etc. It sends its result twice, and the second one replaces the -1 message to the float. Solving it would be as simple as deleting the connection to the [route] object and reconnecting it, so that that message is sent last. Also, I don't know if it matters, but the loadbang means that a 0 is sent on opening. You could just make the float object -1 instead of 0, and delete the loadbang, unless you want an initial 0 output on opening. -Chuckk
Date: Sat, 5 Nov 2005 20:36:20 +0100
From: Brad Kligerman <bkligerman@gmail.com > Subject: [PD] Building a counter problem To: pd-list@iem.at Message-ID: <9afc437d0511051136x2bdf06bi50fe74584f14651d@mail.gmail.com > Content-Type: text/plain; charset="iso-8859-1"
Skipped content of type multipart/alternative-------------- next part
A non-text attachment was scrubbed... Name: counter-1.pd Type: application/octet-stream Size: 1186 bytes Desc: not available Url : http://lists.puredata.info/pipermail/pd-list/attachments/20051105/adc49dff/c...
-- "It is not when truth is dirty, but when it is shallow, that the lover of knowledge is reluctant to step into its waters." -Friedrich Nietzsche, "Thus Spoke Zarathustra"
Hallo, Chuckk Hubbard hat gesagt: // Chuckk Hubbard wrote:
The problem is depth-first message passing. And, in PD, if one outlet connects to two things, the messages are sent in the order the connections were made... which you can't tell by looking.
Note that this is an implementation detail, but not part of the "specification" of Pd. The current behaviour can change any time, so relying on the order the connections were made is a highly dangerous patching mistake. Always use a trigger, if order matters, and order matters most of the time, so always use a trigger, regardless of what Matju says. ;)
Frank Barknecht _ ______footils.org_ __goto10.org__