inspired by this video: Giving Personality to Procedural Animations using Math - YouTube in which the poster uses a second order system to add personality to animations, I wanted to use second order systems in order to add some gesture to control signals (i.e. taking in a signal used to control pitch, and causing it to overshoot/anticipate/resonate/lag in real time in a parametrized way). I wrote this function based on the video, but plotting it just results in DC at 0 any advice would be greatly appreciated!
(
{
var x, y, dxdt, dydt, d2ydt2, k1, k2, k3, f, zeta, r;
f = 1;
zeta = 1;
r = 1;
t = 1/s.sampleRate;
k1 = (zeta) / (pi*f);
k2 = (1) / ((2*pi*f).squared);
k3 = (r*zeta) / (2*pi*f);
x = LFPulse.ar(1, 0.5);//step to measure step response
dxdt = Slope.ar(x);
y = LocalIn.ar;
dydt = Slope.ar(y);
d2ydt2 = Slope.ar(dydt);
y = y + (t*dydt);
dydt = dydt + (t * (x + (k3 * dxdt) - y - (k1 * dydt)) / k2);
LocalOut.ar(y);
y;
}.plot(1)
)