delay = .1; myTime = time - delay*(textIndex-1); n = 0; if (numKeys > 0){ n = nearestKey(myTime).index; if (key(n).time > myTime) n--; } if (n > 0){ t = myTime - key(n).time; amp = velocityAtTime(key(n).time - .001); freq = 4; decay = 2; w = freq*Math.PI*2; valueAtTime(myTime) + amp* Math.sin(t*w)/Math.exp(decay*t)/w }else{ valueAtTime(myTime) }