Page 1 of 1

sub-frame keyframes

Posted: April 27th, 2010, 11:11 am
by theau
Hi,

I am trying to work out an expression to beat match a song.

I have two keyframes on a time remap which i want to be able to control their distance apart from a slider and loop.
I need to be to control it with a slider as the BPM is not divisible by my frame rate.

Is there an easy way to do this?

Re: sub-frame keyframes

Posted: April 29th, 2010, 2:55 pm
by theau
so, i've been playing around with this and this is where i've got to:

start = effect("start")("Slider");
bpm =effect("BPM")("Slider");
bar = bpm/60; 
t = ((time - start)%bar)/bar; 
valueAtTime(linear(t, key(1).time, key(4).time)) 

This is sort of working, it allows me to input four keyframes and have them cycle through to the beat however i there are a few things that I cant work out how to fix. The first issue i have is once it gets to beat / keyframe 4 it cuts straight back to beat 1 instead of holding for the full duration of a beat. Secondly, is there any way of making the keyframes snap rather than interpolate?

thanks

Luke