Well Dan, I’m ashamed to admit it, but I’m stuck.
x = thisComp.layer(“A_BASS”).effect(“Both Channels”)(“Slider”);
threshold = 50.0;
below = false;
frame = Math.round(time / thisComp.frameDuration);
oldFrame = Math.round(time / thisComp.frameDuration) – 3;
d = 3;
n = 0;
while (frame > oldFrame){
t = frame * thisComp.frameDuration;
if (below){
if (x.valueAtTime(t) >= threshold){
n=100+x;
below = false;
}
else d–;
}
else if (x.valueAtTime(t) < threshold && d < 1){
below = true;
n=102;
d = 3;
}
frame–
}
n
I need the ‘else if’ statement to only trigger when the x value is below the threshold for 3 consecutive frames, which is what I’m attempting to use the d variable for.