[PD] a simple counter, I'm not able to do it tonight

Ben Baker-Smith bbakersmith at gmail.com
Wed Mar 18 20:38:44 CET 2009


So you want a counter that counts to 100 and then begins at 0 (or 1) again?

If I'm understanding correctly I would do the following:

[bang(
|
[float]X[+ 1]
|
[select 100]
|
[0(


the 0 message at the end could also be a 1 depending on if you want the
counter to begin on 0 or 1, it is sent to the right inlet of float.

the outlet of float is, in addition to [select], also sent wherever you want
the counter to be output to.

here is the same patch as a subpatch (keeping in mind that the 0 message
still must be connected to the right inlet of float):

[inlet]
|
[b]
|
[float]X[+ 1]
| \
| [outlet]
|
[select 100]
|
[0(

...of course you can always use the [counter] object.  [counter 100] will
probably do the trick all by itself.
and finally, if i'm understanding incorrectly and you wanted it to count up
and back down, use the example that was posted previously with the absolute
values and [wrap],
or use [counter 100] with the up/down message sent to it, you'll have to
check the help file for exactly what that message is...

hope something in there helps.

-Ben
<pd-list at iem.at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090318/b330ec93/attachment.htm>


More information about the Pd-list mailing list