[AE] Smoothing keyframes for wiggle rotation w/ audio
Currently I'm trying to make a montage edit where I can easily add any footage and music and the footage will automatically "react" to the music. Problem is, I am having trouble creating a smooth wiggling effect. Each set key appears to have large amounts of variation in areas where the intensity of the music is fluctuating quickly. This results in the wiggling effect to fluctuate quickly, creating a jittery effect. I have tried many approaches. Initially tried using the smooth function, and lately have been trying to utilize integration to achieve a smooth effect, however haven't had much luck with that either. My latest result is just a result of me messing around with many values, so it may look a bit messy. Any suggestions/references to achieving the effect I have in mind would be great, thanks.
freq = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
n = freq.numKeys; //numbers of keys in layer
if (n > 0 && freq.key(1).time < time) { //at least past the first frame and second frame.
accum = freq.key(1).value * (freq.key(1).time - inPoint);
for (i=2; i <= n; i+=1) {
if (freq.key(i).time > time) break;
k1 = freq.key(i - 1);
k2 = freq.key(i);
accum += (((k2.value - k1.value) * (k2.time - k1.time)) / 2);
}
accum += (freq.value - freq.key(i - 1).value) * (time - freq.key(i - 1).time) / 2;
} else {
accum = freq.value * (time - inPoint);
}
linear((freq.smooth(11, 83)*0.25) * accum, 6, 20, 0, 12);
NOTE | I am using the wiggle effect (rotation) to manipulate the screen movement instead of the wiggle function.
