Pass a number only when meet another number range
Hi,
I try to make a simple patch with no success.
I have two number: number1 and number2.
I want that number1 will pass through a gate only when it arrive to be in the range of ten numbers above or below number2. Lets say number two is 500. if number1 is somewhere between 510 and 490 that gate will open and number1 will pass. If number1 is above or below that range, the gate will stay close.
I know I can use 'sel' object in order to compare two exact number, but I want to have slightly a bigger range in order to pass number1.
perhaps I need to use if statement ? I just could not make it the right way.
I hope I make myself clear,
Thanks for any help!
split
or using basic objects
#P toggle 364 280 15 0;
#P toggle 230 278 15 0;
#P toggle 269 345 15 0;
#P window setfont "Sans Serif" 9.;
#P number 148 397 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 280 309 50 9109513 *;
#P newex 165 181 50 9109513 t i i i;
#P newex 358 248 50 9109513 <=;
#P number 124 128 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 240 246 50 9109513 >=;
#P newex 430 189 50 9109513 + 10;
#P newex 350 189 50 9109513 - 10;
#P number 452 123 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 151 358 50 9109513 gate;
#P comment 309 334 220 9109513 output 1 only if both conditions are true;
#P connect 4 0 7 1;
#P connect 7 0 9 1;
#P connect 7 0 13 0;
#P connect 5 0 12 0;
#P connect 5 0 9 0;
#P connect 9 0 1 0;
#P connect 9 0 11 0;
#P connect 2 0 3 0;
#P connect 2 0 4 0;
#P connect 1 0 10 0;
#P connect 8 0 1 1;
#P connect 8 1 5 0;
#P connect 8 2 7 0;
#P connect 6 0 8 0;
#P connect 3 0 5 1;
#P window clipboard copycount 14;

oops, pasting the canvas as bitmap works better on mac it seems^^
Thank you all for help!