Counter Up When Toggle on then go Down When Off?

Jaibles's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I'm looking to have the counter object count up while a toggle is on, and down to zero (and stay) when it goes off. I've acheived close to what i'm looking for but can't get it quite right with the 2nd inlet. The idea is to use a usb controller with the hi object to turn up volume when a button is held and then reduce back down when the button is released. Here's what I have at the moment could anyone help me with what would be the best way to approach this I've tried a few ways but can't quite get it right!

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I think that this is what you asked for. That said, if as I suspect, you're using this to control a gain~ slider, line might be a better bet.

Jaibles's icon

You've fixed my problem on two fronts! Line is definitely the way to go though yea, thank you very much for the help.

Roman Thilenius's icon

build your own counter using [accum].

-110