View Single Post
Old 2006-01-22, 11:20   Link #129
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
Since the kirakira (for lack of a better name :P) moves as a function of time, and it moves in both the X and Y axes, a paratetric function makes the most sense.
Here I'll assume the time a syllable is highlighted goes from 0 to 1, since that's the simplest. 1/10 of the time a syllable is highlighted is spent moving from the previous syllable's end position.
I'll assume the bottom center of a syllable is coordinate (0,0) for simplicity. Again, this is easily "fixed". "width" is the width of the current syllable, 5 is the smaller radius of the ellipsis. The X center for the previous syllable is "prevx".

x(t) = prevx*(0.1-t)*10 for t < 0.1
x(t) = sin((t-0.1)/0.9*2*pi)*width/2 for t >= 0.1
y(t) = -5 for t < 0.1
y(t) = -cos((t-0.1)/0.9*2*pi)*5 for t >= 0.1

Of course you'll need some special cases for the first and last syllable on a line. Note that this one assumes a linear movement between the syllables, I can't remember how it is in Sergejack's original karaoke. If it's an ellipsis with double radii in the top part, my functions will obviously be wrong.

I hope this was useful
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote