Commented out automatic eSpeak command setting
[sgc2.git] / ToneProt / DrawToneContour.praat
blobddcf965a0341a7153a1f6b68b36525781edcf4c7
1 #! praat
4 # Draw the correct tone tracks
6 # Needs
7 # include ToneScript.praat
9 procedure drawToneContour drawToneContour.pinyin$ drawToneContour.register
10         # Clean up input
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)
14         endif
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
24         # Draw Pitch track
25         select Pitch 'drawToneContour.pinyin$'
26         demo Select outer viewport... 20 80 40 100
27         demo Axes... 0 100 0 100
28         demo Line width... 1
29         demo Green
30         demo Draw... 0 0 0 'drawToneContour.freqTop' 0
31         demo Line width... 3
32         demo Green
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
37         # Clean up
38         select Pitch 'drawToneContour.pinyin$'
39         Remove
40 endproc