I came across this weird problem I couldn’t figure out myself.
If I have 2 spreads (integers) with different spreadcounts, how do I figure out the values that BOTH spreads have in commen (if any)??
I have done a workarround for the patch I was working on, but I couldn’t figure it out if I ever REALY needed it.
I could patch something massive, taken 1 slice each time and compare that with the other spreads, but for big spreads this would take ages. (1 frame/slice)
hi! it would be better to sort both slices (convert them into strings and use sort (string) and then use a = (String) to get duplicates.
You can then use the “former index” pin of the sort nodes to reorder the spread to it’s previous order.
Hmzz… converting it to a textstring was not the first thing on my mind. I also patched something like gregsn (and ad the last stap off actualy getting the values).
Mine seems a bit more complex than the one with Countindices, and it only works for positive integers. And you should keep them below 1000 or something, cozz you get a very large spread.
tip: in the upper part of your patch where you are dealing with switches you could replace that part with a single max with 4 inputpins.
i still reduced my version. maybe it is helpful. but for sure it has the same limitations like yours: it is only working at a reasonable speed for relatively small positive integers.
but for this case it might be much faster than the string version.
Thnx for the Max tip, need to learn to make a better use off the inspector.
That Select Node you used is super!! And I think some one should re-do the helpfile!! (cozz I realy missed that option).
Was thinking off multiplying the value with 10000 for fractions, and than deviding with 10000 in the end, but than I get rounding errors. 0.1667 becomes 0.1666. Also working with a 10000 spreadcount isn’t that nice.
Placed a wish in the wishlist… who knows when some genious has an lost hour off two.