Matrix locations
This patch demonstrates how to manipulate source and destination dimensions in a jit.matrix to arrange windows into matrix locations.
This patch demonstrates how to manipulate source and destination dimensions in a jit.matrix to arrange windows into matrix locations.
This patch demonstrates how to create a 19x19 matrix that functions as a sort of "go" board, in which each mouse click alternates between placing a white or black square in a cell of the matrix. It's meant to demonstrate how a matrix can be used to store a multidimensional array of states or conditions.
To store an array of integers, you will usually use the table object. To store an array of floating point values, you can use the buffer~ object. Although the buffer~ object is normally used for storing audio data, it can easily be used simply as an array of floats, accessed by the peek~ object, which works even when MSP audio is not on.
This example demonstrates how to find the maximum value in a jit.matrix column using jit.submatrix and jit.3m.
To set matrix “B” to have the contents of matrix “A”, you simply send “A” to “B”. (More specifically, you cause matrix “A” to send a jit_matrix message to matrix “B”.) The trick, though, is to suppress thruput on matrix “B” by setting its @thru attribute to 0 (it’s 1 by default), so that you can set and recall its contents independently.