Hi Guys and Girls,

For a project to bring a Skyline to live, i have several hunderd window layers which should turn on and off in a random pattern, like people are coming and going.

For this I would like the opacity to go 100 or 0 at random moments. Now I have tried and searched, but now it's just guessing, so I could use some help from the expression wizards. NOTE: I am a beginner with expressions.

The composition exist out of a master composition, with a Precomp for the windows, and in that precomp multiple precomps to seperate the buildings.

So I found this Expression from Dan at:

https://forums.creativecow.net/thread/227/24412
**seedRandom(index,true);**

t = random(thisComp.duration);

ease(time,t,t+thisComp.frameDuration*24,0,100)
Which works great, make a perfect pattern, because each lights has a unique moment of going on, and you can even make them fade. Or off if you change the last piece of the code to:

**seedRandom(index,true);**

t = random(thisComp.duration);

ease(time,t,t+thisComp.frameDuration*24,100,0)
My problem is that the composition is 30min long, so lights should go On and Off more than 1 time. So I tried the following:

**holdTime = 6; //time to hold (seconds)**

seed = Math.floor(time/holdTime);

seedRandom(seed,true);

Math.round (random())*100
Which works but it's a static interval, so which window is going on or off is random. But they change together, therefore it looks unnatural. So then I tried to make the interval random, so each window would have unique moment of going on or off like in the first expression, and made this:

**seedRandom(Math.floor(time/200), timeless = true);**

holdTime = random(100,200);

seed = Math.floor(time/holdTime);

seedRandom(seed,true);

Math.round (random())*100
The problem is now that the lights indeed go on and off at random moments if i look at the precomps of the building, but when rendered out together, it seems they wait for a minute and then change randomly for half a minute and then wait again, etc. I tried altering the first Seedrandom number and the Holdtime = Random numbers with sliders to look for something that worked, faster and slower worked, but the waiting problem remains.

So if someone would share some thoughts on this that would be great. I look for an expression that will make the windows turn on and off a random moments, with random interval, fading is nice but not necessary. It would be great to be able to control how fast the blink, so it looks natural on a skyline and not in a disco.

Thanks in advance and kind regards,

Reynoud

Studio NOUD (Netherlands)