Brief run down, huh? OK –
The key is this part of the code:
n = 0;
if (trigger.marker.numKeys > 0){
n = trigger.marker.nearestKey(time).index;
if (trigger.marker.key(n).time > time){
n–;
}
}
Which sets variable “n” to number of the previous marker in the trigger layer, or 0 if a marker hasn’t been reached yet. The rest of the code just figures out what to set the remapped time to based on the previous marker in the trigger layer, the current time, and the marker (if any) of the time remapped layer.
Dan