libpraat.dll is not required anymore
[sgc.git] / SGC_ToneProt / HumToneContour.praat
blob7d4c851f61c47a8fc5f63d9d1e0a85aab214d82b
1 #! praat
4 # Hum the correct tone tracks
6 form Mandarin Tone contours
7     word pinyin duo1shao3
8     real register 300
9 endform
11 # Clean up input
12 if pinyin$ <> ""
13     pinyin$ = replace_regex$(pinyin$, "^\s*(.+)\s*$", "\1", 1)
14     pinyin$ = replace_regex$(pinyin$, "5", "0", 0)
15 endif
17 # Generate reference example
18 # Start with a range of 1 octave and a speed factor of 1
19 toneRange = 1.0
20 speedFactor = 1.0
21 execute ToneScript.praat 'pinyin$' 'register' 1 1 CorrectPitch
23 # Hum Pitch track
24 select Pitch 'pinyin$'
25 Hum
27 # Clean up
28 select Pitch 'pinyin$'
29 Remove