A newer version of Max is available. Click here to access the latest version of the documentation

slider Reference

Move a slider to output values

slider

Description

Resembles a sliding potentiometer, outputting numbers restricted to a specified range, offset by a specified number, and multiplied by a specified number.

Examples

Produce output by dragging onscreen... or display numbers passing through

Arguments

None.

Attributes

bgcolor [4 floats]

Sets the slider background color in RGBA format.

elementcolor [4 floats]7.0.0

Sets the slider off color in RGBA format.

floatoutput [atom_long] (default: 0)

Toggles floating-point output from the slider object. The default is 0 (off).

knobcolor [4 floats]

Sets the slider knob color in RGBA format. The knobcolor attribute is mapped to the color style color.

knobshape [int] (default: 0)7.0.0

Sets the shape of the slider knob.

Possible values:

0 = 'Indicator+'
1 = 'Less Rounded'
2 = 'Rounded'
3 = 'Triangle'
4 = 'Rectangle'
5 = 'Indicator'

min [float] (default: 0.)

Sets value that will be added to the slider object's value before it is sent out the outlet.

mult [float] (default: 1.)

Multiplier

orientation [int] (default: 0)

Sets the slider object to a horizontal or vertical data display.
Automatic: (the default) sets the display dependent on the size of the slider - longest side of the rectangle that describes the slider sets the orientation.
Horizontal
Vertical

Possible values:

0 = 'Automatic'
1 = 'Horizontal'
2 = 'Vertical'

parameter_enable [int]

Enables use of this object with Max for Live Parameters and allows for setting initial parameter values in the Max environment.

parameter_mappable [int] (default: 1)

When parameter_mappable is enabled, the object will be available for mapping to keyboard or MIDI input using the Mappings feature.

relative [int] (default: 0)

Sets the way that the slider object responds to mouse clicks. In relative mode (the default) the slider keeps its relative position when you click - Moving the mouse outputs higher or lower values in relation to that relative position. In absolute mode, the slider will automatically jump directly to the clicked location.

Possible values:

0 = 'Absolute'
1 = 'Relative'

size [float] (default: 128.)

Value range

style [symbol] (default: )7.0.0

Sets the style to be applied to the object. Styles can be set using the Format palette.

thickness [float] (default: 100.)7.0.0

Sets the thickness of the slider knob. The default value is 100.

Common Box Attributes

Parameter Attributes

Messages

bang

Sends out the number currently stored in the slider.

int

Arguments

input [int]
The number received in the inlet is displayed graphically by slider, and is passed out the outlet. Optionally, slider can multiply the number by some amount and add an offset to it, before sending it out the outlet.

float

Arguments

input [float]
Converted to int.

(mouse)

Clicking and dragging with the mouse causes will change the position of the slider and send a number value out the object's outlet.

set

Arguments

input [list]
The word set, followed by a number, resets the value displayed by the slider, without triggering output.

setminmax

Arguments

values [list]
The word setminmax, followed by two numbers, sets the low and high range values for the slider object. The floatoutput attribute will automatically be set.

Output

int

Numbers received in the inlet, or produced by dragging on slider with the mouse, are first multiplied by the multiplier, then have the offset added to them, then are sent out the outlet.

Although the numbers that can be output by dragging are limited by the range of the slider, numbers received in the inlet are not limited before they are sent out the outlet.

See Also

Name Description
MIDI MIDI
dial
kslider
multislider
nslider
pictctrl
pictslider
rslider
Max Basic Tutorial 7: Numerical User Interfaces Max Basic Tutorial 7: Numerical User Interfaces