Averaging lists
I have 4 lists with 12,000 items each.
I want a new list of the same size, with the averaged values.
Can I do this in one go without cycling through the items and averaging 4 at a time? I know how to do that, but maybe I can do it directly with a magic object ...
custom cross sum based on [accum]?
as long as cross sum is not greater than 64 bit´s max... ;)
Ah ...
Huh?
I don't understand a word :-)
4 lists, each with 12,000 items.
At the moment I break the 4 lists into 4 colls,
uzi 12,000 x 4 coll lines,
pack them,
zl.median,
zl.group 12000

I would be interested in a shorter way.
Seems to be working, but not sure if shorter in the end ;-) :

Not tried yet, but I think this exceeds the 32,676 zlmaxsize.
zl.lace for 2 lists with 12,000 items each would need a zlmaxsize of 24,000, correct?
Then
zl.lace 1 & 2 = 24,000 items
zl.lace 3 & 4 = 24,000 items
Then the target zl.lace combines that to 48,000 items, correct?
Too long.
I think I could work around in two stages but then you are right, it's probably not shorter in the end.
Correct. I overlooked the 24000 items (not used to manipulating lists of that size !).
This one, avoiding combinations of lists, maybe ?

Looks good.
I tried already with zl.nth but did not think of parallel processing.
This one should work better than my colls.
Thank you!
Can I do this in one go without cycling through the items and averaging 4 at a time?
Yes, I think it is the ideal situation from a logical and performance point of view.
I would suggest Jitter for that, use a matrix as a list.
See the attached patch, I think the performance is very good.
See the attached patch, I think the performance is very good.
Oh, that's really cool !
Wow, the solution for adults.
I'm impressed. Thank you very much!
I will probably jitter a little in future. Knowing how to deal with lots of pixels really helps ...
re:accum
iterate the list, run the values into [accum], divide their sum through number of elements = avg value
(i.e. without the need to do list processing.)
Nitpicking here but with large amounts of data it will have an impact: If you can, avoid division and use a multiplier instead
(in[0].p[0]+in[0].p[1]+in[0].p[2]+in[0].p[3])*0.25
<pre><code>
----------begin_max5_patcher----------
1489.3oc6as0aqhCD94To9e.wS6d1dh.aCIYep6+f88pJjSvI0cIFD3zlSOZ
+uu9BDfTf3Bgr8xQUAny3KeymmYvXL+75qlXuLdOIy15OstyZxjeJjLQISJY
RgfI1aw6WEgyTEzlQdNd4i12jqiS1yUxSr1PXjTLmDfBRwrv3sAQz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JCAy7QGLxU9vPvLa7AiiwfwezA
i79yFBFv3CFYW.MBLtWFv.LALxY8cI.iqIfAM6x.Fi7YPW.lw0XGXmwGLFGZ
it.I87MFLnwGLFe6.z3mzqvsz.vL9I8PlGMM9NvPiuQIb7yy.MdXB1sCbghx
Mzgs7kzGFn2WBAXNOktbGWOUrZ6Uk236LeST7RbzQuf6Fem5GPj5h7y4DmY6
aHAf4BT0vlAxC02MCj9H.Ubrs8Bjaq6En5OjsnmREr.mjFn2yBpoQ2aStssJ
0iT9Tx9jTqaUG+MJ6Nm6mlHN7GEW5VdIn7R38+92blB7ZhEgflYQvoYw45Gm
.L6T6oJPq7nvjB1hE9k6qtXf8gz1RxxvaHMYhfE80DAdZKEBfmxFa2WYHVUW
tBYIznHqakaVtHBaC+g5qZWMFXVeCU.t4qWma+GjG5PaWjf14wRsiAsPVqih
wbHnClvs+IMzLgO78f6dWbxZoeglQfMl37sSAf7ksUu5+99uOcFpX3flL79b
CCeuOVFtaiI4e6F9hOXC3MGs26f8wxt0sS8UDKmGNdliErwqmwX84R2xrEAU
m5ZiDuwcHv0jNDBNacnbedWYIRZ6QcOu8G3T8G571etmjPOu82o8XNa8mGxj
9y2474gZj84d15O3ao+JJ0VZXRLkwyC7WrXpmbtkEOLRw+bV.H5L.P2YnQDg
dmADBPiIGBlYDDWnikaNQ+QerGp953Oxii+.OZ3i6niOriW8Qcj+7+s8wbb8
UhB7eWzidIC
-----------end_max5_patcher-----------
</code></pre>
<Edit> It won't let me conveniently paste the patch in the post so it comes up as a single button? Normally that happens automatic