ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to play a tick sound when a slider value gains by one indefinitly

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Quinn Faulkner
Expression to play a tick sound when a slider value gains by one indefinitly
on Jul 27, 2019 at 12:57:33 am

I'm new to using expressions in after effects, and I was wondering if it was possible to trigger a ticking noise(audio track) whenever my control slider increases by one. currently, the slider controls a piece of text containing names, I want to integrant a tick on each name change, please let me know if this is possible, and if it is, show me how to make it possible.

count = thisComp.layer("Slider").effect("Slider Control")("Slider");
function callMe(n) {
if (count &lt; 1) {
return "VTV"
} else if (count &lt; 2) {
return "Quinn"
} else if (count &lt; 3) {
return "Tyler"
} else if (count &lt; 4) {
return "Brett"
} else if (count &lt; 5) {
return "Ethan"
} else if (count &lt; 6) {
return "Conner"
} else if (count &lt; 7) {
return "Tom"
} else if (count &lt; 8) {
return "Blake"
} else if (count &lt; 9) {
return "Mady"
} else if (count &lt; 10) {
return "Jacob"
} else if (count &lt; 11) {
return "Tate"
} else if (count &lt; 12) {
return "Zarah"
} else if (count &lt; 13) {
return "Josh"
} else if (count &lt; 14) {
return "Taylor"
} else if (count &lt; 15) {
return "Micky"
} else if (count &lt; 16) {
return "Robbie"
} else if (count &lt; 17) {
return "Connor"
} else if (count &lt; 18) {
return "Dorian"
} else if (count &lt; 19) {
return "Charles"
} else if (count &lt; 20) {
return "Memphis"
} else if (count &lt; 21) {
return "Matt"
} else if (count &lt; 22) {
return "Shameer"
} else if (count &lt; 23) {
return "Jake"
} else if (count &lt; 24) {
return "Noah"
} else if (count &lt; 25) {
return "Jon"
} else {
return "VTV"
}
}
callMe(count);


Return to posts index

Dan Ebberts
Re: Expression to play a tick sound when a slider value gains by one indefinitly
on Jul 27, 2019 at 1:40:40 am

Try this:


count = thisComp.layer("Slider").effect("Slider Control")("Slider");
curVal = Math.floor(count.value);
t = time - thisComp.frameDuration;
d = 0;
while (t >= 0){
if (Math.floor(count.valueAtTime(t)) < curVal){
d = time - t;
break;
}
t -= thisComp.frameDuration;
}
d



Dan



Return to posts index

Quinn Faulkner
Re: Expression to play a tick sound when a slider value gains by one indefinitly
on Jul 27, 2019 at 2:16:00 am

Hi Dan, when I go to put this expression into my short audio track of the tick, it gives me an error stating that the result must be in a dimension of 2, and not of 1


Return to posts index


Dan Ebberts
Re: Expression to play a tick sound when a slider value gains by one indefinitly
on Jul 27, 2019 at 3:30:54 am

You would put the expression on Time Remapping for the audio clip.

Dan



Return to posts index

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