ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Every sixth time it turns on Expression

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Emmanuel RobaEvery sixth time it turns on Expression
by on Jul 12, 2016 at 1:46:00 am

I have this problem so as it goes:
I have this expression from Dan Ebberts the expression maker and i'm trying to modify this code from the "Audio Beat Counter" Tutorial http://www.motionscript.com/design-guide/audio-count.html. I want it to count up to 6 then go back to 1. But every time i try to modify the code i get an error


threshold = 40;

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

above = false;
frame = Math.round(time / thisComp.frameDuration);
n = 0;
while (frame >= 0){
t = frame * thisComp.frameDuration;
if (above){
if (audioLev.valueAtTime(t) < threshold){
above = false;
}

}else if (audioLev.valueAtTime(t) >= threshold){
above = true;
n++;
}
frame--
}

n


Also I need a used a second expression as a trigger but no dice aswell



n = 6;
slider = effect("Slider Control")("Slider");
if (slider > (n - index)) 100 else 0


Return to posts index

Kalle KannistoRe: Every sixth time it turns on Expression
by on Jul 12, 2016 at 6:32:39 am
Last Edited By Kalle Kannisto on Jul 12, 2016 at 6:37:34 am

For the first one, you should be able to replace the "n" on the last line with "1+n%6".

What do you want to accomplish with the trigger? The expression should work just fine.


Return to posts index

Emmanuel RobaRe: Every sixth time it turns on Expression
by on Jul 12, 2016 at 12:28:30 pm

Thank you Sooo much!

The trigger is the thing i want to turn when it hits 1 then turn off when it hits another number.
Its because i'm picwipping to an invert effect, and it turns on all the time when I set it to 1


Return to posts index


Kalle KannistoRe: Every sixth time it turns on Expression
by on Jul 12, 2016 at 6:05:05 pm
Last Edited By Kalle Kannisto on Jul 12, 2016 at 6:05:44 pm

I would try changing ">" to "<" (or switching 0 and 100).


Return to posts index

Emmanuel RobaRe: Every sixth time it turns on Expression
by on Jul 12, 2016 at 9:37:33 pm

Thank you once again!!
I did some java script learning and I replaced the ">" with a" ==" it seemed to do the trick.
Replying for future use.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]