Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Wiggle brightness infrequently but sharply

  • Wiggle brightness infrequently but sharply

    Posted by Justin Crowell on August 21, 2013 at 3:47 pm

    Hi All,
    I’m trying to get an effect where text looks like it’s flickering. I want to replicate what I had working with keyframes.

    Basically, every five or ten frames, I have the brightness jump by 25, then return to 0 the next frame.

    Am I correct in thinking that decreasing the wiggle frequency simply ramps to the amplitude over that time frame? So, wiggle(1,25) will result in a half-second ramp up to 25, and a half-second ramp down?

    So, what I need is quick wiggles that occur with delays between them. Any thoughts?

    Thanks!

    Editor, Producer, DP
    JustinCrowell.com

    Justin Crowell replied 12 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Darby Edelen

    August 22, 2013 at 4:59 am

    Depending on how dramatic you want the effect to be you might consider using the random() function instead of wiggle(). Something like this could work:

    t = Math.round(random(5, 10));
    r = value;
    if(timeToFrames(time) % t == 0) r += 25;
    r;

    Since the call to random() is returning a value between 5 and 10 and the time in frames may not always be evenly divisible by the returned value this could result in a long stretch without flashing or several flashes in a row.

    Otherwise you could modify a wiggle to do what you’re after with something like this:

    w = wiggle(10, 1) - value;
    linear(w, .6, .7, value, value + 25);

    The ‘w’ variable will have a value that wiggles 10x a second between -1 and 1. You can then linearly interpolate across a small section of that range. The closer together the .6 and .7 values are the faster the transition from ‘value’ to ‘value + 25’. In addition, since the values are wiggling between -1 and 1 the closer to 1 those values are the less frequently a flash will occur. For example, changing the last line to:

    linear(w, .8, .9, value, value + 25);

    will flash very rarely while:

    linear(w, 0, .1, value, value + 25);

    will flash very frequently. The ‘sharpness’ of the flashes will be approximately the same.

    Darby Edelen

  • Justin Crowell

    September 11, 2013 at 5:29 pm

    Forgot to thank your for your solution! Thanks so much! I really appreciate the time you took to walk me through it!

    Editor, Producer, DP
    JustinCrowell.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy