lowest & highest numbers + total amount

christiancurtis's icon

I have a small part of a patch here that I'm working on.

All it does is look at the lowest and highest number, and also a total number, which includes the two toggles selected plus counts the number of toggles in between them. What I have done works fine, but I'm guessing there is a much better way of achieving it. I think I've over complicated it. I'd appreciate i if someone could show me a simpler way of achieving the same thing.

Also, just thought, purely cosmetic, but it would be nice if the toggles between the lowest and highest were switched on, so for instance if you press toggles 2 and 7 then 3, 4, 5, 6 would be turned on. if you released toggle 7 then 3, 4, 5, 6 would be turned off again just leaving 2. As I said purely cosmetic. I'm using the patch with touchOSC. It would just mean that the buttons in between would light up on the iPad. Definitely not essential.

Thanks in advance for any help.

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

Best,
Christian

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

Thanks Chris. Thats a much better way of getting the lowest, highest & total. I haven't had a chance to look into getting the contiguous toggles to fill in the way I would like yet, but will post it back up when I sort it out.