I would be curious to know the proper way to do this also. I have a workaround that is not the real deal, but may pass for what you’re looking for.
I put this expression together based on some examples on this forum. I can’t remember exactly where, but I’m sure Mr. Ebberts is to thank. This will only give a teleporting effect to start… But if you were to then convert the expression into keyframes and turn on motion blur, it gives the effect of movement back and forth on each beat.
// Increase value by 1 on each beat
output = thisComp.layer("Snare").effect("Sound Keys")("Output 2");
above = false;
frame = Math.round(time / thisComp.frameDuration);
val = 0;
while (frame >= 0){
t = frame * thisComp.frameDuration;
if (above){
if (output.valueAtTime(t) < 30){
above = false;}
}
else if (output.valueAtTime(t) >= 30){
above = true;
val++;}
frame--}
val
//On each increase, alternate back and forth
zVal1 = [100,2200];
zVal2 = [10,2200];
val%2 ? zVal2 : zVal1;