From ab0f07c616f55048ca2f3ed836f7b3769dcbb6c9 Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Sun, 11 Dec 2016 12:14:09 +0100 Subject: [PATCH] Reworking creaky voice recognition --- ToneProt/SGC_ToneProt.praat | 4 ++-- ToneProt/ToneRecognition.praat | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ToneProt/SGC_ToneProt.praat b/ToneProt/SGC_ToneProt.praat index ea05471..e40b9d0 100644 --- a/ToneProt/SGC_ToneProt.praat +++ b/ToneProt/SGC_ToneProt.praat @@ -139,7 +139,7 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP ################################################################ toneProt.creakyThree$ = "" for .s to toneScript.syllableCount - toneProt.creakyThree$ = toneProt.creakyThree$ + "-" + toneProt.creakyThree$ = toneProt.creakyThree$ + "." endfor if index(sgc_ToneProt.pinyin$, "3") .creakCO = 0.025 @@ -181,7 +181,7 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP .distance3 = Get distance (weighted) select te.recordedPitch plus .generatedWord9 - .dtw9 = To DTW... 24 10 yes yes no restriction + .dtw9 = noprogress To DTW... 24 10 yes yes no restriction Rename... DTW'.newPinyin$' .distance9 = Get distance (weighted) diff --git a/ToneProt/ToneRecognition.praat b/ToneProt/ToneRecognition.praat index 5576e0a..947cd9e 100644 --- a/ToneProt/ToneRecognition.praat +++ b/ToneProt/ToneRecognition.praat @@ -81,8 +81,15 @@ procedure FreeToneRecognition .pinyin$ .test_word$ .exclude$ .upperRegister .fre .inFile$ = Get value... '.i' Word # Broken third tones are still third tones # Creaky voice identifies 3rd tone + .excludeWord$ = .exclude$ + if .excludeWord$ = "" and index_regex(toneProt.creakyThree$, "[^\.]") + .tmpTones$ = replace_regex$(.inFile$, "[^\d]", "", 0) + if index_regex(.tmpTones$, toneProt.creakyThree$) <= 0 + .excludeWord$ = .inFile$ + endif + endif - if (.exclude$ = "" or rindex_regex(.inFile$, .exclude$) <= 0) and rindex_regex(.inFile$, "[\d]") > 0 + if (.excludeWord$ = "" or rindex_regex(.inFile$, .excludeWord$) <= 0) and rindex_regex(.inFile$, "[\d]") > 0 referenceName$ = .inFile$ select Pitch '.inFile$' plus Pitch SourcePitch -- 2.11.4.GIT