4 # Draw the correct tone tracks
6 form Mandarin Tone contours
13 pinyin$ = replace_regex$(pinyin$, "^\s*(.+)\s*$", "\1", 1)
14 pinyin$ = replace_regex$(pinyin$, "5", "0", 0)
17 # Generate reference example
18 # Start with a range of 1 octave and a speed factor of 1
21 execute ToneScript.praat 'pinyin$' 'register' 1 1 CorrectPitch
23 freqTop = 1.5 * register
25 Select outer viewport... 0 6 0 4
28 select Pitch 'pinyin$'
31 Draw... 0 0 0 'freqTop' 1
34 Draw... 0 0 0 'freqTop' 0
37 Text top... no 'pinyin$'
39 Write to short text file... ../PitchTiers/'pinyin$'-'register'.Pitch
42 Write to WAV file... ../PitchTiers/'pinyin$'-'register'.wav
45 select Pitch 'pinyin$'
47 Write to short text file... ../PitchTiers/'pinyin$'-'register'.PitchTier
51 select Pitch 'pinyin$'