HOME | DD

AddestorionVayanis — MMM / MMD Automatic Lipsyncing for vocal tracks

Published: 2014-01-04 06:01:27 +0000 UTC; Views: 74381; Favourites: 811; Downloads: 537
Redirect to original
Description This tutorial is a summary of what i have been doing for a side project for my patron.
It is how to obtain a decent enough MMD lipsync from an acapella (vocal only) track with as little effort on your end as possible.  The reason why i write this for facial data is because although Mr Mogg's VMDReductionTool program sites.google.com/site/moggproj… can be used to smooth out motions of bones (usually from kinect), it cannot be done for facial data.
Therefore, another method has to be used.

VIDEO VERSION - www.youtube.com/watch?v=ozKBYG…

Stuff Required:
MikuMikuMoving
Lipsyncloid plugin
A model which has at least the facials a, i, o and u.  The facial 'e' is not required.
VMDConveter2
A program which can open spreadsheets.  Microsoft Excel works for most cases.
A vocal only soundtrack.  This can be either a song vocal, or a recorded microphone track.  The file must be a .wav file encoded to 48kHz frequency at 16 bits.  I use Super by erightsoft www.erightsoft.com/SUPER.html to convert my audio files to this format.  Additional info: 1536 kb/s using WAV-sowt (PCM 16 little endian), 2 channel.

MikuMikuDance (optional.  i use it because all my effects files work in MMD, but not necessarily in MMM)

GETTING A LIPSYNC FROM AN ACAPELLA MUSIC FILE
1. Download MikuMikuMoving sites.google.com/site/moggproj…
2. Download Lipsyncloid by なヲタ (nawota1105 on bowlroll) - www.nicovideo.jp/watch/sm22506… I found it here - www6.atwiki.jp/vpvpwiki/pages/…
3. NOTE - when you download the files, before unzipping or unrarring it, right click the file, and open properties.  Then click unblock.  If your PMDeditor or MMD is running into a gazillion errors before starting saying plugins cannot load, (HRESULT: 0x80131515) the reason is because windows is blocking all .dll files as it deems them unsafe.  This fixes it.
4. Unzip your stuff.
5. Copy lipsyncloid.dll into the Plugins folder of MikuMikuMoving.

USING LIPSYNCLOID - 3:32
1. Open MikuMikuMoving.  The Lipsyncloid plugin should show up in the Plugins section of MikuMikuMoving
2. Load a model and the audio file.
3. Press Lipsyncloid.  This will convert the .wav file
4. If you encounter an error, it means that your .wav file isnt encoded to the format i told you to convert it to.  Fix it.
5. If MikuMikuDance enters an out of memory alert, it means your wav file is too long.  A safe number of frames which it can succesfully transcribe is 15,000.  Split up the remainder if required.  You may also need to shut down other programs as well. 
6.  You get a happy notification if its all okay.
7.  The motion is loaded onto the model.  It transcribes only for the facials a, i, o and u.  It does so for every single frame.
8.  If you are fine with the results you obtained, you may stop here.  Otherwise, keep reading.


CONVERTING THE MOTION INTO A SPREADSHEET FORMAT 6:36
1. You will probably note that since the facial changes every second, it is very shaky.  You could manually edit the values in MikuMikuDance/Moving, but this section teaches you how to fix some of that using a spreadsheet.
2. Select all the facial data in the Sequence tab.  Then using MikuMikuMoving > File > Export Motion > choose a folder, select VMD, choose only the a, i, o and u facials, then Export.
3b. Download Yumin3123's VMDconverter yumin3123.at.webry.info/200810…
or
3b. If the previous link did not work, searching bowlroll gets you a graphical version of the VMDconverter: bowlroll.net/file/13705

3a - VMDConverter
1. The VMDconverter is a program which converts VMD motion files to CSV spreadsheet files, and vice versa.  Microsoft excel can be used to open them.
2. To convert a motion to CSV, drag and drop the saved VMD file directly onto VMDConverter.exe.  Wait for it to finish.  It will close by itself once its done.
3. The converted file will appear in the same folder as the VMD file.

3b - VMDconvertorGraphical
1. This version is an exe file which can be opened to reveal a graphical menu.
2.  Use the program to open vmd files to convert them into csv files, and then you can use the same program to convert csv files back into vmd files.
3.  Open vmd or csv files, using the File drop down menu, and once the files are open, click on the button below and wait for it to process it. You'll get a notification when its done



[I'm going to be using Microsoft Excel from here on]

MAKING SENSE OF THE CSV FILE 10:40
1.  Open your .csv file.  It stands for 'comma separated values' spreadsheet.  So you can also open it with notepad and edit the values using it, but its a lot easier to open it with excel or a proper spreadsheet program.  Read more here - en.wikipedia.org/wiki/Comma-se…
2.  When you open the .csv file in excel, you may encounter an error, where you cant make sense of the data.  If you encounter this error, it means your excel is defaulting into english first.  To fix it, go to Excel > Excel Options > Popular > Language Settings > Primary language settings > Japanese (Japan)
3.  From now on, when you open the file, it should default into japanese first, and can see the right names and stuff.  It will ALWAYS use the japanese naming.
4.  Now that we have that settled, the first row is the description.  Its usually Vocaloid motion data0002.  Dont touch this.  The second one is the name of the model that the motion is for.  If you alter this, you'll just be alerted if the name of the model here and the name of the model dont match.  The third row is the number of effective frames.  There is one per facial per frame.  This number must be changed if the number of rows have been changed somehow.
5.  The first column from 4th row onwards is the facial name.  Second is the frame.  Third is the value.  For facials its 0 to 1.
6.  After the frames, are are usually two rows with zeroes after the very last frame.  When recounting how many hows for the amount of frames, do not count the rows with the zeroes.


OTHER TYPES OF CSV FILES
1.  If you exported a bone, the 4th, 5th and 6th row is X, Y and Z coordinates, 7th 8th and 9th row are X, Y and Z angle rotations and the 10th column is for the interpolation data (i dont recommend touching the 10th column).  For rotation values, you can have it go below -180 degrees and above 180 degrees, but MMD will automatically change it once you load the motion to something -180 to 180.  
2.  If you export camera motion, then the 1st column is the frame, and the remainder is XYZ and rotation XYZ.  I'm not sure what the next column does, but the final column with the long combo controls view angle and perspective mode.  Try not to mess with this while in the spreadsheet editor.  Safer to just copy and paste the values if you know what setting you want.  
3.  If you export Light motion, its frame, then the next 3 columns are RGB with ranges from 0 to 1 (the default 154 settings have a value of 0.602), and the remaining 3 columns are XYZ coordinates.
4.  Shadow does not work however.
5.  As usual, for all these other types of exported motion, there are some zeroes after the very last row.  Dont touch them.

REMOVING REDUNDANT FRAMES 12:42
1.  If you plan to use the facial data in MikuMikuDance instead of MikuMikuMoving, there is a 20000 facials limit, so you need to bring down your facial frames count.
2.  Easiest thing to do is to sort them out first.  Select ALL the useful frames, then go to Home> Sort&Filter>Custom Sort.  Sort by Column (choose ColumnA), Values, A to Z.  This will sort the data according to the facial name.  Dont worry, the ones on the right are sorted as well.
3.  The facials with absolutely zero values are easy to spot, so just delete the entire row.  However, make sure that there are two zeroes, one at the start and one at the end to keep the value as zero for the values in between those two frames.

REMOVING INTERMEDIATE FRAMES 14:37
1.  In order to remove the bulk of intermediate motions, we need to identify the peaks and valleys (maximum//minimum points in maths terms).  In order to identify these points, i use excel formulas.
2.  I use the function =IF(B7>B6, 1, 0) on a new column, and =IF(B7>B8, 1, 0) on another.  Then use a third column to add together the values on those two columns.  Any row with a maximum point will have a value of 2, and any row with a minimum value will have a value of 0.  Every other row will have a value of 1, which i recommend should be deleted.
3.  To retain the values, select those two rows, copy, and onto the same location (or top left hand side of your selected values), right click and 'paste special'.  Select 'values'.  This will re-paste the data as a value, rather than the formula used (the values will be changed if the position of the rows change).
4.  Use custom sort, sort by the column with 0s, 1s and 2s.  Then delete all the values with a value of 1.
Notes: this doesnt quite work on sound which has an alternating high/low (sinusoidal) pattern.  But if you encounter this, you can easily delete unwanted facial frames in MMD or MMM since you cleaned out most of the rest.

PREPARATION BEFORE REEXPORTING TO VMD 22:45
1.  Once youre done with your operations, delete any columns which you used for fancy maths operations.
2.  Count how many effective rows there are and change the value of the 'number of effective rows' value to the right amount.

REEXPORT TO VMD 22:58
1.  Save your .csv file.
2.  Make sure the folder you have your .csv file in does not have a .vmd file with the same name as it.  This usually happens because VMD> CSV in that folder, so your CSV>VMD will also generate the file in the same folder.  You'll either run into an overwrite error, or it wont work at all.  Rename your original motion just to keep it safe.  Just not the exact same name as the .csv file.
3.  Drag and drop the .csv file over vmdconverter.exe.
4.  Your new motion is created in the same folder.
5.  Drag and drop your motion onto a new model.  It should work. [note, if you failed to reduce the number of facials to below 20,000 points, it will still only register a maximum of 20,000 points]

EXTRA TWEAKING IN MMD/MMM 25:37
1.  Now that you can see your motion data, you can simply delete the remaining facials you dont need, and add facials you do need.
2.  Remember that for MMD, you have a 20000 facial points limit, which also needs to be shared with the other facials, so if you didnt reduce it below 20000, you will encounter an error saying 'unable to regist more than 20000 facial frames' and it will only load up to 20000 facial points.  For MikuMikuMoving, you can safely get 60,000 facial points.
3. Do note that you need to delete points which correspond to unintended loud sounds, breathing, nose sneezing, etc etc.

SUPER LONG AUDIO FILES
1.  To get lipsync for super long tracks (like the entire lipsync tutorial), split your audio track to several parts, and then perform a lipsync for every part.
2.  After you cleaned up everything, make sure you change the frame time so that the bones appear exactly when they should.
3.  You can then copy and paste the cleaned up data into a single .csv file and then convert after you calculate the number of effective rows.
4.  I managed to reduce approximately 240,000 points down to 50,861 points for the lipsync of the lipsync tutorial.

ADDITIONAL TIPS
1.  The audio works best when the peaks between the loud and soft parts of the video are more or less in the same range.  This may affect the output if say, there are very loud bursts of sound halfway through.  To suppress the problem, use 'Volume Leveling' in your audio editor, and then adjust the decibel volume of the track.  For this purpose, i usually use MediaMonkey to do my volume levelling, but they only work on mp3 files.  So i usually combine it with Super in order to get audio files that i do want.

2.  If you want to use this to transcribe english, i suggest using the following conversions so that the lip movements will roughly match english pronunciation.
a -> e え
e -> i い
i -> a あ
o -> o お
u -> u う


Potential follow up tutorials
- Cleaning out extremely long audio tracks ~30 mins
- how to use VMDconverter on bones
- How to use mathematics to control bones in excel
Related content
Comments: 305

AnimeZombie21Art In reply to ??? [2018-12-15 03:10:55 +0000 UTC]

Me either, I'm going to see if my brother in law would be so kind and to help me. If he can figure it out I'll share it or I'll give you my e-mail address so you can send me what you have and I can convert it for people..... but as of right now, I'm stuck and kinda frustrated.
I tried that Lips and Face program and it was 4 hours of a waist of my time. So this is my only hope. I can kinda get it to work but I got the "gittery" look verses the clean look with editing it through excel.

👍: 0 ⏩: 1

McChipy In reply to AnimeZombie21Art [2018-12-15 16:35:09 +0000 UTC]

i believe i found out how to fix it??


like, i checked the order from the first import to excel and how we tried to save it, and if we make the order from the colums to sort by colum B values Low to high


also, check the finished .csv file in notepad, if the , are ; (like it was for me)

also check if the 0. 000 numbers are separated by a dot, instead of a ;, then you can change the ; to , without messing shit up, like how i tried to fix it


when saving in notepad, MAKE SURE TO SAVE IT AS ANSI
when i was saving it in Unicode (which doesnt fuck up the japanese i guess) IT WOULDNT CONVERT


last thing, when you try out the motiona nd the facials begin to go giant, check back to notepad and see if some of the 0.000 numbers begin with a number higher than 0. (like 7.000 or 1.000) and change them


this

should be fine now



i hope this is somewhat understandable??

👍: 0 ⏩: 1

AnimeZombie21Art In reply to McChipy [2018-12-15 22:23:19 +0000 UTC]

I printed this out and I'm going to do  my best to try to make this work. I think I understand it. LoL 
Man I sure hope this works.

👍: 0 ⏩: 1

McChipy In reply to AnimeZombie21Art [2018-12-15 22:57:45 +0000 UTC]

printed??

👍: 0 ⏩: 2

AnimeZombie21Art In reply to McChipy [2018-12-16 02:14:33 +0000 UTC]

I apologize, when I save it like how you had me do it, it still saves as question marks.
If I could get it to what you h ad it that would be nice, But I can't get the files to save without the "?" getting in the way.

So instead of ; or , or Japanese Symbols I have ?

👍: 0 ⏩: 1

McChipy In reply to AnimeZombie21Art [2018-12-16 02:40:31 +0000 UTC]

set your computers region to japan


if you already did that, set your excel's region to japan as well (like shown?)


did you try that or nah?


👍: 0 ⏩: 1

AnimeZombie21Art In reply to McChipy [2018-12-17 00:20:48 +0000 UTC]

I LOVE YOU! If you were right next to me now I'd hug and kiss you!!!! Gosh THANK YOU for all your hard work and kindness to helping me out. It worked. It finally worked. Thank you. I honestly can't say that enough because nothing I did before has worked and no one was helping me. You went above and beyond for me. Thank you!!!!! 

👍: 0 ⏩: 1

McChipy In reply to AnimeZombie21Art [2018-12-17 08:48:07 +0000 UTC]

OwO) /
Glad I could help!

Which one was it that fixed your issue?

👍: 0 ⏩: 1

AnimeZombie21Art In reply to McChipy [2018-12-19 22:51:40 +0000 UTC]

the way you saved it to a CSV file. So I remembered that OpenOffice can do that cause my computer for some reason doesn't like notepad.... So I did the main work in Excel and did the final save in openOffice and BAM. I'm hoping to make a better tutorial one that can show people alternative ways to get it to work.

👍: 0 ⏩: 1

McChipy In reply to AnimeZombie21Art [2018-12-20 08:34:57 +0000 UTC]

Oki- OwO)/

👍: 0 ⏩: 0

AnimeZombie21Art In reply to McChipy [2018-12-16 00:20:32 +0000 UTC]

Oh yea, I print all the steps so I don't have to keep going back and forth on the computer and accidentally miss something. 

👍: 0 ⏩: 0

Ray401 [2016-05-04 10:10:45 +0000 UTC]

I sent you a note with my issue but havent received an answer. Please confirm

👍: 0 ⏩: 0

Ray401 [2016-04-26 13:43:36 +0000 UTC]

I got as far as VMD and it requires a password. Please help

👍: 0 ⏩: 0

binkybeau23 [2016-04-21 02:23:06 +0000 UTC]

Hey uh.... where does it say lipsyncloid?

👍: 0 ⏩: 0

DHzmulMallo In reply to ??? [2016-04-12 09:44:00 +0000 UTC]

Please Link The Lipsyncing v0.1.0 Not v0.2.0 PLS

👍: 0 ⏩: 0

HalofanODST In reply to ??? [2016-03-14 02:20:58 +0000 UTC]

Despite unblocking the RAR files, my PC still doesn't allow me to load the Lipsyncloid_v020.dll
Downloaded it 3 times with no absolute success.

👍: 0 ⏩: 1

animaniac72 In reply to HalofanODST [2016-03-18 03:10:37 +0000 UTC]

You may need to log into Windows as the computer administrator to unblock the file.

👍: 0 ⏩: 1

HalofanODST In reply to animaniac72 [2016-03-18 09:01:21 +0000 UTC]

Nevermind.
It is exclusive to 64bits MMM.
My computer doesn't support it.
Thanks anyway.

👍: 0 ⏩: 0

sefulretelei In reply to ??? [2016-02-01 20:05:38 +0000 UTC]

THANKS !!!

👍: 0 ⏩: 0

Mata-no-Ji In reply to ??? [2016-01-22 16:51:38 +0000 UTC]

Ty for this. I'll be back.

👍: 0 ⏩: 0

Tallerin In reply to ??? [2016-01-06 00:00:32 +0000 UTC]

Well done. I'm on Win 10 here and followed the first half and it worked fine, BUT when i got to the excel it was very tedious removing 20,000 frames LoL to be so excited I was done. So I thought I hit save as .csv it saved everything saved BUT all the japanese characters were stripped from it and turned into qustion marks ???? no lie. some else here had the same issue but no clue how they fixed it as I went to ther youtube channel as they mentioned doing a tutorial about fixing it and nothing. The last 4 days pulling my hair out I found the fix for save as .csv in excel and keeping the file integrity and the japanese symbols. its the same for other windows OS to that are not set to Japanese(Japan) language for non unicode programs. goto control panel ---->click on Clock, Language, and Region ----> click on Region ------> click on Administrative -------> Click on the bar that says Change system local (in the Box labled Language for non-Unicode programs) select Japanese(Japan) and reboot. Walla now you can edit the .csv when your done save it and convert it back to a .vmd and load it up and it will work. The japanese will not be converted to ?'s therefore not working when you load the .vmd that was converted with the ?'s.

Thanks abunch for this tutorial now back to the pain staking .csv editing again. getting real familiar with excel and the formulas, ironicly I have never really messed with it till now LoL

👍: 0 ⏩: 1

animaniac72 In reply to Tallerin [2016-03-18 03:14:02 +0000 UTC]

THANK YOU!!!!!!!!!!!!!!
You are the man (or woman)!

👍: 0 ⏩: 0

MarleneMD In reply to ??? [2015-11-27 17:16:36 +0000 UTC]

I cant convert cvs to vmd with the graphicalvmd converter, please help

👍: 0 ⏩: 0

XxArlisBloxer05xX [2015-11-25 01:32:53 +0000 UTC]

y'know what? Fuck this.

This thing is outdated and uses things we cant install on new systems. so fuck you, and your broken plugin.

👍: 0 ⏩: 4

xXMMDFAITHXx In reply to XxArlisBloxer05xX [2016-01-05 00:01:45 +0000 UTC]

There's this wonderful new thing, don't know if you've heard about it, its called Google.

👍: 0 ⏩: 1

jbunny122 In reply to xXMMDFAITHXx [2016-04-10 19:39:21 +0000 UTC]

Um, excuse me? Google isn't working for me, I don't know what to search to get this 'Lipsyncloid' plugin.
(And yes, I HAVE searched "Lipsyncloid plugin".)

👍: 0 ⏩: 0

NekoZhylex In reply to XxArlisBloxer05xX [2015-12-12 21:42:07 +0000 UTC]

You could use miku miku facial. But you don't have to be mean when it doesn't work for you.

👍: 0 ⏩: 0

StekinoMai In reply to XxArlisBloxer05xX [2015-12-06 05:52:07 +0000 UTC]

Wow, aren't you mean? Just because it doesn't work for you,you don't just go cuss and shit.

How about you just let this plugin go and find another alternative like animate your own goddamn lipsync in MMD huh?

It's better than insulting.

👍: 0 ⏩: 0

MarleneMD In reply to XxArlisBloxer05xX [2015-11-27 17:17:34 +0000 UTC]

It works very well for me, so stop insulting him, asshole.

👍: 0 ⏩: 0

LaylaDeer In reply to ??? [2015-11-17 21:48:30 +0000 UTC]

okay so I went through most the comments to make sure I was not giving you a repeat question, and apparently I am the first. Now I have done all the steps, it converts back to vmd just fine, BUT when I load it into both MMM and MMD it says "This is not Vocaloid Motion Data file!" I am very confused, very upset cause I have worked sooooo hard on this only to have this happen I dont know what to do.   

👍: 0 ⏩: 0

XxArlisBloxer05xX In reply to ??? [2015-11-14 15:00:16 +0000 UTC]

um... okay. you need to provide details on how to unblock the files, because im running windows 8.1 and there is no unblock option.

👍: 0 ⏩: 0

PurpleHazeDistortion In reply to ??? [2015-11-06 13:40:52 +0000 UTC]

SOOOOOOOOOOOOOOOOOOOOO MUCH READING!!!!!!!!!!!!!!!

👍: 0 ⏩: 0

Vivamort-Valkhan In reply to ??? [2015-10-06 16:05:01 +0000 UTC]

I used this tutorial to change the lip-syncing on a motion file I downloaded to match the words to the song I used, instead of the original song the motion was made for.  It's at www.youtube.com/watch?v=xm214u…

👍: 0 ⏩: 0

Vivamort-Valkhan In reply to ??? [2015-10-04 06:44:26 +0000 UTC]

This was awesomely helpful! thank you for sharing this!

👍: 0 ⏩: 0

GinkoRo In reply to ??? [2015-09-27 19:55:21 +0000 UTC]

are there any other programms that can lipsync using wav audio data?  cuz mikumiku moving not working on windows 10

👍: 0 ⏩: 1

Vivamort-Valkhan In reply to GinkoRo [2015-10-04 06:46:38 +0000 UTC]

It works on my windows 10.

Maybe the suggestions on problem parts on the July 15 to 17 posts is what is stopping it from working for you.

👍: 0 ⏩: 0

CameronKoehler123 In reply to ??? [2015-09-26 00:42:35 +0000 UTC]

What is the password for VMDConverter? and LipSynchloid?

👍: 0 ⏩: 1

ZarWolf48 In reply to CameronKoehler123 [2015-10-02 08:00:46 +0000 UTC]

Lipsynchloid download: pakupaku
VMDConvertor: numa

👍: 0 ⏩: 3

makkapapa In reply to ZarWolf48 [2016-09-19 06:21:06 +0000 UTC]

aww thankkk youu!  

👍: 0 ⏩: 0

Ray401 In reply to ZarWolf48 [2016-05-04 10:31:59 +0000 UTC]

YOU ARE AMAZING SIR or MADAM!!!! Thankyou so much. I got up to the point of the VMD and been stuck since the end of April. You are a genius

👍: 0 ⏩: 0

CameronKoehler123 In reply to ZarWolf48 [2015-10-02 20:04:09 +0000 UTC]

Thank you!

👍: 0 ⏩: 1

ZarWolf48 In reply to CameronKoehler123 [2015-10-06 19:02:02 +0000 UTC]

np ^^

👍: 0 ⏩: 1

CameronKoehler123 In reply to ZarWolf48 [2015-10-06 19:15:46 +0000 UTC]

;D

👍: 0 ⏩: 1

ZarWolf48 In reply to CameronKoehler123 [2015-10-06 19:18:31 +0000 UTC]

x3

👍: 0 ⏩: 1

CameronKoehler123 In reply to ZarWolf48 [2015-10-06 19:19:58 +0000 UTC]

x3

👍: 0 ⏩: 0

AmyRose358 In reply to ??? [2015-09-23 03:49:37 +0000 UTC]

Need help! I'm using this as a step by step guide and when I click to open up MikuMikuMoving it doesn't load up.

👍: 0 ⏩: 0

Kasamatsu-Naora In reply to ??? [2015-09-06 01:36:27 +0000 UTC]

PLZ HELP ME!!!!

👍: 0 ⏩: 0

Kasamatsu-Naora In reply to ??? [2015-09-05 01:28:34 +0000 UTC]

when i tried to download the vmd converter it said error 404 page not found! plz help me!

👍: 0 ⏩: 1

ZarWolf48 In reply to Kasamatsu-Naora [2015-10-02 08:03:44 +0000 UTC]

bowlroll.net/file/13705 nah :3

👍: 0 ⏩: 1

MarleneMD In reply to ZarWolf48 [2015-11-11 21:12:15 +0000 UTC]

and what is the pass ? x.x

👍: 0 ⏩: 1


<= Prev | | Next =>