ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# random duration of a holdTime

FAQ   •   VIEW ALL random duration of a holdTime on Jan 24, 2020 at 3:39:28 pm

I'm using an number odometer built . The count of this odometer is driven by a angle controller using with the expression below. I want the numbers to tick up more naturally. I'm using the expression below. I'd like to have a hold time duration be more random between .1 and .5. Any help would be much appreciated.

```easeTime = .2; holdTime =.5; amt = 36; period = easeTime+holdTime; t = time - inPoint; seg = Math.floor(t/period); p = t%period; seg*amt + ease(p,0,easeTime,0,amt)``` Re: random duration of a holdTimeon Jan 24, 2020 at 8:20:37 pm

Varying the hold time will mess up the entire expression, so you would need to go to a more cumbersome model, like this:

``` easeTime = .2; minHoldTime = .1; maxHoldTime = .5; seg = 0; segStart = inPoint; curT = inPoint; while (curT <= time){ seedRandom(seg,true); holdTime = random(minHoldTime,maxHoldTime); period = easeTime+holdTime; segStart = curT; seg++ curT += period; } t = time - segStart amt = 36; (seg-1)*amt + ease(t,0,easeTime,0,amt) ```

Dan Re: random duration of a holdTimeon Jan 24, 2020 at 9:21:41 pm
```easeTime = .2; minHoldTime = .01; maxHoldTime = .5; seg = 0; segStart = inPoint; curT = inPoint; while (curT &lt;= time){ seedRandom(seg,true); holdTime = random(minHoldTime,maxHoldTime); period = easeTime+holdTime; segStart = curT; seg++ curT += period; } t = time - segStart amt = 36; (seg-1)*amt + ease(t,0,easeTime,0,amt)+(36*effect("Slider Control 2")("Slider"))```