Forums > MaxMSP

Create a repeating matrix

June 21, 2013 | 1:46 pm

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, …

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:
<code>

– Pasted Max Patch, click to expand. –

</code>


June 21, 2013 | 2:10 pm

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

<code>

– Pasted Max Patch, click to expand. –

</code>


June 21, 2013 | 4:13 pm

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.
<code>

– Pasted Max Patch, click to expand. –

</code>


June 21, 2013 | 8:12 pm

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


June 21, 2013 | 9:15 pm

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:

<code>

– Pasted Max Patch, click to expand. –

</code>


Viewing 5 posts - 1 through 5 (of 5 total)