Thread: AE Karaoke
View Single Post
Old 2008-10-18, 10:34   Link #35
pichu
Senior Member
*Fansubber
 
Join Date: Jul 2004
http://code.google.com/p/aftereffectskrk/

Okay, I fixed out most of the bugs, and is ready for public testing. The whole project is to allow one to automate karaoke easily just like Auto4 for .ass, and you have one for AFX. Since there are no presets in this script, you can't make Karaoke without knowing AFX. I also wrote a getting start guide on that page. You can learn how to make a very basic Karaoke. The script behaves like Shinji's script.

Here's the settings:

To add one layered effect:
  1. Keyframes (0-100%) for end selector at [ marker.
  2. Keyframes (0-100%) for start selector at ] marker.

To add two layered effect using opacity (on and off syllables) [make sure you disable them when generating]
  1. On
    1. On Layer: Opacity=0%,
    2. Syllable On animator: Opacity=100%. Keyframes (see single layered)
  2. Off
    1. Off Layer: Opacity=100%
    2. Syllable Off animator: Opacity=0%. Keyframes (see single layered)

Note: all use advanced.mode=Add. I have not added "before" and "after" syllable handling yet, but they'll be around when I have the time to design the inputs. It should be easy, and it can be added into part of the codes. You can also cheat this part with Line effect using Ramp Up and Ramp Down in advanced.shape.

edit: To add Before and After syllable effect, use Ramp Up and Ramp Down MODE for syllable effect. Play around with this, since I haven't done so.

Codes guidelines

There are two types of timings. Syllable and Line (usually the default).

Under KRK Comp:
  • add( "CompositionName" ): Adds a composition name. (case insensitive since this one is a linear search of your entire project; AFX does not retrieve it for you)
  • shift( time ): Shifts the karaoke by time. This is done globally to the variable.
  • setFontSize( fontSize ): It sets the font size to your Karaoke data. The font size generated from the script is 1px (it's scaled from 1000px to 1px, so the precision is three decimal places)

Under KRK Text Layer in each Comp:
  • add( "LayerName" [, false] ): Adds a Layer name. (case-sensitive). This returns KRKLayer object. All the following properties inherit from this, so you can just add a dot (.) after add("LayerName") with the action to do further work. If you change false to true, it will generate syllable per layer. false is optional and is default.
  • .p( "propertyname" [, false] ): Adds a property with the name propertyname: You can obtain the property name by alt-clicking the clock near the property to bring up expression. The name is exactly written there. false tells the script that you're generating based on the line. True if it will be generated based on the syllable on the same line (note: it's best not to have any lead-in and lead-out in the syllable timing, or else it will mess up everything unless you generate syllable by layer, then it's good to go)
  • .p( "propertyName" , { syl: true , pos: true } ) -- This one is for those who know expressions and want to handle the positional data. syl: true tells that the script to generate syllable by layer. pos: true tells it to renormalize (0 [beginning of the syllable] to 100 [end of the syllable]) the values to the positions of the syllables (or line if syl: false). If you have an expression there, it will automatically add an object o into your expression with o.w being the width of the line and o.h being the height of the line.
  • .a( "animatorName" [, false] ) -- this adds a text animator to the generator. You can add multiple animatorName here with ['animatorName1' , 'animatorName2']. Changing the false to true will add it based on the syllable
  • .l( styles [, false] ) -- This adds a line with styles. false is add by line, and true is add syllable by layer. styles are described below:
    • nothing or null: Everything
    • "style1": style1 (must be in lower case) from your .ass json.
    • ["style1" , "layer1" ]: it will use style1 and layer1 (usually 0, but you can adjust it there) from your .ass json.
    • ["style1" , "layer1" , line1/[line1,line2,line3] ]: This will get the line1 or line1,2,3 respectively
    • ["style1" , "layer1" , line1, syl1 or [syl1,syl2,syl3] ]: This will get the syllable 1 or syl1,2,3 respectively

Now you're finished. Tell me what do you think. Note: You must be good in After-Effects, understanding how properties and text animators work. Or else, you won't be able to use this script at all.

Last edited by pichu; 2008-10-18 at 15:18. Reason: Before and After syllable effects using RAMP modes
pichu is offline   Reply With Quote