Storing changing values

Hello folks,

This is driving me nuts for days… I really need your help with that.

This is a little difficult to describe for me, so I will use “hard” values. (I’m sorry this is gonna be somehow an epic description)

I’ve got an incoming Spread with a Count of 4. On a certain event, which I control, its values change, and the count is reduced to 2. The event happenes again, and the spreadcount changes to 3, and for the sake of the example it changes once more to 2… and so on. I don’t know the spreadcount before it changes.

Now I need to store those first 4 Values, append the second 2, and on the third event append the three values. Keeping that Bin-Size each bin has to be routed to a subpatch. Now on the fourth event, the first 4 values must be replaced with the 2 coming in. On the fifth, the secound ones, and so on.

When using Store (Spreads), this works nice up to the moment when 4 values schould be replaced with just 2 on the fourth event… I also tried Switch (Output) but I need to be able to reset everything to 0 (and I couldn’t manage to do that). Last but not Least I tried Unzip (Bin), but I don’t know how to correctly store the BinSize)

I tried to make a patch for a better explanation, but it’s pretty useless.

I’d be happy about any idea. Thanks in advance,

Alex

route_values_to_subpatches.v4p (20.7 kB)

RingBuffer covers all your needs if I got you right … check attached patch.

RingBuffer.v4p (17.0 kB)

Thank you very much, readme! I’ve always been wondering what that Ringbuffer was about ;)