Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions I must be busy this morning, continued!

  • I must be busy this morning, continued!

    Posted by Olly Bea on April 11, 2008 at 3:16 pm

    Hey

    Following from my earlier post (I must be busy this morning, 2 posts!) I would like to try and generate a new position each time opacity = 100 but hold in that position until opacity reaches 0.

    The current code I have in opacity:

    prop=thisComp.layer(“Bass 3”).effect(“Both Channels”)(“Slider”);

    threshold=5;
    fadeOut=1; // in seconds

    t=time;
    while (t>time-fadeOut) {
    if (prop.valueAtTime(t)>=threshold) {
    break;
    }
    t-=thisComp.frameDuration;
    }

    linear (time, t, t+fadeOut, 100, 0)

    Many thanks

    Olly

    Olly Bea replied 18 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    April 11, 2008 at 4:00 pm

    Hi,

    a different approach this time, because now the expression has to scan from the beginning, and count how many times the threshold has been met.
    I referencing the original Audio data, instead of the opacity:


    prop=thisComp.layer("Bass 3").effect("Both Channels")("Slider");

    threshold=5;
    peaks=0;

    t=0
    while (t<=time) { if (prop.valueAtTime(t)>=threshold) {
    peaks++;
    }
    t+=thisComp.frameDuration;
    }

    seedRandom(peaks,timeless=true);
    random([0,0],[720,576]);

    This first counts the number of peaks from time 0 untill current time, then uses that number to find a random position between [0,0] and [720,576]

  • Olly Bea

    April 11, 2008 at 4:21 pm

    superb thanks very much!

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