Varying lag velocity/acceleration

I have a feeling this might require some custom code, but I’m curious if there’s maybe something I’m not thinking of… I’d effectively like something similar to the LAG chop, but with the ability to vary the velocity and acceleration clamps on a per sample basis. Like, imagine additional inputs that contained those values. I should also specify that I’m talking about working across a range of samples, not a time-sliced input… any thoughts? And if it’s not possible to do off the shelf, does anyone have an explanation for the algorithm behind how the LAG chop limits acceleration and velocity?

Hello.

Actually, if you use the Lag CHOP, set to ‘Lag Per Sample’,
then you can use varying parameter values if they use an expression involving : me.sampleIndex

It will re-evaluate the parameter for each sample being evaluated.

You can use that variable in a formula, to lookup values in a DAT, etc.

More info:

docs.derivative.ca/LagCHOP_Class#Members

Cheers,
Rob.

[edit: example attached]
zz_lag_per_sample_per_lag.toe (3.8 KB)

Very cool! Seems to work with acceleration and velocity limits as well… exactly what I was looking for!
thanks!

Actually… I’m either doing something wrong/misunderstanding or this is a bug, but see the attached example… In it, I’m using the numSamples to index into the wave chop for a maximum slope. I then use it to lag the noise CHOP. it does what i’d expect if lag per sample is turned OFF… but when I turn it on, it doesn’t seem to work and it cooks unnecessarily every frame. You can see that it’s working (how it’s lagged the noise) in the slope CHOP i’ve connected.
lagQuestion.toe (3.75 KB)

In your example, when ‘Lag per Sample’ is turned off, it works from left to right, clamping the slope at each sample, using the previous result

When ‘Lag per Sample’ is turned on, it expects each sample to be moving, not static.
It uses the previous value (in time) of that sample, to determine it’s next value.
Neighboring (left-right) samples have no effect.

Cheers,
Rob.

Ah… thank you. I don’t actually want lag per sample, then… I just wanted a way to vary the parameters based on sample index. I think I just find the terminology confusing … I guess here sample refers to either the index of the sample in the chop or the temporal samples… In any event, it works great!
thanks,
michael