-
Visit LearnMMD.com on Facebook!.
Keep the Faith-MMD... Learn to be a responsible MMDer! .
.

Advanced subtitles for MMD: Using MikuTelopE


A feature article by KillerBeerWhat is MikuTelopE effect? How can I make subtitles for MMD? What is better, Nameplate or MikuTelopE?

Provide your videos with subtitles

In the age of silent movies, Kaito and Rin Kagamine couldn't speak... they needed subtitles for MMD!Until lately, Nameplate MME effect was the only method to add text messages to your MMD pictures or videos. Alas, with all its advantages, it also makes subtitles creation rather painstaking, especially when you need more than one phrase to appear. You have to prepare each subtitle as a separate .png file in the image editor, then adjust its position on the screen using Dummy Bone… and then you decide to move your camera and desperately try to figure where your title disappeared to. Here’s an alternate method to add text to MMD.

MikuMikuTelop, originally written by SoboroP and then translated into English by harryhack91 as MikuTelopE (along with fixing the bug that prevented its usage on computers with non-Japanese locale) is not an MME effect as such but a *tool* to generate ones. Using it, you can apply any volume of text messages to your MMD video in a breeze.

Download the archive from the link provided on a dA page mentioned above and unpack it somewhere in your MMD folder. Launch the MikuTelopE.exe, hit “Load” and select one of .txt files in the “samples” folder (your actual files don’t have to be resided there, so apply whatever policy you use to organize your files, as long as you can find your works afterwards :) ). Immediately you will see that a subfolder named “your_file_name_MMT” is created next to it. Load your MikuMikuDance project, open “PostTelop.x” (at this moment the screen will turn red; keep calm and carry on) and then “MikuMikuTelop.x” from that subfolder into the Accessory Manipulation Panel, and you’re good to go. Hit “Play” and you will see your subtitles playing on top of a video you made. That’s it, there’s nothing else you need to do to make subtitles!

…Provided you have the file, of course.

A script to produce subtitles with MikuTelopE is a simple text file you can write in Notepad. It consists of three types of lines: format and positioning description commands (preceded by “:”), timing commands (preceded by “@”), and actual text (everything else). If you’re not used to doing things through scripting, it may feel complex at first, but in reality it’s not that difficult. Let’s see how it works.

Lights…

These commands are used to describe lines’ format:

  • :screen width,height
  • :font font_name
  • :size font_size  (relative to *screen* size)
  • :fontcolor R,G,B (in 0-255 interval)
  • :alpha opacity (float value in 0-1.0 interval)
  • :edge border_size (relative to *font* size)
  • :edgecolor R,G,B
  • :shadow shadow_distance (0 to 9)
  • :shadowcolor R,G,B
  • :shadowblur radius (0 to 9)
  • :margin hor,vert – background plaque’s parameters
  • :backcolor R,G,B,alpha (alpha is 0-255 as well here)
  • :bold
  • :bold_off (same for all subsequent commands)
  • :italic
  • :underline
  • :strikeout
  • :tate – vertical orientation of the line

Every line of text present in the script produces a .png file that is then projected to the screen by the MikuMikuTelop.x effect. While the size of the image *file* depends on screen height as declared in the script (the more you provide in the “:screen” command, the bigger would be an image for a title with the same font “:size”), the *visible* size of a title is leveled according to proportions of the actual MMD screen size. All font-related commands are cumulative – you can describe a format fully (or just go with defaults) and then change one or another parameter to specify another:

:fontcolor 255,0,0
:italic

This line will be red and italic

:fontcolor 0,0,255

This line will be blue and italic

:italic_off

This line will be blue and straight

Also you can make ready presets to lines of various types. Here is an example of the text file, putting together the assignment of type color & font for each model, and the timing for the subtitles:

// A sample script, ready for processing:

:fontcolor 255,0,0
:font Arial
:set Meiko

:fontcolor 0,0,255
:font Courier
:set Miku

:get Miku
@0
Hi, how are you?

:get Meiko
@3
Same old, same old…

Camera…

Positioning in MikuMikuTelop is a tricky matter, needing to get accustomed to. You must remember that regardless of screen size and proportions, subtitles are always positioned using a 200×200 Cartesian coordinate grid:

Subtitles for MMD are distributed in a grid like this

Dust off your schoolbooks, folks, today we study algebra

Here are commands that are used to describe subtitles’ emplacement:

  • :pos x,y
  • :pos_x x
  • :pos_x +x (relative to the previous X declaration)
  • :pos_y (similarly)
  • :pos_next (calculates the X position according to the previous line’s width)
  • :pos_nextline (same for previous line’s height)

Depending on aligning (see below), lines of text are attached by the middle, edge, or a corner to the “anchor” – position described by “pos” commands. By using “pos_next/line” commands, you can put two or more lines adjacent to each other without calculating their exact location for all but first one. It’s not very convenient, though, as those positions are calculated *really* close to each other, without slightest gap between texts and with no regards to such additional effects as fonts’ border, margin, or shadow (hint: for horizontally adjoining lines you can use leading whitespaces to create a necessary gap). While the readme does not recommend using multi-line titles, short sequences seem to be processed correctly.

Lines can be aligned using following commands:

  • :align_left
  • :align_center
  • :align_right
  • :valign_top
  • :valign_center
  • :valign_bottom

Here’s a practical example of aligning the text:

 subtitles2:pos 0,0

:align_left
:valign_top
@0
align_left
valign_top

:align_right
:valign_bottom
@0
align_right
valign_bottom

The first command places an anchor in the center of the screen. Then, two different sets of position instructions are used to display their own descriptions. As you can see, rather than placing a title to the top, bottom, right, or left from the anchor, it sticks its top, bottom, right, or left edge to the anchor, respectively. If this looks non-intuitive, well, that’s Japanese for you.

Action.

Timing of subtitles has flexible form:

@1,2
This line will start at 1 second and *last* for two seconds

@1~2
This line will start at 1 second and *disappear* at 2 seconds

@1
This line will be visible proportionally to its length in characters

@100F~200F
This line will start at frame 100 and disappear at frame 200

@+1
This line will start 1 second after the previous line disappears

@*1
This line will start 1 second after the previous line appears

Additional commands related to time:

  • :fade length (default 0.5 seconds)
  • :autotime duration – defines seconds-per-character default length
  • :timebase shift – automatically moves all subsequent titles

You do not place more formatting commands between timing commands and actual text.

I said, Action!

Make your own subtitles for MMDNow, knowing basics of MikuTelopE scripting, let’s try something real. Copy the example above into a text file, load it into MikuTelopE, and load resulting effects into MMD. What do we see? First, the second subtitle appears before the first one disappears. Second, both lines are seen on the left side of the screen. Since we didn’t specify titles’ duration, it’s calculated using the autotime parameter, which is set to 0.3 seconds by default, or 9 frames per character. As for the second… perhaps the default for horizontal alignment is left? Let’s edit the file and see what happens.

// A sample script, ready for processing:

:autotime 0.1

:fontcolor 255,0,0
:font Arial
:align_left
:set Meiko

:fontcolor 0,0,255
:font Courier
:align_right
:set Miku

:get Miku
@0
Hi, how are you?

:get Meiko
@3
Same old, same old…

Hit the save and go straight to MikuMikuDance. You don’t have to recompile the script by hand – as long as MikuTelopE hangs in memory, it monitors the state of all scripts loaded into it and recompiles them automatically (and, as you might have noticed from your previous experience, MMD also monitors and reloads automatically MME effects as you edit them). Now, what have changed on the screen? As you can see, instead of moving the red line to the right side, it ousted the blue line outside the border of the screen. Apparently, the default horizontal position for an anchor was not at the center of the screen as we used to see with subtitles, but close to the left edge (not *at* the edge, though, or we wouldn’t see even a glimpse of it and would stay rather perplexed at results). Should be easy to fix. As for timing, it looks good enough – as long as we are doing a “silent film” flick. If we were following a certain voice file, though, we’d need more precise synchronisation than autotime setting allows. Let’s change the script once again:

// A sample script, ready for processing:

:pos_x 0

:fontcolor 255,0,0
:font Arial
:align_left
:set Meiko

:fontcolor 0,0,255
:font Courier
:align_right
:set Miku

:get Miku
@0.5~2.5
Hi, how are you?

:get Meiko
@3.3-2.2
Same old, same old…

Oops! The sound we hear suggests something bad happened. You won’t see it until you place MikuTelopE process in the foreground, but it just threw an error message at you. It seems that something in our new script is wrong. A brief investigation shows that the “duration” parameter of the second timing command does not accept fractional numbers. Can’t fathom why the exception, but that’s how it works. Fix it…

@3.3-2

…and now it works!

Well, that should be enough to allow you to study MikuTelopE’s possibilities further for yourself.


Q&A: Does it mean Nameplate is obsolete?

No, of course not. There are qualities that make Nameplate an instrument of choice for certain purposes.

  • MikuTelopE only works with texts. Sure there are many sophisticated fonts, including those that allow to use pseudographic, like Wingdings, Webdings, etc, but in the end of the day MikuTelopE is solely a text engine, while Nameplate lets you display anything you can draw, limited only by the size of your .png file.
  • While positioning of Nameplate requires more effort (especially if you use moving camera), it is also more flexible. Images placed on the screen can be moved (moving a respective Dummy Bone) and resized (by effect’s “Si” setting). So far, the current version of MikuTelopE has no such functionality.

I load the file, but get a “couldn’t find .\template” error!

This happened to me when I tried to use MikuTelopE on an XP machine. Fortunately, the error is not fatal. First, hit “Refresh” – the script will compile properly this time. Then find “MikuTelopE\template” subfolder and manually copy files “MikuMikuTelop.x”, “PostTelop.fx”, and “PostTelop.x” from there to the folder containing your script. After that, it will work normally.

Models used for the head picture: Kaito wears male suit by MMDFakeWings18 and Bowler Hat by Rainb0wCat & Crazy eyes. Rin Kagamine wears Loli dress by Saler1.


– SEE BELOW for MORE MMD TUTORIALS…




Visit the LearnMMD.com Homepage! Plenty of Mikumikudance instruction and info!

8 Comments

  1. kropiciel kropiciel
    March 17, 2017    

    Okay, it wasn’t too long for me to have another problem.
    Namely I’m having difficulties with that last script. Not mentioning the “Process can’t get access etc.” after most times I edit the .txt, because of which I need to reload the same file again and again, even if its status is in fact OK, I can’t get an OK for the last script, where
    “:get Meiko
    @3.3-2.2
    Same old, same old…” is, I’m getting errors even if I change 2.2 to 2.
    What’s more, I’ve tried a lot of numbers combinations and it just doesn’t work. Neither @3-2, @2-3 nor anything else. I’m also not too sure about what does minus in @x-y stand for.
    Also, what do “get” and “set” do?

    • March 18, 2017    

      Hmm, weird, I remember getting a meaningful response with it when I wrote the tutorial, but now it doesn’t work, just as you say. The good news is, you can get the same result using “@3,2″… and even with fractional numbers for *both* parameters. This form is used for parameters “start-time” and “duration” instead of “start-time” and “stop-time” like x~y does.

      :SET memorizes the cumulative state of format in a variable. After that you may quickly restore it with :GET instead of reissuing all commands again.

      Do you go to the MikuTelopE window and erase all error message popups it throws when you hear the sound?

      • kropiciel kropiciel
        March 18, 2017    

        Ah, so that’s what it does. I think I understand, so :SET takes into consideration everything that is written above, concerning the lines’ format?

        Yes, I do close error messages, then I try to save .txt again. Sometimes I need to try and save it once, get an error, and finally the second time to get an OK, but when that proves futile, I have to restart MikuTelopE. It doesn’t happen every time though, like I just intentionally made a syntax mistake, got the error, then edited to the right version and get OK back.
        It isn’t much of an issue to use, but the bug persists.

        I did a couple of tests, let me show the results:
        I focused on editing
        “:get Meiko
        @3.3,2.2
        Same old, same old…” phrase.
        -I load the original version, change 2.2 to 2, save – it’s okay
        Now I change back to 2.2, save – and get an error. I save once again, the error keeps occuring no matter how many times I repeat the action. But then I change back to 2 – then I get an OK again. I just tried to change it to 2.1 now, saved once – error, twice – error. The third time I saved, it surprisingly gave me an OK. Then changed back to 2, kept getting errors all the time, but changed back to 2.1, had to save 3 times again to get OK. Changed to 24, got error first and second time saving, but third time was ok. Changed to 25, had to save TWICE this time. Changed to 26 and kept getting errorrs all the time. It’s so random!

        tl;dr version: errors seem to happen randomly.
        Don’t you get errors like me?

        • March 18, 2017    

          Hmm, no, to me it worked consistent enough. Weirdness.

  2. kropiciel kropiciel
    March 16, 2017    

    I’m getting errorrs “error parsing text_file.txt” whenever I edit a file in such a way that I put “:autotime 0.1”, or the whole next script with “@3.3-2” doesn’t work either – then I recieve the message something along the lines that “Process can’t get access to the file because it’s being used by another file.” Can’t overcome those problems

    • March 16, 2017    

      Do you get the same error if you put “:autotime 1” or other integer number? Open Control Panel’s Region and Language section and see what is your value for decimal symbol (must be dot) and digital grouping symbol (must be comma). See the picture for details.

      • kropiciel kropiciel
        March 17, 2017    

        If I put an integer for the first time loading .txt, I don’t get the bug, however if I change it to a decimal, save, I get the bug (obviously), but then trying to get back to previous state is impossible, this time the error occuring is: “Process can’t get access etc.”

        Okay, I acutally wrote all this, but decided to not erase it for future reference. I’ve checked control panel’s options and did as you said – changed the decimal symbol to be a dot (the fact that I’m Polish explains why I had a comma instead), but I’ve had tried to use a comma even before and it hadn’t worked. I guess it’s software’s problem that it ONLY accepts dots in its scripts…
        Damn, I hope I won’t forget about that option the next time I’ll need to change it back! For now the problem has been solved, thank you for quick response! If I won’t know anything else, I’ll ask again! By the way the guide was nicely explained.

        • kropiciel kropiciel
          March 17, 2017    

          PS. I wish there was an edit button, I want to edit my horrible grammar mistakes xD

Leave a Reply

Your email address will not be published. Required fields are marked *

Download the latest version of MMD MikuMikuDance! Step-by-step instructions to help you make an MMD Music Video! bo-beep-bo-beep! LearnMMD's Step-by-Step MMD instructions for MikuMikuDance!

MMD Tutorials:


Really Learn MMD as you face the 15-second Animation Challenge!

Visit LearnMMD.com on Facebook!