Selector question (new user)

Nov 27, 2006 at 12:56am

Selector question (new user)

Hi guys,
I have created this sub patch in order to be able to pick 5 different inputs. It works at the moment but the only problem is that when the counter resets itself the selection 1 option on the counter will activate twice when a bang is sent to it. Anyone have any ideas how I can avoid this happening? The patch should make this question easier to understand. Thanks, Mike. mandrews04@qub.ac.uk

#P button 88 46 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 364 34 48 196617 loadbang;
#P message 490 84 26 196617 600;
#P message 440 84 26 196617 400;
#P message 369 85 26 196617 300;
#P message 296 83 26 196617 200;
#P message 236 83 26 196617 100;
#P flonum 232 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 492 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 442 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 370 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 298 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 230 144 57 196617 cycle~ gtr;
#P newex 501 144 57 196617 cycle~ gtr;
#P newex 438 144 57 196617 cycle~ gtr;
#P newex 373 144 57 196617 cycle~ gtr;
#P newex 301 144 57 196617 cycle~ gtr;
#P outlet 68 341 15 0;
#P newex 67 288 79 196617 selector~ 5;
#P newex 87 171 46 196617 select 6;
#P number 88 138 35 9 1 6 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 84 100 66 196617 counter;
#P connect 21 0 0 0;
#P connect 13 0 8 0;
#P connect 19 0 13 0;
#P connect 20 0 15 0;
#P connect 20 0 16 0;
#P connect 20 0 17 0;
#P connect 20 0 18 0;
#P connect 20 0 19 0;
#P connect 18 0 12 0;
#P connect 12 0 7 0;
#P connect 11 0 6 0;
#P connect 17 0 11 0;
#P connect 10 0 5 0;
#P connect 16 0 10 0;
#P connect 15 0 14 0;
#P connect 14 0 9 0;
#P connect 8 0 3 5;
#P fasten 2 0 0 3 92 198 175 198 175 58 131 58;
#P connect 7 0 3 4;
#P connect 6 0 3 3;
#P connect 5 0 3 2;
#P connect 0 0 1 0;
#P fasten 1 0 3 0 93 159 72 159;
#P connect 1 0 2 0;
#P connect 9 0 3 1;
#P connect 3 0 4 0;
#P window clipboard copycount 22;

#28900
Nov 27, 2006 at 2:21am

two main probs here:

1. there is no need to set limits on a numberbox when you’ve defined limits by patching a recursive process in max.
take away the limits and the prob is gone.

2. you should read the help file for counter: without any arguments, counter will default to having a minimum of 0, and in this case will be a problem for you.

try this:

#P window setfont Geneva 9.;
#P window linecount 1;
#P message 66 32 14 11337737 1;
#P message 52 32 14 11337737 1;
#P message 24 187 14 11337737 1;
#P button 24 34 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 24 160 46 9109513 select 6;
#P number 24 122 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 24 84 66 9109513 counter;
#P connect 0 0 1 0;
#P connect 3 0 0 0;
#P connect 2 0 4 0;
#P fasten 4 0 0 2 29 206 98 206 98 74 57 74;
#P connect 1 0 2 0;
#P connect 5 0 0 2;
#P connect 6 0 0 3;
#P window clipboard copycount 7;

jl

#89120
Nov 27, 2006 at 2:41am

That works great thanks for that. The only problem is that when it is combined with the main patch it stays on selection 1 for the first two clicks only.Thanks,Mike.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 290 151 100 196617 < ------Sub patch;
#P button 180 176 15 0;
#N vpatcher 32 44 632 444;
#P window setfont “Sans Serif” 9.;
#P flonum 46 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 384 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 306 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 256 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 184 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 112 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 44 131 57 196617 cycle~ gtr;
#P newex 392 131 57 196617 cycle~ gtr;
#P newex 315 131 57 196617 cycle~ gtr;
#P newex 252 131 57 196617 cycle~ gtr;
#P newex 187 131 57 196617 cycle~ gtr;
#P newex 115 131 57 196617 cycle~ gtr;
#P connect 11 0 5 0;
#P connect 6 0 0 0;
#P connect 7 0 1 0;
#P connect 8 0 2 0;
#P connect 9 0 3 0;
#P connect 10 0 4 0;
#P pop;
#P newobj 43 178 76 196617 patcher cycles;
#P newex 804 241 79 196617 selector~ 5;
#P newex 824 171 46 196617 select 6;
#P number 825 138 35 9 1 6 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 821 100 66 196617 counter;
#P message 706 126 67 196617 329.627563;
#P message 560 220 67 196617 329.627563;
#P window setfont “Fixedwidth Serif” 10.;
#P window linecount 5;
#P message 373 335 89 1441802 1. , 0.5 2000 0.25 2000 0.125 2000 0.0625 2000 0.03125 2000;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 341 444 41 196617 line~ 1;
#P newex 322 493 41 196617 *~ 0.5;
#P message 499 295 62 196617 0 , 1 10000;
#P message 323 295 62 196617 1 , 0 10000;
#P newex 469 382 47 196617 *~ 0.25;
#P newex 500 355 41 196617 line~ 1;
#P newex 286 378 47 196617 *~ 0.25;
#P newex 317 351 41 196617 line~ 1;
#P newex 557 335 41 196617 *~ 0.5;
#P newex 575 308 41 196617 line~ 1;
#P message 575 282 104 196617 0 , 1 10 1 300 0 690;
#P newex 557 242 40 196617 cycle~;
#P newex 35 75 48 196617 loadbang;
#P message 344 105 29 196617 stop;
#P message 163 123 33 196617 start;
#P newex 344 82 67 196617 delay 10000;
#P message 35 105 84 196617 read gtr512.aiff;
#P newex 34 142 61 196617 buffer~ gtr;
#P button 330 21 15 0;
#P newex 291 226 64 196617 metro 1000;
#P message 233 264 104 196617 0 , 1 10 1 300 0 690;
#P newex 211 314 41 196617 *~ 0.5;
#P newex 233 288 41 196617 line~ 1;
#P user ezdac~ 273 587 317 620 0;
#N vpatcher 153 469 753 869;
#P window setfont “Sans Serif” 9.;
#P message 139 68 14 196617 1;
#P window linecount 0;
#P message 90 204 14 196617 1;
#P message 125 68 14 196617 1;
#P window linecount 1;
#P newex 364 34 48 196617 loadbang;
#P message 490 84 26 196617 600;
#P message 440 84 26 196617 400;
#P message 369 85 26 196617 300;
#P message 296 83 26 196617 200;
#P message 236 83 26 196617 100;
#P flonum 232 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 492 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 442 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 370 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 298 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 230 144 57 196617 cycle~ gtr;
#P newex 501 144 57 196617 cycle~ gtr;
#P newex 438 144 57 196617 cycle~ gtr;
#P newex 373 144 57 196617 cycle~ gtr;
#P newex 301 144 57 196617 cycle~ gtr;
#P outlet 68 341 15 0;
#P inlet 86 51 15 0;
#P newex 67 288 79 196617 selector~ 5;
#P newex 87 171 46 196617 select 6;
#P number 88 138 35 9 1 6 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 84 100 66 196617 counter;
#P fasten 1 0 3 0 93 159 72 159;
#P connect 3 0 5 0;
#P connect 10 0 3 1;
#P connect 4 0 0 0;
#P connect 1 0 2 0;
#P connect 0 0 1 0;
#P connect 2 0 23 0;
#P connect 6 0 3 2;
#P connect 7 0 3 3;
#P connect 8 0 3 4;
#P fasten 23 0 0 3 95 229 151 229 151 93 131 93;
#P connect 22 0 0 3;
#P connect 9 0 3 5;
#P connect 24 0 0 4;
#P connect 15 0 10 0;
#P connect 16 0 15 0;
#P connect 21 0 16 0;
#P connect 21 0 17 0;
#P connect 17 0 11 0;
#P connect 11 0 6 0;
#P connect 21 0 18 0;
#P connect 18 0 12 0;
#P connect 12 0 7 0;
#P connect 13 0 8 0;
#P connect 21 0 19 0;
#P connect 19 0 13 0;
#P connect 21 0 20 0;
#P connect 20 0 14 0;
#P connect 14 0 9 0;
#P pop;
#P newobj 224 148 66 196617 patcher freq;
#P comment 351 25 100 196617 < ------Click me;
#P fasten 31 0 29 3 829 198 912 198 912 58 868 58;
#P connect 29 0 30 0;
#P connect 30 0 31 0;
#P fasten 30 0 32 0 830 159 809 159;
#P connect 16 0 17 1;
#P connect 15 0 16 0;
#P fasten 6 0 5 0 296 260 238 260;
#P fasten 6 0 23 0 296 255 504 255;
#P fasten 6 0 15 0 296 260 580 260;
#P fasten 7 0 11 0 335 91 168 91;
#P fasten 7 0 1 0 229 36;
#P fasten 7 0 22 0 335 72 426 72 426 195 328 195;
#P fasten 7 0 10 0 335 73 349 73;
#P fasten 7 0 26 0 335 74 424 74 424 236 378 236;
#P fasten 7 0 27 0 335 74 565 74;
#P connect 14 0 17 0;
#P connect 27 0 14 0;
#P connect 20 0 21 1;
#P connect 23 0 20 0;
#P fasten 17 0 21 0 562 352 474 352;
#P connect 25 0 24 1;
#P connect 10 0 12 0;
#P fasten 26 0 25 0 378 420 346 420;
#P connect 18 0 19 1;
#P fasten 19 0 24 0 291 478 327 478;
#P fasten 21 0 24 0 474 477 327 477;
#P connect 22 0 18 0;
#P connect 24 0 2 0;
#P connect 24 0 2 1;
#P fasten 12 0 6 0 349 129 296 129;
#P fasten 34 0 6 0 185 213 296 213;
#P fasten 4 0 19 0 216 353 291 353;
#P fasten 11 0 34 0 168 156 185 156;
#P fasten 11 0 2 0 168 337 278 337;
#P connect 3 0 4 1;
#P connect 5 0 3 0;
#P connect 1 0 4 0;
#P connect 13 0 9 0;
#P fasten 9 0 8 0 39 121;
#P window clipboard copycount 36;

#89121
Nov 27, 2006 at 5:14pm

if you read my post carefully, you’ll see that counter takes a variety of *arguments*.
please consult the helpfile further before posting again.

thanks,
jl

#89122
Nov 27, 2006 at 6:09pm

Ok, I did consult the help file, many times in fact but it does not mention that counter *has* to contain an argument and as the solution patch you posted also didn’t contain any *arguments* I got confused. As I said I am a new user so all this stuff is still new to me. Thanks,Mike.

#89123
Nov 27, 2006 at 7:18pm

> counter *has* to contain an argument

it doesn’t unless you’d like for the count to start at something besides zero, or if you use an initializer.
in the case of initializing it (e.g., with a 1), either set it in the left inlet (set #) or with the second/third-from-right inlets as shown.

the reason that i kept your original solution intact is to illustrate that the number you “jump” to can be set dynamically— this could be useful for other purposes.

apologies if the post came across as confusing.

also, check out tutorial #31 in the “max4.x tutorials and topics” PDF (assuming you’re using 4.x).

jl

#89124
Nov 27, 2006 at 7:53pm

Ok thanks for all the help I will check out that tutorial. Thanks,Mike.

#89125
Nov 28, 2006 at 11:05pm

Mike Andrews wrote:
> Ok, I did consult the help file, many times in fact but it does not
> mention that counter *has* to contain an argument and as the solution
> patch you posted also didn’t contain any *arguments* I got confused.
> As I said I am a new user so all this stuff is still new to me.

The best recipe in max against confusion, is trial and error. Take the
help file and ask the object by connecting other stuff, try out how it
reacts without arguments, with certain arguments and so on. Connect
print or a [prepend set]->messagebox to the outlets… That way most
questions answer themself. (Most answers I give on the list are not from
my direct knowledge, but from my knowledge how to ask Max, which I
usually have to do, I have a very bad memory… ;-)
btw counter would complain if it *had* to have arguments. Its happy
without and there are enough crucial cases where you would not want to
give counter arguments…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#89126

You must be logged in to reply to this topic.