invert range values without jump

N00b question, so apologies for that, but i’m trying to invert an ascending stream of numbers from a counter to a descending stream and am struggling to do it without a big jump when the change in direction happens.

In the patch, when the switch toggle is pressed, the output will start descending but there will be a big jump (e.g 45 to -45).

Is there a smooth way to get the numbers to descend starting from the last number in the ascending stream.

i.e

not like this: 41..42..43..44..45..(switch)..-45..-46..-47..-48..

but like this: 41..42..43..44..45..(switch)..44..43..42..41..40..

Cheers

<code>

-- Pasted Max Patch, click to expand. --

Copy all of the following text. Then, in Max, select New From Clipboard.