You can mount a 3-D object onto another object by specifying the target model in the 7th argument of MODEL_ADD.  In the example below, the spinning menu is attached to a model with alias name “mei”. This command is used in the “Sample Script” of MMDAgent.

  0 1 <eps> MODEL_ADD|menu|Accessory\menu\menu.pmd|0.0,-4.5,0.0|0.0,0.0,0.0|ON|mei

You can also specify a target bone where the model should be mounted. The following example mounts the menu on the right wrist of the model. (“右手首” means “right wrist” in Japanese)

  0 1 <eps> MODEL_ADD|menu|Accessory\menu\menu.pmd|7,-1.5,0|0,90,90|ON|mei|右手首

manu_on_wrist

=== Japanese ========================================

ある3Dモデルを別のモデルに載せて表示するには,載せる対象のモデルをMODEL_ADDコマンドの7番目のオプションで指定します.たとえば,モデルエイリアス名meiのモデルに回転メニューを追従して表示させる場合は,以下のように記述します.これは,MMDAgent本体と同時に配布されている「Sample Script」でも使われています.

  0 1 <eps> MODEL_ADD|menu|Accessory\menu\menu.pmd|0.0,-4.5,0.0|0.0,0.0,0.0|ON|mei

また,ボーン名を追加で記述することで特定のボーン上に載せることもできます.以下の例では,meiの右手に回転メニューを載せています.

  0 1 <eps> MODEL_ADD|menu|Accessory\menu\menu.pmd|7,-1.5,0|0,90,90|ON|mei|右手首

manu_on_wrist

CC-BY-NC Copyright 2009-2013 Nagoya Institute of Technology (MMDAgent Model “Mei”)
CC-BY Copyright 2009-2013 Nagoya Institute of Technology (MMDAgent Accessory “NIT Menu”)

Setting and moving the camera

December 27, 2013

The camera view of MMDAgent can be handled in several ways. At any time, you can see where the camera is focused by pressing the “D” key, and the current focus point will be shown as an orange cube in the scene.

focus_orange_cube

  1. Use the mouse to manually change the camera view:
    • A drag will rotate the view.
    • A drag with “Shift” key will translate the view.
    • Spinning the mouse wheel will change distance from the focus point (zoom in/out).
    • Spinning the mouse wheel while pressing the “Ctrl+Shift” keys will change the fovy (field of view, y).
  2. Use a CAMERA command in the dialog script (.fst) to define a set of camera parameters. The arguments should be given in the format described below, i.e., in the same order and values as in the article “Viewing Log Information,” except for the last argument:
      CAMERA|x,y,z|rx,ry,rz|distance|fovy|time

    Here, “time” is the number of seconds required to move the camera to the specified parameters. A value of “0” will set the parameters immediately, and “−1” will perform a smooth movement.

  3. You can provide a camera motion file (.vmd) created using “MikuMikuDance” to move the camera as programmed:
      CAMERA|camera_motion.vmd

=== Japanese ========================================

カメラ視点を複数の方法で制御することができます.「D」キーを押すことで,カメラの焦点がどこにあるかをシーン内にオレンジの立方体として表示させることができます.

focus_orange_cube

  1. マウスを使って手動でカメラ視点を変更できます.
    • ドラッグで回転
    • 「Shift」キー+ドラッグで平行移動
    • マウスホイールで焦点からの距離を変更(ズームイン・アウト)
    • 「Ctrl+Shift」キー+マウスホイールで画角の調整
  2. 音声対話スクリプト (.fst) 上でCAMERAコマンドでカメラのパラメータを指定できます.「Viewing Log Information」で説明したログの左下の数字を以下のようにオプションとして与えます.
      CAMERA|x座標,y座標,z座標|回転のx成分,y成分,z成分|距離|視野角|所要時間

    最後の所要時間は変更にかける長さ(秒)です.0で即座に変更します.-1を与えるとでスムーズにパラメータが変化します.

  3. MikuMikuDanceで作成したカメラモーションをCAMERAコマンドで与えることでカメラを動かすことができます.
      CAMERA|カメラモーション.vmd

CC-BY-NC Copyright 2009-2013 Nagoya Institute of Technology (MMDAgent Model “Mei”)

Holding the scene

October 4, 2013

Pressing the “H” key will hold execution of all running motions in MMDAgent.  Since all motions will stop at the moment while allowing a change of the current view, you can check the whole scene at any moment within a dialog scenario.

hold

=== Japanese ========================================

「H」キーを押すと,MMDAgentの全てのモーション実行を一時停止することができます.キーを押した瞬間に全てのモーションが停止し,その中で視点を自由に変更することができるので,対話シナリオのある瞬間におけるシーン全体を確認することができます.

hold

CC-BY-NC Copyright 2009-2013 Nagoya Institute of Technology (MMDAgent Model “Mei”)
CC-BY Copyright 2009-2013 Nagoya Institute of Technology (MMDAgent Motion “Wait of Mei”, “Bye of Mei”)

Handling barge-in

September 20, 2013

It often occurs in speech interfaces that a user wants to barge in to the system utterance while the system is speakings. You can handle such a “barge-in” action from a user by creating a dialog script (.fst) as follows:

     1 10 RECOG_EVENT_STOP|こんにちは SYNTH_START|mei|mei_voice_normal|こんにちは。
    10 20 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|私の名前はメイと言います。
    20 30 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|私は情報案内ができます。
    30 50 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|ご用件をおっしゃってください。
    10 40 RECOG_EVENT_START SYNTH_STOP|mei 
    20 40 RECOG_EVENT_START SYNTH_STOP|mei 
    30 40 RECOG_EVENT_START SYNTH_STOP|mei
    40 50 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|はい。
    50  2 SYNTH_EVENT_STOP|mei <eps>

=== Japanese ========================================

音声インタフェースではシステムの発話中にユーザがその発話を遮って音声入力を行うことがあります.これをバージインといいます.以下のように音声対話スクリプト(.fst)を記述することでバージインを扱うことができます.

     1 10 RECOG_EVENT_STOP|こんにちは SYNTH_START|mei|mei_voice_normal|こんにちは。
    10 20 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|私の名前はメイと言います。
    20 30 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|私は情報案内ができます。
    30 50 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|ご用件をおっしゃってください。
    10 40 RECOG_EVENT_START SYNTH_STOP|mei 
    20 40 RECOG_EVENT_START SYNTH_STOP|mei 
    30 40 RECOG_EVENT_START SYNTH_STOP|mei
    40 50 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|はい。
    50  2 SYNTH_EVENT_STOP|mei <eps>

MMDAgent can speak any text sentence using the SYNTH_START command.It takes three arguments. The first is the alias of the model to perform lip synchronization with the text. The second is the choice of speaking style as described in the article “Definition of speaking style”.  The third is the text string to be uttered.

The SYNTH_STOP command terminates ongoing speech immediately. The first argument of the command is the model alias currently speaking.

At the end of speech output, a SYNTH_EVENT_STOP event will be issued.

=== Japanese ========================================

SYNTH_STARTコマンドで好きな文を喋らせることができます.第1引数にリップシンクを行うモデルのエイリアス名,第2引数に「Definition of speaking style」のように定義されている発話スタイル名,第3引数に喋らせたい文を記述します.

発話を途中で終了させるにはSYNTH_STOPコマンドを用います.第1引数にはモデルのエイリアス名を記述します.

発話終了時にはSYNTH_EVENT_STOPイベントが発行されます.

Speaking styles of speech synthesis in MMDAgent should be defined in the speaking style definition file (.ojt).  The speaking style definition file (.ojt) contains a list of speech synthesis parameters for each style such as voice mixture weights, duration, pitch, speaking rate, and so on.

The following is an example of speaking style definitions that define different styles using three voice models: “normal”, “angry” and “bashful”, located within the “Voice” folder. Note that texts preceded by “#” are comments.

    # number of voices
    3
    # voice names
    Voice\normal
    Voice\angry
    Voice\bashful
    # number of speaking styles
    7
    # speaking style names, interpolation weight, and synthesis parameter
    normal   1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.55 1.0
    angry    0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  1.1 -0.5  0.55 1.1
    bashful  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0  1.0  0.5  0.55 0.9
    fast     1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  2.0  1.0  0.55 1.0
    slow     1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  0.5  1.0  0.55 1.0
    high     1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0  4.0  0.55 1.0
    low      1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0 -2.0  0.55 1.0

The first part is a list of voices to be used, and then speaking styles are written per line.  The parameters at each line begin with declaration of a speaking style name, followed by the interpolation weights (from 0.0 to 1.0) of the spectrum model, fundamental frequency, and duration of a voice.  The remaining four parameters are speaking rate (from 0.1 to 10.0, default is 1.0), pitch shift (from -12.0 to 12.0, default is 0.0), gender (from -0.9 to 0.9, default is 0.55), and volume (from 0.1 to 10.0, default is 1.0).

=== Japanese ========================================

MMDAgentの音声合成で指定できる発話スタイルは,発話スタイル設定ファイル(.ojt)で定義します.発話スタイル設定ファイル(.ojt)では,発話スタイルごとにボイスの混合重み,持続時間,音高などの音声合成用パラメータを指定します.

以下は,normal, angry, bashfulの3種類のボイスがフォルダVoice以下に存在するときのいくつかの発話スタイルの定義例です.なお,#以降はコメントです.

    # number of voices
    3
    # voice names
    Voice\normal
    Voice\angry
    Voice\bashful
    # number of speaking styles
    7
    # speaking style names, interpolation weight, and synthesis parameter
    normal   1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.55 1.0
    angry    0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  1.1 -0.5  0.55 1.1
    bashful  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0  1.0  0.5  0.55 0.9
    fast     1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  2.0  1.0  0.55 1.0
    slow     1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  0.5  1.0  0.55 1.0
    high     1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0  4.0  0.55 1.0
    low      1.0  0.0  0.0  1.0  0.0  0.0  1.0  0.0  0.0  1.0 -2.0  0.55 1.0

最初の部分で使用するボイスを列挙し,次に発話スタイルを1行につき1つずつ定義します.それぞれ,各ボイスが持つ声質・音の高さ・話速の補間重み(0.0~1.0)をそれぞれボイスごとに指定したあと,全体の話速(0.1~10.0,標準1.0)・音高(-12.0~12.0,標準0.0)・ジェンダー(-0.9~0.9,標準0.55)・音量(0.1~10.0,標準1.0)の4つの調整パラメータを指定します.

By pointing a 3-D model and dragging with “Ctrl” key, the model can be moved forward, backward, left and right.

ctrl-moving
Also, with “Ctrl” and “Shift” key, the model can be moved up, down, left and right.

ctrl-shift-moving

=== Japanese ========================================

「Ctrl」キーを押しながらモデルをドラッグすることで,前後左右にモデルを移動できます.

ctrl-moving
また,「Ctrl」+「Shift」キーを押しながらドラッグすることで上下左右に移動できます.

ctrl-shift-moving

CC-BY-NC Copyright 2009-2011 Nagoya Institute of Technology (MMDAgent Model “Mei”)
CC-BY Copyright 2009-2011 Nagoya Institute of Technology (MMDAgent Accessory “NIT Menu”, MMDAgent Motion “Wait of Mei”)

System log information can be displayed as shown below by pressing the “D” key.

The text area behind the character shows log messages.  The messages embraced by “<>” are messages which was sent to modules, and the ones embraced by “[]” are messages issued by modules.

The lines at the left-bottom of the window shows several system parameters.  The first line shows the current amount of motion time adjustment in milliseconds.  The second line is a set of parameters for camera view in the form of “x-coordinate, y-coordinate, z-coordinate | x-rotation, y-rotation, z-rotation| distance | fovy”.  The bottom line shows the position of the origins for all displayed models.

left-bottom

=== Japanese ========================================

MMDAgentでは「D」キーを押すことで各種ログを表示できます.

まず,背景に表示されるのはメッセージログです.下図のように,<>で囲まれたメッセージは各モジュールへの命令となるメッセージで,[]で囲まれたメッセージは各モジュールから出力されたメッセージです.

画面左下に表示される数値はシステムの状態を表しています.1行目はモーションの時間ずれの補正量(ミリ秒)です.2行目はカメラの視点パラメータで「x座標, y座標, z座標 | 回転のx成分, y成分, z成分 | 距離 |視野角」となっています.3行目は表示されているモデルごとの原点座標の位置です.

left-bottom

CC-BY-NC Copyright 2009-2011 Nagoya Institute of Technology (MMDAgent Model “Mei”)
CC-BY Copyright 2009-2011 Nagoya Institute of Technology (MMDAgent Accessory “NIT Menu”, MMDAgent Motion “Wait of Mei”)

When starting motions, you can alter the range of application of the motion by specifying an option at the 4th argument of the MOTION_ADD command.

By specifying FULL option, all bone and expression key frames defined in the motion file (.vmd) are applied.

By specifying PART option, the key frames at the first frame (frame zero) are skipped.  This is the same behavior as dropping motion file (.vmd) with “Shift” key pressed in the article “Motion superimposition”.

=== Japanese ========================================

モーションを実行するMOTION_ADDコマンドでは,第4引数にオプションを指定することで,モーションの適用範囲を変えることができます.

FULLオプションを指定した場合,モーションファイル(.vmd)内で定義されているボーン・表情のキーフレーム全てが適用されます.

PARTオプションを指定した場合,0フレーム目にあるキーフレームがスキップされます.記事「Motion superimposition」で紹介した,モーションファイル(.vmd)を「Shift」キーを押しながらD&Dしたときの動作は,このオプションと同じ動作になっています.

When starting motions, you can determine whether the motion repeats in a loop by specifying the ONCE option or the LOOP option in the 5th argument of the MOTION_ADD command.

By specifying ONCE option, the motion automatically ends after the last frame is played.  When the motion ends, a MOTION_EVENT_DELETE event is issued.

By specifying LOOP option, the motion loops back to the first frame after the last frame is played, and repeats again and again.  A MOTION_DELETE command is should be used to stop the motion.

=== Japanese ========================================

モーションを実行するMOTION_ADDコマンドでは,第5引数にONCEオプションあるいはLOOPオプションを指定することで,モーションをループするかどうかを指定できます.

ONCEオプションを指定した場合,モーションが最終フレームまで再生された後,自動的に終了します.終了時にはMOTION_EVENT_DELETEイベントが発行されます.

LOOPオプションを指定した場合,モーションが最終フレームまで再生され,開始フレームへ戻り,ループ再生されます.モーションを終了させるにはMOTION_DELETEコマンドを使います.