New CHOP: tweenCHOP

Ths is a smaller one but there is regulary the idea in my head of a tweenCHOP, being able to interpolate over time between the current and a target value.
This of course to some degree is already possible using for example a constantCHOP and a lagCHOP, or, which might be more fitting, a speedCHOP with the correct boundaries.
But they all have n big flaw: They do cook all the time and have a tendency to generate a lot of unwanted ressource-hogging in larger occurance.

This is why I use my TweenerCOMP so much, as it only invokes cooking when values actually change, being an incredible ressource-saver.

I attached a simple example showing how this could look like using my tweenerCOMP (and I actually quite like it…) without a propery PythonAPI, but maybe I delve a little deeper in to this :slight_smile:

tweenerCHOP.tox (24.0 KB)

6 Likes

Hi @alphamoonbase

I like it. I guess there should be a Reset Pulse combined with Reset Condition and Reset Value. This in combination with 2 inputs for Start Pulses and Resets would be very useful.
Also a “Reset All”…

cheers
Markus

1 Like

Having the interface being akin to for example the speedCHOP certainly is a good idea.
It would mainly be important that it does not cook unless it is changing values! Otherwise a speedCHOP with a constantCHOP as input could do most of the desired beheaviour (sans the curves, which are just a nice addon from the tweenerComp)

1 Like

This is a big part of how I use TouchDesigner as well. I’ve been building my own systems using timerCHOP, crossCHOP and a lookupCHOP to use custom interpolation curves between “current live values” and “previous values” stored in a manually updated buffer.

I’m also always tormented by trying to make sure the system won’t cut unless it’s being used. (in retrospec, all those efforts are truly paying off when I see my patch run at 500+ fps when I disable the gui)

I do feel like there could have been another base chop operator that would let me build this kind of system without as many python trickery all over the place.

It’s a heavier solution but TDMorph has this kind of data interpolation too.

I have occasionally used the Interpolate CHOP with Constants that are just set to different “Start” times (in the “Channel” tab) like so:

It does mean you have to have a different Constant CHOP for each “keyframe”, and different interpolate CHOPs if you want different interpolation shapes, but none of this cooks once it is all put together and has created your interpolated channel, then you just use a lookup CHOP or a resample CHOP to get it to be a single sample channel following the curve, so at most just one CHOP cooking - though probably all the time

1 Like