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

live.toggle Reference

Switch between off and on (0/1)

live.toggle

Description

live.toggle sends a 0 as output when it is turned off and a 1 as output when it is turned on (when giving input, a non-zero number will turn it on, a 0 will turn it off, and a bang will alternate the state of the toggle).

Examples

Arguments

None.

Attributes

active [int] (default: 1)

Toggles the object's active mode. When active is set to 0, mouse action does not cause output and the inactive colors are used.

activebgcolor [4 floats]

Sets the background color when off and active is set to 1.

activebgoncolor [4 floats]

Sets the background color when on and active is set to 1.

annotation_name [symbol] (default: )

The string that is prepended to annotations. This shows up in the Info pane in Live, and the clue window in Max.

appearance [int] (default: 0)8.0.0

Defines the display style.

Possible values:

0 = 'Default'
All attributes, except those with 'lcd' in the name, are functional.

1 = 'LCD'
To adjust the colors of the object you must use the attributes with 'lcd' in the name, such as inactivelcdcolor, and lcdcolor.

bgcolor [4 floats]

Sets the background color when off and active is set to 0.

bgoncolor [4 floats]

Sets the background color when on and active is set to 0.

bordercolor [4 floats]

Sets the border color in RGBA format.

focusbordercolor [4 floats]

Sets the border color for focused live.toggle object in RGBA format.

inactivelcdcolor [4 floats]8.0.0

Sets the border and background color when the appearance attribute is set to 1:LCD, and the active attribute is set to 0.

lcdcolor [4 floats]8.0.0

Sets the border and background color when the appearance attribute is set to 1:LCD, and the active attribute is set to 1.

outputmode [int] (default: 0)8.0.0

Sets the output mode.

Possible values:

0 = 'Mouse down'
Send output on mouse down (default).

1 = 'Mouse up'
Send output on mouse up.

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.

rounded [float]

Set the roundness of the border

Common Box Attributes

Parameter Attributes

Messages

bang

Switches live.toggle on if it is off; switches it off if it is on.

int

Arguments

input [int]
The number is sent out the outlet. If the number is not 0, live.toggle displays an X, showing it is on. If it is 0, live.toggle is blank, showing it is off.

float

Arguments

input [float]
Converted to int. See int listing.

assign

Arguments

assign-input [float]
The word assign, followed by a floating point value, causes that value to be stored and displayed and sent out the live.toggle object's outlet. If the Parameter Visibility attribute is set to Stored Only, the assign message will not add the new value to the Live application’s undo chain.

init

Restores and outputs the initial value.

(mouse)

A mouse click on live.toggle switches the object on if it is off and off if it is on.

outputvalue

Sends the current value out the outlet.

set

Arguments

set-input [int]
Switches the live.toggle on or off without sending anything out the outlet. The word set, followed by any non-zero number, sets toggle to on; set 0 sets it to off.

Output

int

A number received in the inlet is sent out the outlet. A bang or a mouse click sends 1 or 0 out the outlet, depending on whether live.toggle is being turned on or off.

See Also

Name Description
Max For Live Max For Live
led
live.tab
matrixctrl
pictctrl
radiogroup
live.text
togedge
toggle
ubutton
Max Basic Tutorial 4: Metro and Toggle Max Basic Tutorial 4: Metro and Toggle