Cumulative energy in a system

maaark's icon

Often when I'm designing interactive installations of some kind, I run into this problem, which I still haven't found a solution for, while I'm sure it's pretty simple.

Imagine the user having a control, for example the slider in the attached patch (could be a accelerometer that is shaken, for example). Whenever the user puts energy into this system, I want the signal to cumulatively build up. The problem is that, when one moves the slider back, one always gets a decrease in energy (which is logical). Every movement should make the system build up energy cumulatively, and only doing nothing should enable it to slowly go back to zero "energy".

Max Patch
Copy patch and select New From Clipboard in Max.

Any ideas?

jvkr's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Once I came up with this (tweak the numbers to change behaviour):

maaark's icon

Nice! I had been playing around with feedback-loops and delta~, but never got working the way I wanted! This is great, thanks a lot!