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

led Reference

Color on/off button

led

Examples

Displays an on/off state, announces activity with a flash, or can be used as a toggle

Arguments

None.

Attributes

bgcolor [4 floats]

Sets the background color of the led object in RGBA format.

blinktime [int] (default: 150)

Specifies the duration (in milliseconds) that the led object will flash when it is clicked upon or receives a bang message.

offcolor [4 floats]

Sets the inactive LED color in RGBA format.

oncolor [4 floats]

Sets the active LED color in RGBA format.

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.

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: 95.)7.0.0

Sets the size of the LED in proportion to the size of the object.

useoffcolor [int] (default: 1)7.0.0

When set to 1, the inactive LED color is used, as defined by the offcolor attribute.

Common Box Attributes

Parameter Attributes

Messages

bang

Flashes led on and off quickly, and outputs 0.

Clicking on an led toggles it back and forth between bright and dark, outputting 1 and 0.

int

Arguments

input [int]
If the number is 0, led shows its darkened state, and outputs 0. If the number is not 0, led shows its brightened state and outputs 1.

float

Arguments

input [float]
Converted to int.

(mouse)

Clicking on an led object toggles it back and forth between bright and dark, outputting 1 and 0.

pict

Arguments

color [int]
In left inlet: the word pict, followed by an integer, changes the color used by led.

set

Arguments

on/off-flag (0 or non-zero) [int]
The word set, followed by a non-zero number causes led to show its brightened state, but causes no output; set 0 shows the led object in a darkened state, but causes no output.

toggle

Switches the led from dark to bright and sends 1 out the outlet; or vice-versa, from bright to dark, sending 0 out the outlet.

Output

int

The output is 1 when led is bright, 0 when it is dark. A bang in the inlet flashes led on and off and sends 0 out the outlet.

See Also

Name Description
button
pictctrl
togedge
toggle