Last active
March 4, 2020 13:19
-
-
Save mattintosh4/7341778cf3d4851e4d391c73d97613a3 to your computer and use it in GitHub Desktop.
AIきりたんラッパー (Docker版)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
set -u | |
neutrinoDir=${1} | |
shift | |
set -- -b "${1}" -s "${2}" -n "${3}" -m "${4}" -p "${5}" -f "${6}" | |
while getopts b:f:m:n:p:s: arg | |
do | |
case ${arg} in | |
b) | |
basename=${OPTARG} | |
;; | |
f) | |
formantShift=${OPTARG} | |
;; | |
m) | |
modelDir=${OPTARG} | |
;; | |
n) | |
numThreads=${OPTARG} | |
;; | |
p) | |
pitchShift=${OPTARG} | |
;; | |
s) | |
suffix=${OPTARG} | |
;; | |
esac | |
done | |
basename=${basename:-sample1} | |
numThreads=${numThreads:-0} | |
suffix=${suffix:-musicxml} | |
modelDir=${modelDir:-KIRITAN} | |
pitchShift=${pitchShift:-1.0} | |
formantShift=${formantShift:-1.0} | |
cd "${neutrinoDir}" | |
/Applications/Docker.app/Contents/Resources/bin/docker run -i --rm -v "${PWD}":/mnt neutrino /bin/bash <<! | |
cd /mnt | |
bin/musicXMLtoLabel score/musicxml/"${basename}"."${suffix}" \\ | |
score/label/full/"${basename}".lab \\ | |
score/label/mono/"${basename}".lab | |
bin/NEUTRINO score/label/full/"${basename}".lab \\ | |
score/label/timing/"${basename}".lab \\ | |
output/"${basename}".f0 \\ | |
output/"${basename}".mgc \\ | |
output/"${basename}".bap \\ | |
model/"${modelDir}"/ \\ | |
-n ${numThreads} -t | |
bin/WORLD output/"${basename}".f0 \\ | |
output/"${basename}".mgc \\ | |
output/"${basename}".bap \\ | |
-f ${pitchShift} \\ | |
-m ${formantShift} \\ | |
-o output/"${basename}"_syn.wav \\ | |
-n ${numThreads} -t | |
! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment