setminmax doesn't work on slider w minimum set to anything other than 0. when using set message
I have a slider and a number box in my interace connected to each other so that the user can change the value in either one and it is correctly reflected in the other. I use a direct connection between the slider and the number and a prepend set message the other way so that there is no infinite loop, as is standard practice. But if I use setminmax (or size and min messages) and set the min to anything other than 0., the prepend set message reports the wrong value in the slider. The range is correct but the min offset is not repected. See simple patch:
just had a quick look, it seem to be the mouse itself what causes this, so it is probably releated to one of these modern gui externals functions such as midilearn, automapping blah blah.
hm, a deferlow in the loop makes it worse, not better.
to sum it up:
you want to be able to change mix/max or min/range to arbitrary values, but it only works when you start the object with default values such as min -9999999 and range 9999999, otherwise changes to a negative range causes trouble, right?
Im actually talking about something different. Attached is a simpler case. Using a slider, everything works when you change range if min is 0. As in the first example. But if you change the min to anything other than 0., the value input is not the value output because the minimum offset is not applied. See the second two examples
this example makes clear that [slider] does exactly what it should.
in [slider]´s logic its value is the 0 - n which you can also successfully set it to from the numberbox. its output may then contain an offset (such as -2 or 2), but this is not its value range.
at the same time i must admit that the use of the words mininum and maximum in parts of the reference and helpfile - and the "setminmax" command - are highly irritating, because that simply does not describe what it actually does. (at least when compared to all other objects.)
only the names used in the inspector (minimum and range) will tell you the truth.
if you need minimum values other than 0 often, ignore slider and use [multislider].
the only noticeable difference is that multislider requires "set 1 4." with the set message, otherwise it is the better slider.
i´ve never in my life used [slider] because of that. its historic context is MIDI...