乐谱xml文件转为VOCALOID3的输入文件格式vsqx
using
代码语言:javascript
复制python3 xml2vsqx.py xmlpy_out_dir vsqx_out_dir
代码语言:javascript
复制#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "errrolyan"
# Date: 18-10-16
# Describe = "乐谱xml文件转为VOCALOID3的输入文件格式vsqx”
import os,re,sys
import os.path
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import Element
import xml.dom.minidom
def read_dic():
dictpath = "./dic/zh_CN.dict"
dic = {}
with open(dictpath,"r") as Rdic:
for i in Rdic:
list = i.split(" ")
dic[list[0]]= list[1]
return dic
def coverFiles(sourceDir, targetDir):
for files in os.listdir(targetDir):
filepath = os.path.join(targetDir,files)
os.remove(filepath)
for file in os.listdir(sourceDir):
sourceFile = os.path.join(sourceD