Accumulating geometry in feedback loop FIFO or LIFO style?

Example: I am visualizing an audio spectrum with a linePOP → lookupchanPOP to set the Y pos of each point based on the audio. I want to show this development over time, with the last frame’s spectrum receding from the camera in screen space as it replaced with the most recent spectrum.

I have a simple feedback loop that accumulates the spectrums
example.tox (51.7 KB)
from each frame into a single geometry, and translates them ‘back’ in world space. This works great, and I can use a deletePOP to remove points that are more than 5 units away from the origin, so there is not an infinite accumulation. However, the deletePOP only creates a new group, it does not clear the GPU memory of the points that are ‘deleted’ (which i understand is likely desired behavior in many cases)

However, in this case, I need to truncate the geometry and I do not want to keep anything that is ‘too old’ in memory - I am wondering what to do in this case.

Other thoughts:

  • I tried the Accumulate POP but couldnt figure out how it was supposed to work, or if it was even intended for this use case
  • In theory could do this with a cachePOP and a copyPOP, but only if I could use different cache indices for the copies, which I do not think is currently possible
  • could also do with a GLSL and a cache, but I am not sure if its possible to index into different cache slices from within a GLSL POP (the dimension of the cachePOP is the dimension of a single slice)
  • maybe glsl create or glsl advanced is the way to go? I have not explored these yet

would welcome any feedback or ideas, example .tox attached (it will fill up GPU mem fast so be careful)

Hello @watershed,
The Accumulate POP is used to sum an attribute values.
Did you consider using a Trail POP? There’s a similar example Trail_POP/JoyDivision in overview.toe. If you switch the Connectivity to Columns, you’ll get something even closer to what you are doing.

Hey, thanks for the quick reply!!

I did try that too, sorry for forgetting to mention. The Trail POP with column connectivity is not what I need - that gives me the spectrum over time, but with all the ‘time slices’ in the same XYZ position. I need each time slice to be translate ‘back’ slightly

^^desired output (which looks nice but is killing my gpu mem)


^^trail POP with columns, undesired

You can set a transform on the Trail POP and move back the points over time. That’s what we do in the example.

I see, thank you for the follow up. For my own edification, is there any way to accomplish via feedback loop in case that comes up in a use case where the trail is not quite right?

Yes, you can also accomplish this with a Feedback POP and by Merging in the loop the current POP. It’s important in that case to use a memory limit to avoid running out of memory. A Delete POP can be added to make sure the memory is recycled for new incoming points.
SpectrumTrailWithFeedback.tox (4.5 KB)