output 1 every time a value changes in gen

Dario's icon

anybody know how I would output a 1 whenever a value changes in gen~? I assume that I would have to use an == and a history operator because gen works sample by sample. but it isn't working. I've tried something like this among other things:

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

Dario's icon

aw. im a doofus. figured it out :0