Increasing float number with a toggle help

Sam Dean's icon

Hi there i'm currently looking for a way to increase the number on a dial in float increments 0.001,0.002,0.003.....4.556 etc. I know the line object can do this over time but a slight difference that i need is instead of the number increasing over time, i want the number to increase when a toggle connected to it is switched on.

Will appreciate any help

nouserid's icon

Max Patch
Copy patch and select New From Clipboard in Max.

Sam Dean's icon

Cheers for the help, i might have explained what i'm after poorly i'll try to be more specific.

I would like to have what happens with the line object, where it will increase from one number to another on its own. But instead of it continuing for the whole time, i would like there to be a toggle that will stop the number increasing if switched on/off. Here's what i've got at the moment, as you can see if you click increase while its still decreasing they clash with each other

Max Patch
Copy patch and select New From Clipboard in Max.

mzed's icon

Like this?

Max Patch
Copy patch and select New From Clipboard in Max.

Sam Dean's icon

yes perfect! thank you, one last thing, is there a way to get another toggle connected to the same f object that can decrease the number?

Roman Thilenius's icon

there is an 110 for everything. in this case 110.incdec does all you want and more.

on this computer i dont have the helpfile ready. you are supposed to connect it like this:

#P user pictctrl 210 96 21 21 purplebutton.pict 0 0 1 0 2 0 0 0 21 21 128 0 1 1 1 0;
#P user pictctrl 168 96 21 21 purplebutton.pict 0 0 1 0 2 0 0 0 21 21 128 0 1 1 1 0;
#P window setfont "Sans Serif" 9.;
#P flonum 87 121 57 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 156 165 128 9109513 110.incdec 1000 50 0.01;
#P connect 1 0 0 0;
#P connect 0 0 1 0;
#P connect 2 0 0 1;
#P connect 3 0 0 2;
#P window clipboard copycount 4;

if you dont want autoscroll, a wait time fo 2000 should be fine.

in case you want to use [button], put a [t 0 1] before the increase and decrease inputs.

110.incdec.zip
zip 0.86 KB
incdec accum