I would like to use a knob to represent a control with a small discrete set of values, for example, the choice of an LFO’s waveform.
Using the step property of Knob I can restrict the knob so that it only ‘visits’ six positions. However, when I do this, the amount I need to move my mouse to go between the min and max values becomes so small that the knob becomes difficult to use.
Contrast the knob in the code below when the line k.step = 1/6; is commented or uncommented:
AFAICS from the help, step controls input (mouse) behavior directly, and output (value) behavior only indirectly.
The usual methodology for SC GUI objects is to accept the normalized, continuous value in the action function, and use the action function to convert to the range you want, including step quantization, e.g. value.round(0.2) would quantize to 0, 0.2, 0.4, 0.6, 0.8, 1.0 (6 steps), or min(value, 0.99999).trunc(1/6) to 0, 1/6, 2/6 … 5/6. Then you wouldn’t need .step at all.
Alternately, ControlSpec has a step size for the output range.
It might work for the action function to set the knob’s value, to show the steps visually.