Forums > MaxMSP

Counter Conundrum

February 22, 2008 | 1:53 pm

Hi guys,

I’m after a way of getting these counters to relate to each other depending on what value they are each at. I’ve got a patch that hopefully explains what I’m trying to do:

max v2;
#N vpatcher 0 0 1280 724;
#P window setfont "Sans Serif" 18.;
#P window linecount 1;
#P comment 463 387 58 9109522 16ths;
#P comment 512 387 42 9109522 8ths;
#P comment 556 387 42 9109522 4ths;
#P window linecount 7;
#P comment 962 185 211 9109522 In other words if I switch between gates the counters will always relate to each other with having to bang the 16ths counter to get them to relate?;
#P window linecount 3;
#P comment 715 294 211 9109522 How can I get 2 8ths to pass for every one bang of 1 4th and 4 16ths;
#P comment 715 218 211 9109522 If I change the counter gate so that counter 1 4 is banged;
#P window linecount 1;
#P comment 725 185 181 9109522 [How do I?];
#P comment 420 186 181 9109522 [In its current setup];
#P window linecount 4;
#P comment 518 212 100 9109522 For every 2 8ths … 1 4th is counted;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 245 288 14 9109513 3;
#P message 230 288 14 9109513 2;
#P message 215 288 14 9109513 1;
#P newex 254 323 42 9109513 gate 3 3;
#P button 286 158 93 0;
#P flonum 473 416 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 334 438 41 9109513 select 1;
#P newex 334 411 27 9109513 % 2;
#N counter 1 16;
#X flags 0 0;
#P newobj 334 385 66 9109513 counter 1 16;
#P flonum 556 416 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 514 416 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 334 523 41 9109513 select 1;
#N counter 1 4;
#X flags 0 0;
#P newobj 334 553 66 9109513 counter 1 4;
#P newex 334 496 27 9109513 % 2;
#N counter 1 8;
#X flags 0 0;
#P newobj 334 467 66 9109513 counter 1 8;
#P window setfont "Sans Serif" 18.;
#P window linecount 4;
#P comment 403 213 100 9109522 For every 2 16ths … 1 8th is counted;
#P connect 13 0 12 0;
#P connect 14 0 12 0;
#P connect 15 0 12 0;
#P connect 11 0 12 1;
#P fasten 12 2 7 0 291 375 339 375;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P fasten 12 1 1 0 275 461 339 461;
#P connect 9 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P fasten 12 0 3 0 259 547 339 547;
#P connect 4 0 3 0;
#P hidden connect 7 0 10 0;
#P hidden connect 1 0 5 0;
#P hidden connect 3 0 6 0;
#P pop;

I’m trying to get them to have the same numerical relationship no matter which counter is banged.

Can you help?

Thanks,

Rhys


February 22, 2008 | 2:36 pm

On 22.02.2008, at 14:53, Rhys Perkins wrote:

> Can you help?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 313 464 31 196617 t b 4;
#P newex 353 464 31 196617 t b 2;
#P newex 388 463 31 196617 t b 1;
#P newex 313 506 40 196617 uzi;
#P window setfont "Sans Serif" 18.;
#P comment 530 454 58 196626 16ths;
#P comment 585 406 56 196626 8ths;
#P comment 623 454 56 196626 4ths;
#P window setfont "Sans Serif" 9.;
#P message 313 400 14 196617 3;
#P message 298 400 14 196617 2;
#P message 283 400 14 196617 1;
#P newex 313 430 91 196617 gate 3 3;
#P button 394 315 93 0;
#P flonum 540 483 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 313 587 41 196617 select 1;
#P newex 313 560 27 196617 % 2;
#N counter 1 16;
#X flags 0 0;
#P newobj 313 534 66 196617 counter 1 16;
#P flonum 623 483 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 583 483 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 313 672 41 196617 select 1;
#N counter 1 4;
#X flags 0 0;
#P newobj 313 702 66 196617 counter 1 4;
#P newex 313 645 27 196617 % 2;
#N counter 1 8;
#X flags 0 0;
#P newobj 313 616 66 196617 counter 1 8;
#P connect 0 0 1 0;
#P hidden connect 0 0 4 0;
#P connect 6 0 7 0;
#P hidden connect 6 0 9 0;
#P connect 12 0 11 0;
#P connect 13 0 11 0;
#P connect 14 0 11 0;
#P connect 10 0 11 1;
#P connect 7 0 8 0;
#P connect 8 0 0 0;
#P connect 1 0 3 0;
#P connect 3 0 2 0;
#P hidden connect 2 0 5 0;
#P connect 19 1 18 1;
#P connect 19 0 18 0;
#P connect 20 1 18 1;
#P connect 20 0 18 0;
#P connect 21 1 18 1;
#P connect 21 0 18 0;
#P connect 11 0 21 0;
#P connect 11 1 20 0;
#P connect 11 2 19 0;
#P connect 18 0 6 0;
#P window clipboard copycount 22;

cheers

p


February 22, 2008 | 2:50 pm

Thanks very much.

I guess it’s easy when you know how and I was trying to make things way too complicated in coming up with an anwser for this.

You’re help is much appreciated p!

Rhys


February 22, 2008 | 4:05 pm

but you should look into if you actually need all your counters.
one with a range of 0 to 15 and some simple math will do the job a
lot more efficient.

cheers
piet


Viewing 4 posts - 1 through 4 (of 4 total)