freq = 2; decay = 5; delay = 0.15; dur = 0.12; myDelay = delay; t = time - (inPoint + myDelay); startVal = key(1) ; endVal = key(2); amp = (endVal - startVal)/dur; w = freq*Math.PI*2; ans=endVal + amp*(Math.sin(t*w)*Math.exp(decay*t)/w); [value[0], ans]