greater than, less than control object

Aug 21, 2008 at 2:30am

greater than, less than control object

This is probably a pretty dumb question, but is there a max object that bangs one outlet if the input is less than a particular value and the other if it is more?

#39370
Aug 21, 2008 at 3:04am

It’s not a dumb question since there are too many objects and features for one person to keep track of without going insane or perhaps losing track of the rest of their life, hehe, but the answer is no.

You would create this object yourself quite easily doing something like this:

– Pasted Max Patch, click to expand. –
#138588
Aug 21, 2008 at 3:11am

and if you want exactly what you asked for (one outlet bangs if , nothing if ==), it’s easy as well:

– Pasted Max Patch, click to expand. –
#138589
Aug 21, 2008 at 10:24am

And a Max4, floating point, 2 object version:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 251 68 58 196617 comparison;
#P comment 90 68 72 196617 number to test;
#P comment 388 154 25 196617 less;
#P comment 230 154 43 196617 greater;
#P button 371 153 15 0;
#P button 212 153 15 0;
#P button 51 153 15 0;
#P flonum 51 67 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 212 67 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 212 128 169 196617 if $f1>$f2 then bang else out2 bang;
#P newex 51 105 171 196617 if $f1==$f2 then bang else out2 $i1;
#P comment 68 153 30 196617 equal;
#P connect 2 1 7 0;
#P connect 2 0 6 0;
#P connect 1 0 5 0;
#P connect 4 0 1 0;
#P connect 3 0 1 1;
#P fasten 3 0 2 1 217 94 376 94;
#P connect 1 1 2 0;
#P window clipboard copycount 12;

#138590
Aug 22, 2008 at 2:12am

Thanks, guys! That was pretty simple, but I fail to see a functional difference between the first two patches.

By the way, Zachary, I’m thinking of attending one or both of your classes next week at Harvestworks.

#138591
Aug 22, 2008 at 2:19am

If you mean the difference between my patch and Zachary’s, I think Zachary was saying that you might not want anything to be output when the exact value is selected. Whereas mine would bang at “less-than OR equal” and then also out the other bang at “greater-than”, Zachary’s would bang at “less than”, “greater than” but not when it is “equal”.

#138592
Aug 22, 2008 at 2:29am

and just for the record, I think I like the third patch the best(separate bangs for everything), i’m gonna use it.
Thanks, fairesigneaumachiniste!

#138593
Aug 22, 2008 at 2:38am

Ah, yes. I actually was going for the “or equals to,” but thought I had to change the < to <= to do that. Turns out it's all in the subtlety of the sel object.

#138594
Aug 23, 2008 at 6:15am

Zach,

Would love to see you at either!

best,
Zachary

#138595
Aug 23, 2008 at 6:18am

I will be out of the office from August 7 until August 25 and will not
have access to my email account. If you need assisitance while I am away
please contact Ana Varas at 754-321-2050 or ana.varas@browardschools.com

Thank you

#138596

You must be logged in to reply to this topic.