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

Frank Barknecht fbar at footils.org
Sat Mar 21 17:58:34 CET 2009


Hallo,
Husk 00 hat gesagt: // Husk 00 wrote:

> Thank you all, but I expressed bad my necessity. I found a solution but
> still don't like it. I find inelgant and too much complex for what it has to
> do. I need a counter with two bang, first one for add one unit to the
> counter, second one for subtract one unit. Couter must have min and max
> limits, like 0 and 10 (for example). I attach my patch just like example,
> but as I said it's not a good solution.
> How should you do this?

Like in the attachement for example. It uses an accumulator idiom, which is a
reversed traditional counter where you exhange the [f ]x[+ 1] so it becomes
this instead: [+ ]x[f ]. Then drive it with -1 and 1. 

It's well explained in Andy Farnells fantastic Pd tutorial: 
http://aspress.co.uk/ds/pdf/DesigningSound_abridged_Pure_Data_introduction.pdf
Page 35.

Ciao
-- 
Frank
-------------- next part --------------
#N canvas 207 35 450 300 10;
#X obj 120 157 +;
#X obj 167 158 f;
#X msg 139 124 1;
#X msg 90 124 -1;
#X floatatom 120 213 5 0 0 0 - - -;
#X msg 139 95 up;
#X msg 90 96 down;
#X obj 120 241 hradio 15 1 0 11 empty empty empty 0 -8 0 10 -262144
-1 -1 0;
#X obj 120 189 clip 0 10;
#X connect 0 0 8 0;
#X connect 1 0 0 1;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 7 0;
#X connect 5 0 2 0;
#X connect 6 0 3 0;
#X connect 8 0 1 0;
#X connect 8 0 4 0;


More information about the Pd-list mailing list