-
Random duration expression
Hi there!
I’m trying to make an expression on time remapping that allows me to randomly change the position of the playhead of a video. This code works but I’d like to be able to randomize the duration of each segment (segDur in the code).
I tried to use random() but a new value is calculated every frame.
Any ideas?//segDur - This variable controls how often the playhead will be changed.
segDur = 0.3;// duration of each "segment" of random time
minVal = inPoint;
maxVal = outPoint - segDur;
seed = Math.floor(time/segDur);
segStart = seed*segDur;
seedRandom(seed,true);
startVal = random(minVal,maxVal);
endVal = startVal + segDur;
linear(time,segStart,segStart + segDur, startVal, endVal);