Copy link to clipboard
Copied
My problem is simple but I can't for the love of anything figure it out. I'm trying to move a rotation wheel X values depending on the amplitude of a track.
Basically = I want the CC Kaleida Rotation to move according to the audio amplitude keyframe value I choose, say <>55.
I used linear(value,50,55,0,100) to move the size slider, which makes sense because the slider goes from 0 to 100, but the rotation wheel goes from 0 to 360 and is multiplied by X the times of rotation.
I checked this link and got an idea where to begin but I still can't figure it out.
I need to render the project by tomorrow and I've been crunching my brain into this but I don't see it. I would really appreciate it if anyone helps me out or at least point me out where to learn.
Copy link to clipboard
Copied
Not really sure what you want to achieve, but if you want 2 full rotations (2*360 degrees), for example, you could do
linear(value,50,55,0,2*360)
Also note that my (paid) extension BeatEdit makes animating any properties to the beat much easier:
https://aescripts.com/beatedit-for-after-effects/
Here is an example
Copy link to clipboard
Copied
You can set the rotation to a number larger than one rotation just by setting it to the total number of degrees. So if you wanted three and a half rotations you'd set the rotation to <does mental arithmetic> 1260. In the UI it would say 3 + 180. So just multiply it by whatever you need.
Copy link to clipboard
Copied
Let's get a couple of things straight.
That should give you an understanding of how the Interpolation Methods work in expressions.
If you want to have the rotation property increase every time the value of Both Channels goes up but not return to the original position when the audio levels drop you need a lot more complicated expression and it is going to be recursive, which means it will take longer to calculate the longer the layer is. If that is what you want, let us know Otherwise something like this should work:
t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
r = linear(t, 5, 25, 0, 55)
Copy link to clipboard
Copied
Hi I would like to know how to have the rotation property increase every time the value of Both Channels goes up but not return to the original position when the audio levels drop. What is the expression for this?
Copy link to clipboard
Copied
Take a look at Dan Ebberts beat counter.
As it is written, every time the Both Channels slider value goes over 10 the value goes up by 1. You could multiply the result by 10 to get the angle to increase 10º every time the value goes over 10.
I don't have time to write an accumulator right now because I'm not very good at that part of javascript but this expression would only return positive values so that as the value of Both Channels goes up the value would change from 0 to a maximum of 90º but if the value goes down the value would be zero.
ref = thisComp.layer("Audio Amplitude");
t = ref.effect("Both Channels")("Slider");
tMin = 0;
tMax = 30;
value1 = 0;
value2 = 90;
r = linear(t, tMin, tMax, value1, value2);
if (t < t.valueAtTime(time - thisComp.frameDuration)){
a = 0;
}
else{
a = r;
}
Combine that expression with an accumulator (value ++) like Dan's beat counter and you would have an expression that rotated a layer clockwise based on the audio level but never moved counterclockwise.
If Dan sees this post he will be able to combine the two ideas into some working code for you in a couple of minutes. I don't have the time to do it now because a quick search for "javascript accumulator" didn't give me a working solution.