On 08/09/2011 15:39, Andy Farnell wrote:

Try a [div] [mod] chain

Four digits base 3 would be

base 10
|
[t f f]_[mod 3]_ D0
|
[div 3]
|
[t f f]_[mod 3]_ D1
|
[div 3]
|
[t f f]_[mod 3]_ D2
|
div 3]
|
[t f f]_[mod 3]_ D3
|
etc. for more digits

On Thu, 8 Sep 2011 15:19:03 +0200
tim vets<[email protected]>  wrote:

Hello,
Does anyone have an example of how to do ternary counting in pd?
00
01
02
10
11
12
20
21
22
...etc

thanks,
Tim

Maybe also something like this (still using [mod 3] and [div 3] as Andy suggested)?

Lorenzo
#N canvas 573 124 444 395 10;
#X obj 84 169 mod 3;
#X obj 32 69 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X floatatom 84 196 5 0 0 0 - - -;
#X obj 32 95 f 0;
#X msg 78 67 0;
#X text 111 65 reset;
#X symbolatom 32 311 10 0 0 0 - - -;
#X floatatom 32 196 5 0 0 0 - - -;
#X obj 32 169 div 3;
#X obj 67 95 + 1;
#X floatatom 32 141 5 0 0 0 - - -;
#X obj 32 222 * 10;
#X obj 32 259 +;
#X obj 84 222 t b f;
#X obj 32 286 makefilename %08d;
#X obj 126 311 cnv 15 140 25 empty led 00000301 20 12 0 14 -1 -4034
0;
#X msg 34 331 label \$1;
#X obj 34 354 s led;
#X obj 32 30 metro 1000;
#X obj 32 3 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 13 0;
#X connect 3 0 9 0;
#X connect 3 0 10 0;
#X connect 4 0 3 1;
#X connect 6 0 16 0;
#X connect 7 0 11 0;
#X connect 8 0 7 0;
#X connect 9 0 3 1;
#X connect 10 0 8 0;
#X connect 10 0 0 0;
#X connect 11 0 12 0;
#X connect 12 0 14 0;
#X connect 13 0 12 0;
#X connect 13 1 12 1;
#X connect 14 0 6 0;
#X connect 16 0 17 0;
#X connect 18 0 1 0;
#X connect 19 0 18 0;
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to