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

jit.matrix Reference

The Jitter Matrix!

jit.matrix

Description

The jit.matrix object is a named matrix which may be used for data storage and retrieval, resampling, and matrix type and planecount conversion operations.

Examples

Attributes

adapt [int]

Matrix adaptation flag (default = 0 if matrix arguments are present, otherwise 1) When the flag is set, the jit.matrix object will adapt to the incoming matrix planecount, type, and dimensions.

dim [32 ints]

The dimensions of matrix data (default = 1 1)

dimstride [32 ints]

g/s(get)

The byte stride per dimension

dstdimend [32 ints]

The destination dimension end position (default = all dim values minus 1)

dstdimstart [32 ints]

The destination dimension start position (default = all 0)

interp [int]

Matrix interpolation flag (default = 0) When the flag is set, the input matrix will be interpolated when copied to the internal matrix.

name [symbol]

The name of the matrix (default = UID)

planecount [int]

The number of planes in matrix data (default = 4)

planemap [32 ints]

Maps input places to output planes (default = 0 1 2 3 ...)

thru [int]

Thru mode flag (default = 1) When the flag is set, a matrix is output when another one is received.

size [int]

g/s(get)

Total byte size of matrix

srcdimend [32 ints]

The source dimension end position (default = all dim values minus 1)

srcdimstart [32 ints]

The source dimension start position (default = all 0)

usedstdim [int]

Destdim use flag (default = 0) When the flag is set, the destination dimension's attributes are used when copying an input matrix to an internal matrix.

usesrcdim [int]

Srcdim use flag (default = 0) When the flag is set, the source dimension's attributes are used when copying an input matrix to an internal matrix.

type [symbol]

The matrix data type (default = char) Possible values:

'char' ( Char data )
Char data (0-255)

'long' ( Long data )
Long data

'float32' ( 32-bit floating-point data )
32-bit floating-point data

'float64' ( 64-bit floating-point data )
64-bit floating-point data

Common Box Attributes

annotation [symbol]

Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.

background [int] (default: 0)

Adds or removes the object from the patcher's background layer. background 1 adds the object to the background layer, background 0 removes it. Objects in the background layer are shown behind all objects in the default foreground layer.

color [4 floats]

Sets the color for the object box outline.

fontface [int]

Sets the type style used by the object. The options are:

plain
bold
italic
bold italic Possible values:

0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'

fontname [symbol]

Sets the object's font.

fontsize [float]

Sets the object's font size (in points). Possible values:

'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'

hidden [int] (default: 0)

Toggles whether an object is hidden when the patcher is locked.

hint [symbol]

Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.

ignoreclick [int] (default: 0)

Toggles whether an object ignores mouse clicks in a locked patcher.

jspainterfile [symbol]

JS Painter File

patching_rect [4 floats] (default: 0. 0. 100. 0.)

Sets the position and size of the object in the patcher window.

position [2 floats]

g/s(set)

Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.

presentation [int] (default: 0)

Sets whether an object belongs to the patcher's presentation.

presentation_rect [4 floats] (default: 0. 0. 0. 0.)

Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.

rect [4 floats]

g/s(set)

Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).

size [2 floats]

g/s(set)

Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.

textcolor [4 floats]

Sets the color for the object's text in RGBA format.

textjustification [int]

Sets the justification for the object's text. Possible values:

0 = 'left'
1 = 'center'
2 = 'right'

varname [symbol]

Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.

Messages

bang

Outputs the currently stored matrix.

int

Arguments

values [list]
Sets all cells to the value specified by value(s) and output the data. Position is specified of a list whose length is equal to the number of dimensions (dimcount).

float

Arguments

values [list]
Sets all cells to the value specified by value(s) and output the data. Value is specified as a list whose length is equal to the number of dimensions (dimcount).

list

Arguments

values [list]
Sets all cells to the value specified by value(s) and output the data. Position is specified of a list whose length is equal to the number of dimensions (dimcount).

(drag)

Drag and drop a compatible media file onto the object to load it.

clear

Sets all matrix values to zero.

exportimage

Arguments

filename [symbol]
file-type [symbol]
Export the current frame as an image file with the name specified by the first argument. The second argument sets the file type (default = png). Available file types are png, tiff, and jpeg.
You can use the Max Preferences to specify a default image resolution for png image types.

exportmovie

Arguments

filename [symbol]
FPS [float]
codec [symbol]
quality [symbol]
timescale [int]
Exports a matrix as a movie. The exportmovie message takes an optional argument to specify a file name. If no filename is specified, a file dialog will open to let you choose a file.
See the jit.record object for information on the write arguments and their default values.

exprfill

Arguments

plane [int]
expression [symbol]
Evaluates expression to fill the matrix. If a plane argument is provided, the expression is applied to a single plane. Otherwise, it is applied to all planes in the matrix. See jit.expr for more information on expressions. Unlike the jit.expr object, there is no support for providing multiple expressions to fill multiple planes at once with different expressions. Call this method multiple times once for each plane you wish to fill.

fillplane

Arguments

plane [int]
value [int]
The word fillplane, followed by an integer that specifies a plane number and a value, will fill the specified plane with the single value.

getcell

Arguments

position [list]
Sends the value(s) in the cell specified by position out the right outlet of the object as a list in the form cell cell-position0 ... cell-positionN val plane0-value ... planeN-value .

importmovie

Arguments

filename [symbol]
time-offset [int]
Imports a movie into the matrix. If no filename is specified, a file dialog will open to let you choose a file. The time-offset argument may be used to set a time offset for the movie being imported (the default is 0).

jit_gl_texture

Arguments

texture-name [symbol]
Copies the texture specified by texture-name to the matrix.

op

The word op, followed by the name of a jit.op object operator and a set of values, is equivalent to including a jit.op object with the specified operator set as an attribute and this jit.matrix object specified as the output matrix. The additional value arguments may either be a matrix name or a constant. If only one value argument is provided, this matrix is considered both the output and the left operand. For example, "op + foo bar" is equivalent to the operation thismatrix = foo + bar, and "op * 0.5" is equivalent to the operation thismatrix = thismatrix * 0.5.

read

Arguments

filename [symbol]
Reads Jitter binary data files (.jxf) into a matrix set. If no filename is specified, a file dialog will open to let you choose a file.

setall

Arguments

values [list]
Sets all cells to the value specified by value(s). Position is specified of a list whose length is equal to the number of dimensions (dimcount).

setcell

Arguments

position [list]
group (optional)
plane [literal]
plane-number [int]
end group
val [literal]
values [list]
Sets the cell specified by position to the value specified by value. Position is specified of a list whose length is equal to the number of dimensions (dimcount). The optional arguments plane plane-number can be used to specify a plane. If a plane is specified, value should be a single number, otherwise it should be a list of numbers of size planecount - 1.

setcell1d

The word setcell1d, followed by a number specifying an x coordinate and a list of values, is similar to the setcell message but without the need to use a "val" token to separate the coordinates from the value since the dimension count (1) is fixed.

setcell2d

The word setcell2d, followed by a pair of numbers specifying x and y coordinates and a list of values, is similar to the setcell message but without the need to use a "val" token to separate the coordinates from the value since the dimension count (2) is fixed.

setcell3d

The word setcell3d, followed by three numbers specifying x , y , and z coordinates and a list of values, is similar to the setcell message but without the need to use a "val" token to separate the coordinates from the value since the dimension count (3) is fixed.

setplane1d

The word setplane1d, followed by a number specifying an x coordinate, a number specifying a plane, and a value, is similar to the setcell message but without the need to use a "val" token to separate the coordinates from the value since the dimension count (1) is fixed, or use the "plane" token to specify which plane to set.

setplane2d

The word setplane2d, followed by a pair of numbers specifying x and y coordinates, a number specifying a plane, and a value, is similar to the setcell message but without the need to use a "val" token to separate the coordinates from the value since the dimension count (2) is fixed, or use the "plane" token to specify which plane to set.

setplane3d

The word setplane3d, followed by three numbers specifying x , y , and z coordinates, a number specifying a plane, and a value, is similar to the setcell message but without the need to use a "val" token to separate the coordinates from the value since the dimension count (1) is fixed, or use the "plane" token to specify which plane to set.

val

Arguments

values [list]
Sets all cells to the value specified by value(s). Position is specified of a list whose length is equal to the number of dimensions (dimcount) and outputs the data.

write

Arguments

filename [symbol]
Writes matrix set as a Jitter binary data file (.jxf). If no filename is specified, a file dialog will open to let you choose a file.

See Also

Name Description
Working with Video in Jitter Working with Video in Jitter
jit.coerce Coerce a matrix into different types/planecount
jit.fill Fill a matrix with a list
jit.matrixset A set of matrices for storage/resequencing
jit.matrixinfo Report matrix planecount, type, dimensions
jit.peek~ Read matrix data as an audio signal
jit.poke~ Write an audio signal into a matrix
jit.spill Unroll a matrix into a list
jit.submatrix Reference a sub-region of a matrix
Tutorial 2: Create a Matrix Tutorial 2: Create a Matrix
Tutorial 11: Lists and Matrices Tutorial 11: Lists and Matrices
Tutorial 14: Matrix Positioning Tutorial 14: Matrix Positioning
Tutorial 16: Using Named Jitter Matrices Tutorial 16: Using Named Jitter Matrices
Tutorial 18: Iterative Processes and Matrix Re-Sampling Tutorial 18: Iterative Processes and Matrix Re-Sampling
Tutorial 20: Importing and Exporting Single Matrices Tutorial 20: Importing and Exporting Single Matrices
Tutorial 31: Rendering Destinations Tutorial 31: Rendering Destinations
Tutorial 39: Spatial Mapping Tutorial 39: Spatial Mapping
Tutorial 42: Slab: Data Processing on the GPU Tutorial 42: Slab: Data Processing on the GPU