4 # Draw the correct tone tracks
7 # include ToneScript.praat
9 procedure drawToneContour drawToneContour.pinyin$ drawToneContour.register
11 if drawToneContour.pinyin$ <> ""
12 drawToneContour.pinyin$ = replace_regex$(drawToneContour.pinyin$, "^\s*(.+)\s*$", "\1", 1)
13 drawToneContour.pinyin$ = replace_regex$(drawToneContour.pinyin$, "5", "0", 0)
16 # Generate reference example
17 # Start with a range of 1 octave and a speed factor of 1
18 drawToneContour.toneRange = 1.0
19 drawToneContour.speedFactor = 1.0
20 call toneScript 'drawToneContour.pinyin$' 'drawToneContour.register' 1 1 CorrectPitch
22 drawToneContour.freqTop = 1.5 * drawToneContour.register
25 select Pitch 'drawToneContour.pinyin$'
26 demo Select outer viewport... 20 80 40 100
27 demo Axes... 0 100 0 100
30 demo Draw... 0 0 0 'drawToneContour.freqTop' 0
33 demo Draw... 0 0 0 'drawToneContour.freqTop' 0
34 demo Select outer viewport... 0 100 0 100
35 demo Axes... 0 100 0 100
38 select Pitch 'drawToneContour.pinyin$'