Line-Per-Syllable tutorial
From Aegisub Wiki
|
This tutorial will teach you how to use line-per-syllable.lua to create slightly more advanced effects than what simple-k-replacer.lua can do.
Prerequisites:
- Same as in the Simple-K-replacer tutorial
- Knowledge of using simple-k-replacer
[edit] A little theory
First a little explanation of what line-per-syllable.lua does and why it's needed.
In ASS, each line can only contains one \move tag, and a \move tag will always affect an entire line. The same goes for the \org tag and a few more. Furthermore, rotations will often act quite differently on text in the beginning, middle and end of a line.
For these reasons (and a few more), not all "really cool" effects can be made using just one single line for each displayed line, having everything in one place. The only way to get around the limitations above is to split each displayed line into multiple smaller lines, and having each line placed manually on screen, so they seem to match up, forming one single visible line.
This is what line-per-syllable is for. It creates a new line for each syllable, and gives you some more variables apart from those you know from simple-k-replacer, to handle the placing of the syllables.
[edit] Basic usage of line-per-syllable.lua
- Load your karaoke timed subtitles.
Load line-per-syllable.lua:

- Close the Auotmation Manager. This time we won't use the Apply button, partly because it's just a bad idea (as demonstrated in the previous tutorial) and partly because the output line-per-syllable creates is just too incomprehensible, and often rather meaningless, so it doesn't make sense to view.
- Open the Styles Manager and edit the style used for the lines you want to make karaoke of. You should set the alignment of those to "5", ie. center/center. This is to make the effect look right, and is generally the easiest to work with. You might want to experiment with other alignments too. You should probably also disable the shadow.
Now enter the Export dialog, and disable all the other filters again. Notice the extra variables added here compared to line-per-syllable:

The default effect already presented makes a nice example, so just hitting Export and take a look at the result. The effect should result in each syllable rotating around itself, an effect you can't achieve in any way with simple-k-replacer.
In this effect, the most notable part is probably the \pos($X,40) tag. $X is a variable that tells where the syllable should be positioned, assuming the alignment is 8, 5 or 2! It also makes the line centered on screen. The Y position, 40, is mostly randomly picked, but it usually looks fine. The most important thing is that it's a constant. (Unless, of course your effects demands it's not.)
Now let's try a different effect, involving some movement in it.
{\move($x,40,%$x-100%,40,$start,%$start+1000%)\fade(32,0,255,$start,$mid,$end,%$start+1000%)}As you can probably guess, this will make the syllables move left and fade out.
This concludes the tutorial.
[edit] More example effects
This section is a stub. Imagination needed here.
[edit] Additional variables and tips
There isn't much more to line-per-syllable than to simple-k-replacer, except for the added requirement of putting in \move or \pos. The same tricks can be used, since they're both based on the same code.
Unfortunately, when you create effects like those doable with line-per-syllable, you'll often want to have multiple lines per syllable, which is not directly possible with line-per-syllable. For that reason, you should really use multi-template instead, since it gives you all the power of line-per-syllable, just in a much easier to use fashion, while still adding more powerful tools you can use or ignore.
