[PD] add or subtract value every N ms?
matju at artengine.ca
Fri Jul 27 03:12:25 CEST 2007
On Fri, 27 Jul 2007, Andy Farnell wrote:
> This implementatiion has a small bug. When you change direction the last
> value stored in the float is flushed through so it overshoots by 1 in
> either direction. But it's simple to understand.
That's because you're supposed to use the output of [+] instead of the
output of [f]. That's the difference between a post-incrementing counter
(usual) and a pre-incrementing counter (what is wanted here)
If you do a pre-incrementing counter with multiple directions or speeds,
it's better to make the system driven by the [+]. Then it can use its own
right inlet as the counter value. However Pd forces wires to connect only
different objects, so you have to use something like [t f] as intermediate
for connecting [+] to itself.
_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
More information about the Pd-list