Set negative slider values

DominikK's icon

Hello,

while trying to put a slider object to work I was wondering about it's behavior when it's set to having negatives values.
If I have a slider with minimum value -1. and range of 2 (float output) and I send a "0." or "set 0." message, shouldn't the slider jump to the middle position where it actually outputs 0.? Instead it jumps to -1. as if 0 meant "jump to minimum value" and 1 "jump to maximum value".
That's somehow inconsistent compared to what a slider does when its range is positive.
Am I missing something?

best
dominikk

Herr Markant's icon

never noticed before, but you can use multislider instead of slider

Christopher Dobrian's icon

It's best to think of the 'minimum' as the 'offset' that will be added to whatever comes in the inlet. For an integer slider, the range will be 'range' different integers from 0 to range-1, plus offset, whereas for a float slider the range will be the full range from 0. to range., inclusive, plus offset.

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

Roman Thilenius's icon

it is a silly behavior, you would think that a GUI object alsways outputs what it gets as input (and i second the reference to the mslider object as alternative), but it has historical purposes, so dont be angry at it.

DominikK's icon

Thanks for the answers. I expected it to be one of the infamous historical max behaviours. I just couldn't believe that I never noticed it in all these years of max.

Christopher Dobrian's icon

You can think of it as a sort of scale object hidden inside the slider. It's the 'hidden' aspect that makes it problematic, and the somewhat deceptive word 'minimum', which refers to the minimum output, not the minimum input.

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

Roman Thilenius's icon

if you want it to be a part of a collection of objects all dealing with thi skind of range, it might be easier to add the offset outside. set it base 0 , range 2, then do -1 at the output, nothing at the input.