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

live.grid

A UI grid of steps, with constraints and directions

Description

The live.grid object is a user interfaces object designed for use with the chucker~ object. It provides a display grid of steps, constraints for transposition, and playback direction for use in controlling the chucker~ object.

Arguments

None.

Messages

int step-index [int]
Sets, displays and outputs the current step. The list sent out the left outlet of the live.grid object takes the form step(s)direction (optional, depending on the visibility of the directions panel). When the live.grid object is in Matrix Mode and there is no value selected in the column, a 0 is sent as the step value.
list input-list [list]
When the direction attribute is set to 0, a list of 2 values sets the step index and value.
When the direction attribute is set to 1, a list of 3 values sets the step index, value and direction.
When the matrixmode attribute is set to 1, a list of 3 values sets the object's behavior: x, y, and state (0/1). An optional fourth value can be used to set direction (-1/0/1).
clear The clear message is only used when the matrixmode attribute is enabled, and will deselect all currently set rows and columns.
constraint constraint of the step [list]
Sets the constraint for a specific step. For instance, the message constraint 3 0 0 1 1 sets the constraints of the third step (column numbering starts at 1) to 0 0 1 1.
directions directions [list]
Sets the grid directions, used to indicate the direction of playback of a step:
-1: Backward
0: Stop
1: Forward
down Decreases (lowers) the current values of all the steps by one. New step values are sent out the second outlet.

Note: The current constraints, if any, are also taken into account when altering current step values; the resulting shift might be "rounded" to the closest step.
freeze step-index [int]
Set the index is 0 to hide the overlay used to indicate frozen values.Any index greater than zero sets and displays the frozen step.
getconstraint column [int]
The word getconstraint, followed by a number that specifies a column in the live.grid display, will send a list consisting of the column number followed by a list indicating the constrain state of each cell in the column, from bottom to top (column numbering starts at 1). Constraints are indicated as follows:
0: Constraint
1: No constraint
getdirections column [int]
The word getdirections, followed by a number that specifies a column in the live.grid display, will send a list consisting of the column number followed by the direction out the fourth (dumpout) outlet (column numbering starts at 1). The direction is indicated as follows:
-1: Backward
0: Stop
1: Forward
getcell x-index [int]
y-index [int]
The word cell, followed by a pair of numbers that specifies the x and y indices of a cell in the live.grid display, will send a list consisting of the word cell, a number pair that specifies the x and y indices, and the value of the cell (column numbering starts at 1).
getcolumn column [int]
The word getcolumn, followed by a number that specifies a column in the live.grid display, will send a list consisting of the word column, a number that specifies the column index, and a list of the current column values out the fourth (dumpout) outlet (column numbering starts at 1).
getrow row [int]
The word getrow, followed by a number that specifies a row in the live.grid display, will send a list consisting of the word row, a number that specifies the row index, and a list of the current row values out the fourth (dumpout) outlet (row numbering starts at 1).
init Restores and outputs the initial values.
left Rotate the values of all steps to the left. New steps values are sent out the second outlet.

Note: The current constraints, if any, are also taken into account when altering current step values; the resulting shift might be "rounded" to the closest step.
linkdump When the link attribute is set to 1, the linkdump message sends all messages required to synchronize one live.grid object to another live.grid object out the object's right outlet.
(mouse) Click and drag to edit the step values or constraints, depending on the current display mode.
set step-index [int]
Sets and displays the current output step without causing output.
random type (optional) [list]
The word random generates new step values or step constraints, depending on the current mode. An optional second argument can be used to select a portion of the UI object to randomize:
steps: Randomize the steps values
constraint: Randomize constraints and make sure that the steps values are correct with respect to the new constraints grid
directions: Randomize directions if the direction attribute is set to 1.
reset type (optional) [list]
The word reset sets the default values or clears the constraints, depending on the current mode. An optional second argument can be used to select a portion of the UI object to reset:
steps: Reset the steps values (Note: since the reset may interact with the current constraints, a given step value may not be completely reset)
constraint: Clear all constraints
directions: Set all the directions to forward if the direction attribute is set to 1.
setcell x-index [int]
y-index [int]
value [int]
The word setcell, followed by a pair of numbers that specifies the x and y indices of a cell in the live.grid display and a number value, will set the value of the specified cell (column numbering starts at 1).
steps step values [list]
Sets the values of all the steps at once. Value numbering starts at 1.
right Rotate the values of all the steps to the right. New steps values are sent out the second outlet.

Note: The current constraints, if any, are also taken into account when altering current step values; the resulting shift might be "rounded" to the closest step.
up Increases (raises) the values of all steps. New steps values are sent out the second outlet.

Note: The current constraints, if any, are also taken into account when altering current step values; the resulting shift might be "rounded" to the closest step.

Attributes

Name Type g/s Description
bgstepcolor float Sets the background step color of the live.grid object in RGBA format.
bgstepcolor2 float Sets the second background step color of the live.grid object in RGBA format.
bordercolor float Sets the border color of the live.grid object in RGBA format.
bordercolor2 float Sets the second border color of the live.grid object in RGBA format.
columns int
def.:16
Sets the number of columns in the live.grid object's display
direction int
def.:1
Toggles the display of the directions arrows.
directioncolor float Sets the color of the direction's arrows in RGBA format.
freezecolor float Sets the color of all frozen steps in RGBA format.
hbgcolor float Sets the highlighted background color of the live.grid object in RGBA format.
link int
def.:0
Toggles link mode. When activated, all the necessary messages to synchronize two live.grid objects are sent out the right outlet.
marker_horizontal int
def.:4
Defines the "first beat" indicator on the live.grid object's horizontal axis. The bgstepcolor attribute sets the display color for this indicator. To hide the indicator, set the attribute value to zero.
marker_vertical int
def.:4
Defines the "first beat" indicator on the live.grid object's vertical axis. The bgstepcolor attribute sets the display color for this indicator. To hide the indicator, set the attribute value to zero.
matrixmode int
def.:0
Toggles matrix mode for the object's display. In matrix mode, multiple cells in a row or column may be selected.
Note: The list and steps messages change their syntax slightly when used in conjunction with this attribute. See the listing for these messages for more details.
mode int
def.:0
Defines the current display mode:
0 (Edit Mode): Allows editing of each step value
1 (Constraints Mode): Allows editing of each constrain
rounded float
def.:4.
Defines the roundness of the grid in pixels.
rows int
def.:16
Sets the number of rows in the live.grid object's display. The minimum number of rows is 2 when the matrixmode attribute is not set, and 1 if it is.
spacing float
def.:1.
Defines the grid spacing in pixels.
stepcolor float Sets the step color of the live.grid object in RGBA format.

Information about attributes available for Parameter-aware objects

Information for box attributes common to all objects

Output

anything:
Out the fifth outlet: dumpout message used to query the live.grid object.
Out the rightmost outlet: Synchronization messages are sent through this outlet when the link attribute is set to 1.
list:
Out the leftmost outlet: Current step value: y value, direction (optional, depending on the visibility of the directions pane).
Out second outlet: The steps values are sent out this outlet whenever they are changed via the mouse or a message. If the live.grid object is in Matrix Mode, the step value/y value coordinates of all "on" points are sent out the outlet.
Out third outlet: The directions values are sent out this outlet whenever they are changed via the mouse or a message. Note that this outlet does not output anything when the direction attribute is set to 0.
Out the fourth outlet: Mouseover information: x, y, direction (optional, depending on the visibility of the directions panel). Also when the mouse is used to change a setting, the message mousechange N is sent, where N indicates the type of change (0 = steps, 1 = directions, 2 = constraints).

Examples

See Also

Name Description
live.step Step Sequencer UI object
multislider Multiple slider and scrolling display
itable A table in a patcher window
matrixctrl Matrix switch control
chucker~ Segment audio and reorder it on looped playback