n = marker.numKeys; if (n > 0){ f = timeToFrames (time); idx = Math.min (f +1, n); marker.key(idx).time }else{ value }