Classes | Control | Spec

ControlSpec : Spec : Object

numerical input specification


The original, and most common spec (see Spec). A ControlSpec is used by GUI sliders and knobs to specify the range and curve of the controls. ControlSpec may be used in many ways to map from linear 0..1 range to your desired range and back.

The most common way to create a ControlSpec is by

Class Methods 0.0, maxval: 1.0, warp: 'lin', step: 0.0, default, units, grid)



The minimum value of the range.


The maximium value of the range.


a Warp, a symbol (e.g. \lin or \exponential: Default value is \lin), or something else that returns a Warp when sent the message .asWarp. A CurveWarp is defined by a number.


The smallest possible increment.


The default value.


The units, e.g. "hz". Used by some gui's as a unit label.


Inherited class methods

Undocumented class methods


Instance Methods


Maps and constrains a value between 0 and 1 to the range between minval and maxval.


Maps and constrains a value between minval and maxval to the range between 0 and 1.


The lower of maxval and minval.


The higher of maxval and minval.


Returns value.asFloat.clip(clipLo, clipHi).round(step).


Returns maxval - minval.


Used for EZ GUI classes for guessing a sensible step if none is specified.


Returns the AbstractGridLines subclass corresponding to the current spec, in particular its warp behavior.


.grid = value

Get/set an instance of the AbstractGridLines subclass that describes the range and warp behavior of the current spec, e.g. for use by DrawGrid for drawing grids in Plotter.

Inherited instance methods

Undocumented instance methods

.calcRange(data, defaultRange: 1.0)



.default = value

.gridValues(n: 20, min, max, base: 10)


.looseRange(data, defaultRange, minval, maxval)


.maxval = v


.minval = v

.normalize(min, max)


.roundRange(base: 10)


.shift(amount: 1)


.step = s


.units = value


.warp = w

.zoom(ratio: 1)