Rewriting process start codes to use call process<table><label> .... procedures
[sgc2.git] / ToneProt / DrawToneContour.praat
blobeaf8c210ca2ace4947dffc66011e603c4ab9a9ed
1 #! praat
4 # Draw 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 freqTop = 1.5 * .register
25 # Draw Pitch track
26 select Pitch '.pinyin$'
27 demo Select outer viewport... 20 80 40 100
28 demo Axes... 0 100 0 100
29 demo Line width... 1
30 demo Green
31 demo Draw... 0 0 0 'freqTop' 0
32 demo Line width... 3
33 demo Green
34 demo Draw... 0 0 0 'freqTop' 0
35 demo Select outer viewport... 0 100 0 100
36 demo Axes... 0 100 0 100
38 # Clean up
39 select Pitch '.pinyin$'
40 Remove