OK – play around with this. Add a slider control to each of your segments and add this expression to the slider:
minDuration = 5;
maxDuration = 7;
tEnd = 0;
n = 0;
seedRandom(n, true);
preRun = random(maxDuration);
while (time + preRun >= tEnd){
n++;
seedRandom(n,true);
dur = random(minDuration, maxDuration);
tEnd += dur;
}
t = time + preRun – (tEnd – dur);
Add this expression to Opacity:
fadeIn = 18;
hold = 90;
fadeOut = 18;
d = thisComp.frameDuration;
t = effect(“Slider Control”)(“Slider”);
Math.min(linear(t,0,fadeIn*d,0,100), linear(t,(fadeIn + hold)*d,(fadeIn + hold + fadeOut)*d,100,0));
Add a Fill effect and add this expression to Fill Color:
fadeIn = 18;
hold = 90;
fadeOut = 18;
minColor = [.5,.5,.5,1];
maxColor = [.75,.75,.75,1];
seedRandom(index,true);
onColor = random(minColor,maxColor);
offColor = random(minColor,maxColor);
d = thisComp.frameDuration;
t = effect(“Slider Control”)(“Slider”);
if (t < fadeIn * d){
linear(t,0,fadeIn,offColor,onColor);
}else{
linear(t,(fadeIn + hold)*d,(fadeIn + hold + fadeOut)*d,onColor,offColor);
}
See if that gets you closer.
Dan