Create a repeating matrix

Jun 21, 2013 at 1:46pm

Create a repeating matrix

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>

#253651
Jun 21, 2013 at 2:10pm

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

<code>

– Pasted Max Patch, click to expand. –

</code>

#253655
Jun 21, 2013 at 4:13pm

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>

#253671
Jun 21, 2013 at 8:12pm

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

#253686
Jun 21, 2013 at 9:15pm

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>

#253691

You must be logged in to reply to this topic.