Create a repeating matrix

mrtof's icon

Hi,
I am trying to create a @planecount 1 @dim 1584 matrix where each 3 cell in sequence has the same random value. Something like:
value0, value0, value0, value1, value1, value1, value2, value2, value2, ...

Max Patch
Copy patch and select New From Clipboard in Max.

I tried resizing the matrix without any interpolation, but it offsets at some point : the last value is not listed three times. Here is the code that shows the problem:

mrtof's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This is a solution (for a final @dim 15), but there must be a better way!

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This doesn't address your question of why the resizing doesn't work as you expect, but here's a way of filling the matrix using uzi.

mrtof's icon

I was hoping to find a 1 or 2 object solution.
The biggest «speed hump» in dataflows is the number of messages per operation.

Wesley Smith's icon
Max Patch
Copy patch and select New From Clipboard in Max.

The anomaly is due to some precision issues when upsampling the matrix. If you want exactly three repetitions, here are 2 options, one using jit.multiplex, the other jit.coerce: