Forum Replies Created

Page 2 of 2
  • Isaac Someah-kwaw

    April 24, 2016 at 10:24 am in reply to: Trigger effect every third event

    I spent a while tweaking that code, but can’t get beyond making it work with the glow intensity property instead of the position property.

    I read your posts here. The codes are similar, and I’m thinking I could integrate a looping array into the code you linked me to, but I’m not sure how to go about that. Would it be possible to use “thisProperty” to continuously multiply the glow intensity value by decimal numbers stored in the array in order to achieve the “100%, 75%, 50%” cycle I’m looking for?

    Also, I’m splitting hairs, but would there be a way to have the glow still decay at the same speed as the audio output? I notice that with this code, the decay rate of the glow is a fixed value instead of decaying as fast/slow as the sound does.

    threshold = 38;

    audioLev = thisComp.layer("Sound Keys").effect("Sound Keys")("Output 1");

    above = false;
    frame = Math.round(time / thisComp.frameDuration);
    while (true){
    t = frame * thisComp.frameDuration;
    if (above){
    if (audioLev.valueAtTime(t) < threshold){
    frame++;
    break;
    }
    }else if (audioLev.valueAtTime(t) >= threshold){
    above = true;
    }
    if (frame == 0){
    break;
    }
    frame--
    }
    if (! above){
    t = 0;
    }else{
    t = time - frame * thisComp.frameDuration;
    }

    amp = 100;
    freq = 2;
    decay = 2.0;

    angle = freq * 2 * Math.PI * t;
    glow = 1 + amp * Math.sin(angle) / Math.exp(decay * t) / 100;

    thisProperty * glow;

  • Isaac Someah-kwaw

    April 24, 2016 at 1:40 am in reply to: Trigger effect every third event

    Thanks for the reply Dan,

    Oops, I forgot I had to use ==. And yeah, It dawned on me right after I posted this that each conditional expression would only recognize globally set variables, and not ones set within the other conditional statements. Is there a reasonable way to do as you described?

Page 2 of 2

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