Hmmm. Ok. Since there’s a random component, it sounds like you need the randomizing part in a separate expression with the result “published” for both the flash and sound expressions to use. I’m still not clear on how you have this set up, so I’m going to describe how I’d do this for one flash layer and one sound layer. I’d create a null layer named “Control”, add a slider to it, and add this expression to the slider:
minSeg = 2.0;
maxSeg = 5.0;
seedRandom(index,true)
segStartTime = -random(minSeg,maxSeg);
segEndTime = segStartTime;
i = 1;
while (time >= segEndTime){
i += 1;
seedRandom(i,true);
segStartTime = segEndTime;
segEndTime = segEndTime + random(minSeg,maxSeg);
}
segStartTime
This calculates and publishes the randomized segStartTime. Then your flash expression becomes:
blinkDur = .25;
fadeTime = .1;
segStartTime = thisComp.layer("Control").effect("Slider Control")("Slider");
if (time < segStartTime + blinkDur/2)
easeOut(time,segStartTime,segStartTime+fadeTime,0,100)
else
easeIn(time,segStartTime+blinkDur-fadeTime,segStartTime+blinkDur,100,0)
You would turn on time remapping for your sound, drag the right edge so the layer duration matches the comp, and add this time remapping expression:
segStartTime = thisComp.layer("Control").effect("Slider Control")("Slider");
Math.max(time - segStartTime, 0)
That should sync the sound to the flash.
Now you mention 1000+ entries and I’m not sure if that implies 1000+ control layers and 1000+ sound layers or not. If so, then maybe this isn’t of much help to you. I’m hoping you can adapt this to your situation somehow though.