From 17eb6ad73330f1c56f3dfd5f35e47967b63c1f14 Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Fri, 2 Dec 2016 14:01:33 +0100 Subject: [PATCH] Test of creaky voice detector --- InitialiseSGC2.praat | 2 +- MainPage.praat | 2 +- ToneProt/SGC_ToneProt.praat | 29 ++++++++++++++++++----------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/InitialiseSGC2.praat b/InitialiseSGC2.praat index 224ea05..9cda8d4 100644 --- a/InitialiseSGC2.praat +++ b/InitialiseSGC2.praat @@ -242,7 +242,7 @@ procedure init_window sgc.recordedSound = Read from file: .outputName$ recordedSound$ = selected$("Sound") call recognizeTone - # See feedback on earl;ier recorded words + # See feedback on earlier recorded words if fileReadable("'sgc.saveAudio$'/TestSpeakGoodChinese2.txt") call write_feedback Feedback else diff --git a/MainPage.praat b/MainPage.praat index c6fe616..48c1ade 100644 --- a/MainPage.praat +++ b/MainPage.praat @@ -1069,7 +1069,7 @@ procedure write_feedback .table$ .maxHeight = 21 - 17 call adjustFontSizeOnHeight 'defaultFont$' '.currentFeedbackFontSize' '.maxHeight' .currentFeedbackFontSize = adjustFontSizeOnHeight.newFontSize - + call wipeArea 'wipeFeedbackArea$' call set_font_size '.currentFeedbackFontSize' demo '.color$' diff --git a/ToneProt/SGC_ToneProt.praat b/ToneProt/SGC_ToneProt.praat index 4b3b4f0..991e7fa 100644 --- a/ToneProt/SGC_ToneProt.praat +++ b/ToneProt/SGC_ToneProt.praat @@ -138,7 +138,7 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP # ################################################################ if index(sgc_ToneProt.pinyin$, "3") - .creakCO = 0.03 + .creakCO = 0.030 .delta = 0.0000001 # Reassign creacky voice parts # Calculate Shimmer&Jitter @@ -181,11 +181,12 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP # Create PitchTier and Voicing intervals select te.recordedPitch - .recordedPitchTier = Down to PitchTier - select te.recordedPitch .origPointProcess = To PointProcess .vuvTier = To TextGrid (vuv): 0.02, 0.01 + select te.recordedPitch + .recordedPitchTier = Down to PitchTier + # Replace creaky voice with low pitch. Low pitch floor is minimumModelFzero select .voiceTier .numIntervals = Get number of intervals: 1 @@ -208,9 +209,11 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP Add point: .start, .startValue Add point: .end, .endValue - # Interpolate or add low pitch values in between start and end times - #Add point: .start + .delta, minimumModelFzero - #Add point: .end - .delta, minimumModelFzero + # Interpolate or add low pitch values in between start and end times if the interval is long + if .end - .start > 0.050 + Add point: .start + 0.015, minimumModelFzero + Add point: .end - 0.015, minimumModelFzero + endif endif endif @@ -234,7 +237,7 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP # Remove all pitch points between start and end Remove points between: .start, .end - # Add begin and en values at start and end times + # Add begin and end values at start and end times Add point: .start, .startValue Add point: .end, .endValue @@ -245,29 +248,33 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP endif endfor + select .recordedPitchTier + Interpolate quadratically: 3, "Semitones" # Convert new Pitchtier to Pitch object (based on old Pitch object) select te.recordedPitch plus .recordedPitchTier .newPitch = To Pitch +if 0 # Move new Pitch object to old Pitch object ID select te.recordedPitch .pitchName$ = selected$("Pitch") - Remove + #Remove te.recordedPitch = .newPitch select .newPitch Rename: .pitchName$ .newPitch = 0 -pause +# REMOVE +pause # Clean up select .jitterShimmer plus .origPointProcess plus .vuvTier plus .recordedPitchTier Remove -pause +endif endif # Remove all pitch points outside a band around the upper sgc_ToneProt.register @@ -663,7 +670,7 @@ procedure createJitterShimmerContour .sound .pointProc = To PointProcess (periodic, cc): 60, 350 .dT = 0.01 - .w_half = 0.1/2 + .w_half = 0.2/2 .t = 0.0 .sampleNum = 1 while .t < .duration - .dT -- 2.11.4.GIT