4 # Intializing Praat script
6 # SpeakGoodChinese: InitializeSGC2.praat defines and sets the global variables
7 # and loads general SGC2 code
9 # Copyright (C) 2007-2010 R.J.J.H. van Son and 2010 the Netherlands Cancer Institute
10 # The SpeakGoodChinese team are:
11 # Guangqin Chen, Zhonyan Chen, Stefan de Koning, Eveline van Hagen,
12 # Rob van Son, Dennis Vierkant, David Weenink
14 # This program is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 2 of the License, or
17 # (at your option) any later version.
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write to the Free Software
26 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
29 # Do not store these variables as preferences
30 sgc.nonPreferences$ = " config.savePerf config.openPerf config.clearSummary config.audioName "
32 # Information for logging
33 currentDate$ = date$()
34 dateYear$ = right$(currentDate$, length(currentDate$) - rindex(currentDate$, " "))
35 logtimeStamp$ = replace_regex$(currentDate$, "[^a-zA-Z0-9\-_]", "-", 0)
36 currentLogDirectory$ = ""
37 feedbackTablePrefix$ = "Feedback"
38 feedbackTableName$ = ""
39 evaluationTablePrefix$ = "Evaluation"
40 evaluationTableName$ = ""
41 performanceTableName$ = "Performance"
46 yFeedback = yWordlist + 5
47 yPinyin = yFeedback + 10
48 yContour = yPinyin + 15
49 wipeContourArea$ = "demo Paint rectangle... White 20 80 'yContour' 100"
50 wipePinyinArea$ = "demo Paint rectangle... White 20 80 'yPinyin' 'yContour'"
51 wipeFeedbackArea$ = "demo Paint rectangle... White 0 100 'yFeedback' 'yPinyin'"
52 wipeWordlistArea$ = "demo Paint rectangle... White 20 80 'yWordlist' 'yFeedback'"
54 # Pop-Up window colors
55 sgc2.popUp_bordercolor$ = "{0.5,0.5,1}"
56 sgc2.popUp_backgroundcolor$ = "{0.9,0.9,1}"
58 # Initialize parameters
73 sgc.failedAttempts = 0
75 config.deleteWordlist = -1
76 config.displayNumbers = 1
77 config.displayPinyin = 1
78 config.displayChar = 0
79 config.displayTrans = 1
80 config.useSoundExample = 1
81 config.synthesis$ = "_DISABLED_"
82 config.input$ = "Microphone"
83 config.showBackground = 1
84 sgc2.noiseThresshold = -30
89 config.clearSummary = 0
90 config.audioName$ = ""
93 mainPage.saveAudio$ = ""
95 sgc_ToneProt.minimumPitch = 40
96 sgc_ToneProt.maximumPitch = 600
98 # Platform dependent settings
99 if macintosh or windows
100 config.displayChar = 1
101 config.displayNumbers = 0
103 if windows and endsWith(build_SHA$, " XP")
104 config.displayChar = 0
105 config.displayNumbers = 0
108 config.displayChar = 0
109 config.displayNumbers = 1
113 samplingFrequency = 44100
115 samplingFrequency = 44100
117 samplingFrequency = 44100
122 config.language$ = "EN"
123 config.register = 249
124 preferencesAppFile$ = preferencesAppDir$+"/sgc2rc.txt"
125 preferencesLogDir$ = "'preferencesAppDir$'/log"
126 preferencesTableDir$ = "'preferencesAppDir$'/Data"
127 sgc2wordlists$ = "'preferencesAppDir$'/wordlists"
128 localWordlistDir$ = sgc2wordlists$
130 # Global word lists must be installed BY THE ADMINISTRATOR
131 # This means, create the directory 'globalwordlists$' and
132 # fill it with wordlist directories containing wordlist.Table
133 # and audio files. They can be copied from a local directory.
134 globalwordlists$ = ""
135 globaltablelists$ = ""
138 globalwordlists$ = "/etc/'sgc2.demoAppName$'/wordlists"
139 globaltablelists$ = "/etc/'sgc2.demoAppName$'/Data"
140 globalTTSdir$ = "/etc/'sgc2.demoAppName$'/TTS"
142 globalwordlists$ = "/Library/Preferences/'sgc2.demoAppName$'/wordlists"
143 globaltablelists$ = "/Library/Preferences/'sgc2.demoAppName$'/Data"
144 globalTTSdir$ = "/Library/Preferences/'sgc2.demoAppName$'/TTS"
146 globalwordlists$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/wordlists"
147 globaltablelists$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/Data"
148 globalTTSdir$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/TTS"
150 sgc2.synthesizer = -1
151 # Define a Praat TTS command that will set sgc2.synthesizer
152 sgc2.normalTTScommand$ = "call create_default_TTS Mandarin f4 10000 0.01 50 100 95 no IPA"
153 sgc2.advancedTTScommand$ = "call create_default_TTS Mandarin f4 10000 0.01 50 70 125 no IPA"
154 sgc.alignedTextGrid = -1
156 ##############################################################
158 config.shuffleLists = 1
159 config.adaptiveLists = 0
161 defaultFont$ = "Helvetica"
164 # Set up directories if they do not exist already
165 call set_up_directories
167 # Get saved preferences
168 call read_preferences ""
171 speakCommandDir$ = "'preferencesAppDir$'/TTS"
172 speakCommandFile$ = ""
174 sgc.recordCommandFile$ = ""
175 sgc.playCommandFile$ = ""
177 sgc.scratchAudioDir$ = "'preferencesAppDir$'\audio\"
179 sgc.scratchAudioDir$ = "/tmp/SpeakGoodChinese/"
181 sgc.useAlternativeRecorder = 0
183 sgc.useAlternativePlayer = 0
186 # Set inital language
187 call set_language 'config.language$'
190 call load_word_list "'localWordlistDir$'" 0
192 # Set up evaluation table
193 initialiseSGC2.toneevaluation_table$ = ""
194 call initialize_toneevaluation_tables
199 ###############################################################
201 # Obligatory procedures
203 ###############################################################
204 # Initialize Demo Window
205 procedure init_window
207 demo Line width... 'defaultLineWidth'
209 call set_font_size 'defaultFontSize'
212 # If there is no recorded sound, try to read stored recording
213 if recordedSound$ = "" and sgc.saveAudio$ <> ""
215 select Table 'wordlist$'
216 if sgc.currentWord > 0 and sgc.currentWord <= sgc.numberOfWords
217 call readPinyin 'sgc.currentWord'
218 sgc.pinyin$ = readPinyin.pinyin$
219 .outputName$ = "'sgc.saveAudio$'/'sgc.pinyin$'.wav"
220 if fileReadable(.outputName$)
221 sgc.recordedSound = Read from file: .outputName$
222 recordedSound$ = selected$("Sound")
224 # See feedback on earl;ier recorded words
225 if fileReadable("'sgc.saveAudio$'/TestSpeakGoodChinese2.txt")
226 call write_feedback Feedback
228 select Table Feedback
231 # Set config.audioName
232 .tmp$ = replace_regex$(sgc.saveAudio$, "[^/\\]+[/\\]?$", "", 0)
233 config.audioName$ = replace$(sgc.saveAudio$, .tmp$, "", 0)
239 # Set mainPage.saveAudio$ grade
240 call set_grade_display 'sgc.pinyin$'
244 .windowTitle$ = replace$(wordlistName$, "_", " ", 0)
245 call set_window_title 'buttons$' '.windowTitle$'
246 # Display the word-list
248 # Wipe screen and draw background
249 call wipeArea 'wipeContourArea$'
250 if config.showBackground
251 call draw_background Background
253 # Define buttons in a table
259 call draw_tone_contour
261 call paint_saveAudio_light
264 sgc.failedAttempts = 0
267 # Make sure all Preferences directories are available
268 procedure set_up_directories
269 .dirPath$ = "'preferencesAppDir$'"
270 createDirectory(.dirPath$)
271 .dirPath$ > '.dirPath$'/directory.txt
272 createDirectory("'.dirPath$'/wordlists")
273 .dirPath$ > '.dirPath$'/wordlists/directory.txt
274 createDirectory("'.dirPath$'/pitchmodels")
275 .dirPath$ > '.dirPath$'/pitchmodels/directory.txt
276 createDirectory("'.dirPath$'/log")
277 .dirPath$ > '.dirPath$'/log/directory.txt
278 createDirectory("'.dirPath$'/TTS")
279 .dirPath$ > '.dirPath$'/TTS/directory.txt
283 # Retrieve and store setting between sessions
285 procedure read_preferences .preferencesFile$
286 if not fileReadable(.preferencesFile$)
287 .preferencesFile$ = preferencesAppFile$
289 if fileReadable(.preferencesFile$)
290 Read from file... 'preferencesAppFile$'
291 .preferenceTable$ = selected$("Table")
292 .numPrefKeys = Get number of rows
293 for .row to .numPrefKeys
294 .variableName$ = Get value... '.row' Key
295 if variableExists(.variableName$)
296 .variableValue = Get value... '.row' Value
297 if .variableValue <> undefined
298 '.variableName$' = '.variableValue'
300 elsif variableExists(.variableName$+"$")
301 .variableValue$ = Get value... '.row' Value
302 .variableName$ = .variableName$+"$"
303 '.variableName$' = "'.variableValue$'"
307 select Table '.preferenceTable$'
312 procedure write_preferences .preferencesFile$
313 Create Table with column names... Preferences 0 Key Value
314 if index_regex(.preferencesFile$, "[a-zA-Z0-9]") <= 0
315 .preferencesFile$ = preferencesAppFile$
319 for .tableNum from 1 to 2
325 .varPrefix$ = replace_regex$(.table$, "^(.)", "\l\1", 0)
327 select Table '.table$'
328 .numTableRows = Get number of rows
329 for .tablerow to .numTableRows
330 select Table '.table$'
331 .label$ = Get value... '.tablerow' Label
332 .variableName$ = .varPrefix$+"."+(replace_regex$(.label$, "^(.)", "\l\1", 0))
333 .keyName$ = .variableName$
335 if sgc.nonPreferences$ <> "" and index(sgc.nonPreferences$, " '.variableName$' ")
337 elsif variableExists(.variableName$)
338 .value = '.variableName$'
340 elsif variableExists(.variableName$ + "$")
341 .variableName$ = .variableName$ + "$"
342 .value$ = '.variableName$'
343 elsif index(.variableName$, "_") > 0
344 .variableName$ = left$(.variableName$, rindex(.variableName$, "_") - 1)
345 .keyName$ = .variableName$
346 select Table Preferences
347 .prefRow = Search column... Key '.keyName$'
349 if variableExists(.variableName$)
350 .value = '.variableName$'
352 elsif variableExists(.variableName$ + "$")
353 .variableName$ = .variableName$ + "$"
354 .value$ = '.variableName$'
360 select Table Preferences
363 Set string value... '.row' Key '.keyName$'
364 Set string value... '.row' Value '.value$'
369 # Some extra settings
370 select Table Preferences
373 Set string value... '.row' Key wordlistDir
374 Set string value... '.row' Value 'localWordlistDir$'
376 select Table Preferences
379 Set string value... '.row' Key wordlistName
380 Set string value... '.row' Value 'wordlistName$'
382 select Table Preferences
383 Write to table file... '.preferencesFile$'
388 ###############################################################
390 # TTS (speech synthesis). Place commands in user info
393 # speakCommandDir$ = "'preferencesAppDir$'/TTS"
394 # speakCommandFile$ = ""
396 # Make sure sgc2.synthesizer is set!
397 procedure create_default_TTS .language$ .voice$ .samplefreq .gap .pitch_adj .pitch_range .words_per_minute .use_data$ .espeak_phones$
398 sgc2.synthesizer = Create SpeechSynthesizer... '.language$' '.voice$'
399 Set speech output settings... .samplefreq .gap .pitch_adj .pitch_range .words_per_minute '.use_data$' '.espeak_phones$'
403 if sgc2.synthesizer > 0
404 select sgc2.synthesizer
406 sgc2.synthesizer = -1
408 # Note, the TTScommand must set sgc2.synthesizer!
409 if config.strict$ = "'sgc.highestLevel'"
410 'sgc2.advancedTTScommand$'
412 'sgc2.normalTTScommand$'
416 .ttscommand$ = "speak"
420 .ttscommand$ = "espeak"
424 .ttscommand$ = "C:/Program Files/eSpeak/command_line/espeak.exe"
428 # Global TTS command has precedence
429 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_command.txt")
430 speakCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_command.txt"
431 if config.synthesis$ = "_DISABLED_"
433 config.synthesis$ = "eSpeak"
437 # Local TTS command, if there is no global one
438 # Command does not exist yet, create it if eSpeak is installed
439 # Make sure to quote the path!
440 if speakCommandFile$ = ""
441 # Autodetect synthesizer command
442 # if not fileReadable("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
443 # .command_path$ = ""
445 # system_nocheck PATH=${PATH}:/opt/local/bin; bash -c -- 'which '.ttscommand$' > "'speakCommandDir$'/command_path.txt"'
446 # .command_path$ < 'speakCommandDir$'/command_path.txt
448 # system_nocheck PATH=${PATH};bash -c -- 'which '.ttscommand$' > "'speakCommandDir$'/command_path.txt"'
449 # .command_path$ < 'speakCommandDir$'/command_path.txt
451 # if fileReadable(.ttscommand$)
452 # .command_path$ = .ttscommand$
455 # # Remove any newlines
456 # .command_path$ = replace$(.command_path$, "'newline$'", "", 0)
458 # # Command path found
459 # if sgc2.synthesizer <= 0 and .command_path$ <> "" and fileReadable(.command_path$)
460 # deleteFile("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
461 # fileappend "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
462 # ...'.quote$''.ttscommand$''.quote$' -v zh+f4 -s 100 'newline$'
463 # speakCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
466 # if fileReadable("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
467 speakCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
469 deleteFile("'speakCommandDir$'/command_path.txt")
472 # Close off (other TTS maybe a later option)
473 if sgc2.synthesizer > 0 or (speakCommandFile$ <> "" and fileReadable(speakCommandFile$))
474 config.synthesis$ = "eSpeak"
478 # Alternative audio recorder
479 procedure set_up_recorder
490 # Global TTS command has precedence
491 sgc.useAlternativeRecorder = 0
492 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_record_command.txt")
493 createDirectory(sgc.scratchAudioDir$)
494 sgc.recordCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_record_command.txt"
495 sgc.useAlternativeRecorder = 1
496 elsif fileReadable("'speakCommandDir$'/TTS_'.osName$'_record_command.txt")
497 createDirectory(sgc.scratchAudioDir$)
498 sgc.recordCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_record_command.txt"
499 sgc.useAlternativeRecorder = 1
503 # Alternative audio player
504 procedure set_up_player
515 # Global TTS command has precedence
516 sgc.useAlternativePlayer = 0
517 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_play_command.txt")
518 createDirectory(sgc.scratchAudioDir$)
519 sgc.playCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_play_command.txt"
520 sgc.useAlternativePlayer = 1
521 elsif fileReadable("'speakCommandDir$'/TTS_'.osName$'_play_command.txt")
522 createDirectory(sgc.scratchAudioDir$)
523 sgc.playCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_play_command.txt"
524 sgc.useAlternativePlayer = 1
528 ###############################################################
533 # initialiseSGC2.toneevaluation_table$ = ""
534 procedure initialize_toneevaluation_tables
536 if initialiseSGC2.toneevaluation_table$ != ""
537 select sgc2.performanceTable
540 initialiseSGC2.toneevaluation_table$ = ""
541 # Get the name of the table
542 call get_evaluation_table_labels 'config.language$'
543 performanceTableName$ = eval.performance$
545 if sgc.savePerf$ <> "" and fileReadable(sgc.savePerf$)
546 sgc2.performanceTable = Read Table from tab-separated file: sgc.savePerf$
547 Rename: performanceTableName$
548 # Check to make sure all columns are initialized, but only if Pinyin exists!
549 select sgc2.performanceTable
550 .column = Get column index: eval.pinyin$
552 select sgc2.performanceTable
554 sgc2.performanceTable = Create Table with column names... "'performanceTableName$'" 0 'eval.pinyin$' 'eval.correct$' 'eval.wrong$' 'eval.total$' 'eval.high$' 'eval.low$' 'eval.wide$' 'eval.narrow$' 'eval.unknown$' 'eval.commented$' 'eval.level$' 'eval.time$'
556 .columnNameList$ = "'eval.correct$' 'eval.wrong$' 'eval.total$' 'eval.high$' 'eval.low$' 'eval.wide$' 'eval.narrow$' 'eval.unknown$' 'eval.commented$' 'eval.level$' 'eval.time$'"
557 while index_regex(.columnNameList$, "\S")
558 .columnNameList$ = replace_regex$(.columnNameList$, "^\s+", "", 1)
559 .columnHeader$ = extractWord$(.columnNameList$, "")
560 .columnNameList$ = replace_regex$(.columnNameList$, "^\s*'.columnHeader$'\s*", "", 1)
562 select sgc2.performanceTable
563 .column = Get column index: .columnHeader$
565 select sgc2.performanceTable
566 Append column: .columnHeader$
572 sgc2.performanceTable = Create Table with column names... "'performanceTableName$'" 0 'eval.pinyin$' 'eval.correct$' 'eval.wrong$' 'eval.total$' 'eval.high$' 'eval.low$' 'eval.wide$' 'eval.narrow$' 'eval.unknown$' 'eval.commented$' 'eval.level$' 'eval.time$'
574 initialiseSGC2.toneevaluation_table$ = performanceTableName$
575 call get_toneevaluation_row 'eval.total$'
578 procedure get_toneevaluation_row .pinyin$
579 select sgc2.performanceTable
580 .row = Search column... "'eval.pinyin$'" '.pinyin$'
583 .row = Get number of rows
584 Set string value... '.row' "'eval.pinyin$'" '.pinyin$'
585 Set numeric value... '.row' 'eval.correct$' 0
586 Set numeric value... '.row' 'eval.wrong$' 0
587 Set numeric value... '.row' 'eval.total$' 0
588 Set numeric value... '.row' 'eval.high$' 0
589 Set numeric value... '.row' 'eval.low$' 0
590 Set numeric value... '.row' 'eval.wide$' 0
591 Set numeric value... '.row' 'eval.narrow$' 0
592 Set numeric value... '.row' 'eval.unknown$' 0
593 Set numeric value... '.row' 'eval.commented$' 0
594 Set numeric value... '.row' 'eval.level$' 0
595 Set numeric value... '.row' 'eval.time$' 0
596 Sort rows... 'eval.pinyin$'
597 .row = Search column... "'eval.pinyin$'" '.pinyin$'
601 procedure increment_toneevaluation_in_row .row .column$
602 select sgc2.performanceTable
603 .tmp = Get value... '.row' '.column$'
608 Set numeric value... '.row' '.column$' '.tmp'
611 Set string value: .row, eval.level$, config.strict$
615 Set string value: .row, eval.time$, .dateTime$
619 # Update existing performance file with toneevaluation
620 procedure update_toneevaluation_file
621 if sgc.savePerf$ <> "" and fileReadable(sgc.savePerf$) and initialiseSGC2.toneevaluation_table$ <> ""
622 select sgc2.performanceTable
623 Write to table file... 'sgc.savePerf$'
627 procedure increment_toneevaluation_value .pinyin$ .column$
628 call get_toneevaluation_row '.pinyin$'
629 .row = get_toneevaluation_row.row
630 call increment_toneevaluation_in_row '.row' '.column$'
632 call get_toneevaluation_row 'eval.total$'
633 .row = get_toneevaluation_row.row
634 call increment_toneevaluation_in_row '.row' '.column$'
637 procedure add_feedback_to_toneevaluation .table$
638 select Table '.table$'
639 .line1$ = Get value... 1 Text
640 .line2$ = Get value... 2 Text
641 .label$ = Get value... 3 Text
643 .label$ = "'eval.unknown$'"
646 .tones$ = replace_regex$(left$(.line1$, rindex(.line1$, ":")), "[^0-9]", "", 0)
647 .recognized$ = replace_regex$(right$(.line1$, length(.line1$)-rindex(.line1$, ":")), "[^0-9]", "", 0)
650 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.total$'
651 if .tones$ = .recognized$
652 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.correct$'
655 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.wrong$'
658 if index_regex(.label$, "(Correct|Wrong)") <= 0
659 if .label$ = "Correct"
660 .label$ = eval.correct$
662 .label$ = eval.wrong$
664 call increment_toneevaluation_value 'sgc.pinyin$' '.label$'
665 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.commented$'
669 # Update performance table when SaveAudio is on
671 call update_toneevaluation_file
675 procedure setGrade .grade$
676 select Table 'wordlist$'
677 if recordedSound$ <> "" and sgc.pinyin$ <> ""
678 call get_toneevaluation_row 'sgc.pinyin$'
679 .row = get_toneevaluation_row.row
680 select sgc2.performanceTable
681 .col = Get column index... Grade
683 Insert column... 2 Grade
686 Set numeric value: .row, "Grade", '.grade$'
687 .numRows = Get number of rows
690 for .r from 2 to .numRows
691 .tmp = Get value: .r, "Grade"
699 .meanGrade = .sumGrade / .sumN
701 Set numeric value: 1, "Grade", .meanGrade
703 # Store current performance table
704 call update_toneevaluation_file
708 # Set mainPage.saveAudio$ to Grade
709 procedure set_grade_display .pinyin$
710 mainPage.saveAudio$ = ""
711 select sgc2.performanceTable
713 .col = Get column index: "Grade"
714 if .pinyin$ <> "" and .col > 0
715 call get_toneevaluation_row '.pinyin$'
716 .row = get_toneevaluation_row.row
718 .grade$ = Get value: .row, "Grade"
719 if index_regex(.grade$, "[0-9]") <= 0
725 mainPage.saveAudio$ = .grade$
729 ###############################################################
731 # Miscelaneous procedures
733 ###############################################################
736 procedure synthesize_sound .pinyin$
738 if speakCommandFile$ <> "" and fileReadable(speakCommandFile$)
739 .command$ < 'speakCommandFile$'
740 .command$ = replace$(.command$, "'newline$'", " ", 0)
742 system_nocheck PATH=${PATH}:/usr/local/bin:/opt/local/bin; bash -rc -- ''.command$' "'.pinyin$'"'
744 system_nocheck bash -rc -- ''.command$' "'.pinyin$'"'
746 system_nocheck call '.command$' "'.pinyin$'"'
748 elsif sgc2.synthesizer > 0
749 select sgc2.synthesizer
750 Play text... '.pinyin$'
754 procedure align_recordedSound .pinyin$
755 if 0 and sgc2.synthesizer > 0 and recordedSound$ <> ""
756 select Sound 'recordedSound$'
757 .recordedTextGrid = To TextGrid... pinyin
758 Set interval text... 1 1 '.pinyin$'
759 select sgc2.synthesizer
760 plus Sound 'recordedSound$'
761 plus .recordedTextGrid
762 sgc.alignedTextGrid = nowarn noprogress To TextGrid (align,trim)... 1 1 1 -35 0.1 0.1 0.08
763 Rename... AlignedTextGrid
764 select .recordedTextGrid