I’m confused by your mention of the values of keyframes 2 and 3, but this example might be helpful. It will interpolate directly between the path values at keyfames 1 and 4 over the time defined by tStart and tEnd. It assumes that the path has the same number of points at keyframes 1 and 4:
function interp(a1,a2,pct){
a = [];
for (var i = 0; i < a1.length; i++){
a.push(linear(pct,0,1,a1[i],a2[i]));
}
return a;
}
tStart = 0;
tEnd = 1;
t1 = key(1).time;
t2 = key(4).time;
t = linear(time,tStart,tEnd,0,1);
p1 = points(t1);
p2 = points(t2);
p = interp(p1,p2,t);
i1 = inTangents(t1);
i2 = inTangents(t2);
i = interp(i1,i2,t);
o1 = outTangents(t1);
o2 = outTangents(t2);
o = interp(o1,o2,t);
createPath(p,i,o,isClosed())