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
61 sgc.currentWordlist = -1
74 sgc.failedAttempts = 0
76 config.deleteWordlist = -1
77 config.displayNumbers = 1
78 config.displayPinyin = 1
79 config.displayChar = 0
80 config.displayTrans = 1
81 config.useSoundExample = 1
82 config.synthesis$ = "_DISABLED_"
83 config.input$ = "Microphone"
84 config.showBackground = 1
85 sgc2.noiseThresshold = -30
90 config.clearSummary = 0
91 config.audioName$ = ""
94 mainPage.saveAudio$ = ""
97 sgc_ToneProt.minimumPitch = 40
98 sgc_ToneProt.maximumPitch = 600
100 # Platform dependent settings
101 if macintosh or windows
102 config.displayChar = 1
103 config.displayNumbers = 0
105 if windows and endsWith(build_SHA$, " XP")
106 config.displayChar = 0
107 config.displayNumbers = 0
110 config.displayChar = 0
111 config.displayNumbers = 1
115 samplingFrequency = 44100
117 samplingFrequency = 44100
119 samplingFrequency = 44100
124 config.language$ = "EN"
125 config.register = 249
126 preferencesAppFile$ = preferencesAppDir$+"/sgc2rc.txt"
127 preferencesLogDir$ = "'preferencesAppDir$'/log"
128 preferencesTableDir$ = "'preferencesAppDir$'/Data"
129 sgc2wordlists$ = "'preferencesAppDir$'/wordlists"
130 localWordlistDir$ = sgc2wordlists$
132 # Global word lists must be installed BY THE ADMINISTRATOR
133 # This means, create the directory 'globalwordlists$' and
134 # fill it with wordlist directories containing wordlist.Table
135 # and audio files. They can be copied from a local directory.
136 globalwordlists$ = ""
137 globaltablelists$ = ""
140 globalwordlists$ = "/etc/'sgc2.demoAppName$'/wordlists"
141 globaltablelists$ = "/etc/'sgc2.demoAppName$'/Data"
142 globalTTSdir$ = "/etc/'sgc2.demoAppName$'/TTS"
144 globalwordlists$ = "/Library/Preferences/'sgc2.demoAppName$'/wordlists"
145 globaltablelists$ = "/Library/Preferences/'sgc2.demoAppName$'/Data"
146 globalTTSdir$ = "/Library/Preferences/'sgc2.demoAppName$'/TTS"
148 globalwordlists$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/wordlists"
149 globaltablelists$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/Data"
150 globalTTSdir$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/TTS"
152 sgc2.synthesizer = -1
153 # Define a Praat TTS command that will set sgc2.synthesizer
154 sgc2.normalTTScommand$ = "call create_default_TTS Mandarin f4 10000 0.01 50 100 95 no IPA"
155 sgc2.advancedTTScommand$ = "call create_default_TTS Mandarin f4 10000 0.01 50 70 125 no IPA"
156 sgc.alignedTextGrid = -1
158 ##############################################################
160 config.shuffleLists = 1
161 config.adaptiveLists = 0
163 defaultFont$ = "Helvetica"
166 # Set up directories if they do not exist already
167 call set_up_directories
169 # Get saved preferences
170 call read_preferences ""
173 speakCommandDir$ = "'preferencesAppDir$'/TTS"
174 speakCommandFile$ = ""
176 sgc.recordCommandFile$ = ""
177 sgc.playCommandFile$ = ""
179 sgc.scratchAudioDir$ = "'preferencesAppDir$'\audio\"
181 sgc.scratchAudioDir$ = "/tmp/SpeakGoodChinese/"
183 sgc.useAlternativeRecorder = 0
185 sgc.useAlternativePlayer = 0
188 # Set inital language
189 call set_language 'config.language$'
192 call load_word_list "'localWordlistDir$'" 0
194 # Set up evaluation table
195 initialiseSGC2.toneevaluation_table$ = ""
196 call initialize_toneevaluation_tables
201 ###############################################################
203 # Obligatory procedures
205 ###############################################################
206 # Initialize Demo Window
207 procedure init_window
209 demo Line width... 'defaultLineWidth'
211 call set_font_size 'defaultFontSize'
214 # If there is no recorded sound, try to read stored recording
215 if recordedSound$ = "" and sgc.saveAudio$ <> ""
217 select sgc.currentWordlist
218 if sgc.currentWord > 0 and sgc.currentWord <= sgc.numberOfWords
219 call readPinyin 'sgc.currentWord'
220 sgc.pinyin$ = readPinyin.pinyin$
221 .outputName$ = "'sgc.saveAudio$'/'sgc.pinyin$'.wav"
222 if fileReadable(.outputName$)
223 sgc.recordedSound = Read from file: .outputName$
224 recordedSound$ = selected$("Sound")
226 # See feedback on earl;ier recorded words
227 if fileReadable("'sgc.saveAudio$'/TestSpeakGoodChinese2.txt")
228 call write_feedback Feedback
230 select Table Feedback
233 # Set config.audioName
234 .tmp$ = replace_regex$(sgc.saveAudio$, "[^/\\]+[/\\]?$", "", 0)
235 config.audioName$ = replace$(sgc.saveAudio$, .tmp$, "", 0)
241 # Set mainPage.saveAudio$ grade
242 call set_grade_display 'sgc.pinyin$'
246 .windowTitle$ = replace$(wordlistName$, "_", " ", 0)
247 call set_window_title 'buttons$' '.windowTitle$'
248 # Display the word-list
250 # Wipe screen and draw background
251 call wipeArea 'wipeContourArea$'
252 if config.showBackground
253 call draw_background Background
255 # Define buttons in a table
261 call draw_tone_contour
263 call paint_saveAudio_light
266 sgc.failedAttempts = 0
269 # Make sure all Preferences directories are available
270 procedure set_up_directories
271 .dirPath$ = "'preferencesAppDir$'"
272 createDirectory(.dirPath$)
273 .dirPath$ > '.dirPath$'/directory.txt
274 createDirectory("'.dirPath$'/wordlists")
275 .dirPath$ > '.dirPath$'/wordlists/directory.txt
276 createDirectory("'.dirPath$'/pitchmodels")
277 .dirPath$ > '.dirPath$'/pitchmodels/directory.txt
278 createDirectory("'.dirPath$'/log")
279 .dirPath$ > '.dirPath$'/log/directory.txt
280 createDirectory("'.dirPath$'/TTS")
281 .dirPath$ > '.dirPath$'/TTS/directory.txt
285 # Retrieve and store setting between sessions
287 procedure read_preferences .preferencesFile$
288 if not fileReadable(.preferencesFile$)
289 .preferencesFile$ = preferencesAppFile$
291 if fileReadable(.preferencesFile$)
292 Read from file... 'preferencesAppFile$'
293 .preferenceTable$ = selected$("Table")
294 .numPrefKeys = Get number of rows
295 for .row to .numPrefKeys
296 .variableName$ = Get value... '.row' Key
297 if variableExists(.variableName$)
298 .variableValue = Get value... '.row' Value
299 if .variableValue <> undefined
300 '.variableName$' = '.variableValue'
302 elsif variableExists(.variableName$+"$")
303 .variableValue$ = Get value... '.row' Value
304 .variableName$ = .variableName$+"$"
305 '.variableName$' = "'.variableValue$'"
309 select Table '.preferenceTable$'
314 procedure write_preferences .preferencesFile$
315 Create Table with column names... Preferences 0 Key Value
316 if index_regex(.preferencesFile$, "[a-zA-Z0-9]") <= 0
317 .preferencesFile$ = preferencesAppFile$
321 for .tableNum from 1 to 2
327 .varPrefix$ = replace_regex$(.table$, "^(.)", "\l\1", 0)
329 select Table '.table$'
330 .numTableRows = Get number of rows
331 for .tablerow to .numTableRows
332 select Table '.table$'
333 .label$ = Get value... '.tablerow' Label
334 .variableName$ = .varPrefix$+"."+(replace_regex$(.label$, "^(.)", "\l\1", 0))
335 .keyName$ = .variableName$
337 if sgc.nonPreferences$ <> "" and index(sgc.nonPreferences$, " '.variableName$' ")
339 elsif variableExists(.variableName$)
340 .value = '.variableName$'
342 elsif variableExists(.variableName$ + "$")
343 .variableName$ = .variableName$ + "$"
344 .value$ = '.variableName$'
345 elsif index(.variableName$, "_") > 0
346 .variableName$ = left$(.variableName$, rindex(.variableName$, "_") - 1)
347 .keyName$ = .variableName$
348 select Table Preferences
349 .prefRow = Search column... Key '.keyName$'
351 if variableExists(.variableName$)
352 .value = '.variableName$'
354 elsif variableExists(.variableName$ + "$")
355 .variableName$ = .variableName$ + "$"
356 .value$ = '.variableName$'
362 select Table Preferences
365 Set string value... '.row' Key '.keyName$'
366 Set string value... '.row' Value '.value$'
371 # Some extra settings
372 select Table Preferences
375 Set string value... '.row' Key wordlistDir
376 Set string value... '.row' Value 'localWordlistDir$'
378 select Table Preferences
381 Set string value... '.row' Key wordlistName
382 Set string value... '.row' Value 'wordlistName$'
384 select Table Preferences
385 Write to table file... '.preferencesFile$'
390 ###############################################################
392 # TTS (speech synthesis). Place commands in user info
395 # speakCommandDir$ = "'preferencesAppDir$'/TTS"
396 # speakCommandFile$ = ""
398 # Make sure sgc2.synthesizer is set!
399 procedure create_default_TTS .language$ .voice$ .samplefreq .gap .pitch_adj .pitch_range .words_per_minute .use_data$ .espeak_phones$
400 sgc2.synthesizer = Create SpeechSynthesizer... '.language$' '.voice$'
401 Set speech output settings... .samplefreq .gap .pitch_adj .pitch_range .words_per_minute '.use_data$' '.espeak_phones$'
405 if sgc2.synthesizer > 0
406 select sgc2.synthesizer
408 sgc2.synthesizer = -1
410 # Note, the TTScommand must set sgc2.synthesizer!
411 if config.strict$ = "'sgc.highestLevel'"
412 'sgc2.advancedTTScommand$'
414 'sgc2.normalTTScommand$'
418 .ttscommand$ = "speak"
422 .ttscommand$ = "espeak"
426 .ttscommand$ = "C:/Program Files/eSpeak/command_line/espeak.exe"
430 # Global TTS command has precedence
431 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_command.txt")
432 speakCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_command.txt"
433 if config.synthesis$ = "_DISABLED_"
435 config.synthesis$ = "eSpeak"
439 # Local TTS command, if there is no global one
440 # Command does not exist yet, create it if eSpeak is installed
441 # Make sure to quote the path!
442 if speakCommandFile$ = ""
443 # Autodetect synthesizer command
444 # if not fileReadable("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
445 # .command_path$ = ""
447 # system_nocheck PATH=${PATH}:/opt/local/bin; bash -c -- 'which '.ttscommand$' > "'speakCommandDir$'/command_path.txt"'
448 # .command_path$ < 'speakCommandDir$'/command_path.txt
450 # system_nocheck PATH=${PATH};bash -c -- 'which '.ttscommand$' > "'speakCommandDir$'/command_path.txt"'
451 # .command_path$ < 'speakCommandDir$'/command_path.txt
453 # if fileReadable(.ttscommand$)
454 # .command_path$ = .ttscommand$
457 # # Remove any newlines
458 # .command_path$ = replace$(.command_path$, "'newline$'", "", 0)
460 # # Command path found
461 # if sgc2.synthesizer <= 0 and .command_path$ <> "" and fileReadable(.command_path$)
462 # deleteFile("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
463 # fileappend "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
464 # ...'.quote$''.ttscommand$''.quote$' -v zh+f4 -s 100 'newline$'
465 # speakCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
468 # if fileReadable("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
469 speakCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
471 deleteFile("'speakCommandDir$'/command_path.txt")
474 # Close off (other TTS maybe a later option)
475 if sgc2.synthesizer > 0 or (speakCommandFile$ <> "" and fileReadable(speakCommandFile$))
476 config.synthesis$ = "eSpeak"
480 # Alternative audio recorder
481 procedure set_up_recorder
492 # Global TTS command has precedence
493 sgc.useAlternativeRecorder = 0
494 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_record_command.txt")
495 createDirectory(sgc.scratchAudioDir$)
496 sgc.recordCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_record_command.txt"
497 sgc.useAlternativeRecorder = 1
498 elsif fileReadable("'speakCommandDir$'/TTS_'.osName$'_record_command.txt")
499 createDirectory(sgc.scratchAudioDir$)
500 sgc.recordCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_record_command.txt"
501 sgc.useAlternativeRecorder = 1
505 # Alternative audio player
506 procedure set_up_player
517 # Global TTS command has precedence
518 sgc.useAlternativePlayer = 0
519 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_play_command.txt")
520 createDirectory(sgc.scratchAudioDir$)
521 sgc.playCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_play_command.txt"
522 sgc.useAlternativePlayer = 1
523 elsif fileReadable("'speakCommandDir$'/TTS_'.osName$'_play_command.txt")
524 createDirectory(sgc.scratchAudioDir$)
525 sgc.playCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_play_command.txt"
526 sgc.useAlternativePlayer = 1
530 ###############################################################
535 # initialiseSGC2.toneevaluation_table$ = ""
536 procedure initialize_toneevaluation_tables
538 if initialiseSGC2.toneevaluation_table$ != ""
539 select sgc2.performanceTable
542 initialiseSGC2.toneevaluation_table$ = ""
543 # Get the name of the table
544 call get_evaluation_table_labels 'config.language$'
545 performanceTableName$ = eval.performance$
547 if sgc.savePerf$ <> "" and fileReadable(sgc.savePerf$)
548 sgc2.performanceTable = Read Table from tab-separated file: sgc.savePerf$
549 Rename: performanceTableName$
550 # Check to make sure all columns are initialized, but only if Pinyin exists!
551 select sgc2.performanceTable
552 .column = Get column index: eval.pinyin$
554 select sgc2.performanceTable
556 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$'
558 .columnNameList$ = "'eval.correct$' 'eval.wrong$' 'eval.total$' 'eval.high$' 'eval.low$' 'eval.wide$' 'eval.narrow$' 'eval.unknown$' 'eval.commented$' 'eval.level$' 'eval.time$'"
559 while index_regex(.columnNameList$, "\S")
560 .columnNameList$ = replace_regex$(.columnNameList$, "^\s+", "", 1)
561 .columnHeader$ = extractWord$(.columnNameList$, "")
562 .columnNameList$ = replace_regex$(.columnNameList$, "^\s*'.columnHeader$'\s*", "", 1)
564 select sgc2.performanceTable
565 .column = Get column index: .columnHeader$
567 select sgc2.performanceTable
568 Append column: .columnHeader$
574 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$'
576 initialiseSGC2.toneevaluation_table$ = performanceTableName$
577 call get_toneevaluation_row 'eval.total$'
580 procedure get_toneevaluation_row .pinyin$
581 select sgc2.performanceTable
582 .row = Search column... "'eval.pinyin$'" '.pinyin$'
585 .row = Get number of rows
586 Set string value... '.row' "'eval.pinyin$'" '.pinyin$'
587 Set numeric value... '.row' 'eval.correct$' 0
588 Set numeric value... '.row' 'eval.wrong$' 0
589 Set numeric value... '.row' 'eval.total$' 0
590 Set numeric value... '.row' 'eval.high$' 0
591 Set numeric value... '.row' 'eval.low$' 0
592 Set numeric value... '.row' 'eval.wide$' 0
593 Set numeric value... '.row' 'eval.narrow$' 0
594 Set numeric value... '.row' 'eval.unknown$' 0
595 Set numeric value... '.row' 'eval.commented$' 0
596 Set numeric value... '.row' 'eval.level$' 0
597 Set numeric value... '.row' 'eval.time$' 0
598 Sort rows... 'eval.pinyin$'
599 .row = Search column... "'eval.pinyin$'" '.pinyin$'
603 procedure increment_toneevaluation_in_row .row .column$
604 select sgc2.performanceTable
605 .tmp = Get value... '.row' '.column$'
610 Set numeric value... '.row' '.column$' '.tmp'
613 Set string value: .row, eval.level$, config.strict$
617 Set string value: .row, eval.time$, .dateTime$
621 # Update existing performance file with toneevaluation
622 procedure update_toneevaluation_file
623 if sgc.savePerf$ <> "" and fileReadable(sgc.savePerf$) and initialiseSGC2.toneevaluation_table$ <> ""
624 select sgc2.performanceTable
625 Write to table file... 'sgc.savePerf$'
629 procedure increment_toneevaluation_value .pinyin$ .column$
630 call get_toneevaluation_row '.pinyin$'
631 .row = get_toneevaluation_row.row
632 call increment_toneevaluation_in_row '.row' '.column$'
634 call get_toneevaluation_row 'eval.total$'
635 .row = get_toneevaluation_row.row
636 call increment_toneevaluation_in_row '.row' '.column$'
639 procedure add_feedback_to_toneevaluation .table$
640 select Table '.table$'
641 .line1$ = Get value... 1 Text
642 .line2$ = Get value... 2 Text
643 .label$ = Get value... 3 Text
645 .label$ = "'eval.unknown$'"
648 .tones$ = replace_regex$(left$(.line1$, rindex(.line1$, ":")), "[^0-9]", "", 0)
649 .recognized$ = replace_regex$(right$(.line1$, length(.line1$)-rindex(.line1$, ":")), "[^0-9]", "", 0)
652 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.total$'
653 if .tones$ = .recognized$
654 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.correct$'
657 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.wrong$'
660 if index_regex(.label$, "(Correct|Wrong)") <= 0
661 if .label$ = "Correct"
662 .label$ = eval.correct$
664 .label$ = eval.wrong$
666 call increment_toneevaluation_value 'sgc.pinyin$' '.label$'
667 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.commented$'
671 # Update performance table when SaveAudio is on
673 call update_toneevaluation_file
677 procedure setGrade .grade$
678 select sgc.currentWordlist
679 if recordedSound$ <> "" and sgc.pinyin$ <> ""
680 call get_toneevaluation_row 'sgc.pinyin$'
681 .row = get_toneevaluation_row.row
682 select sgc2.performanceTable
683 .col = Get column index... Grade
685 Insert column... 2 Grade
688 Set numeric value: .row, "Grade", '.grade$'
689 .numRows = Get number of rows
692 for .r from 2 to .numRows
693 .tmp = Get value: .r, "Grade"
701 .meanGrade = .sumGrade / .sumN
703 Set numeric value: 1, "Grade", .meanGrade
705 # Store current performance table
706 call update_toneevaluation_file
710 # Set mainPage.saveAudio$ to Grade
711 procedure set_grade_display .pinyin$
712 mainPage.saveAudio$ = ""
713 select sgc2.performanceTable
715 .col = Get column index: "Grade"
716 if .pinyin$ <> "" and .col > 0
717 call get_toneevaluation_row '.pinyin$'
718 .row = get_toneevaluation_row.row
720 .grade$ = Get value: .row, "Grade"
721 if index_regex(.grade$, "[0-9]") <= 0
727 mainPage.saveAudio$ = .grade$
731 ###############################################################
733 # Miscelaneous procedures
735 ###############################################################
738 procedure synthesize_sound .pinyin$
740 if speakCommandFile$ <> "" and fileReadable(speakCommandFile$)
741 .command$ < 'speakCommandFile$'
742 .command$ = replace$(.command$, "'newline$'", " ", 0)
744 system_nocheck PATH=${PATH}:/usr/local/bin:/opt/local/bin; bash -rc -- ''.command$' "'.pinyin$'"'
746 system_nocheck bash -rc -- ''.command$' "'.pinyin$'"'
748 system_nocheck call '.command$' "'.pinyin$'"'
750 elsif sgc2.synthesizer > 0
751 select sgc2.synthesizer
752 Play text... '.pinyin$'
756 procedure align_recordedSound .pinyin$
757 if 0 and sgc2.synthesizer > 0 and recordedSound$ <> ""
758 select Sound 'recordedSound$'
759 .recordedTextGrid = To TextGrid... pinyin
760 Set interval text... 1 1 '.pinyin$'
761 select sgc2.synthesizer
762 plus Sound 'recordedSound$'
763 plus .recordedTextGrid
764 sgc.alignedTextGrid = nowarn noprogress To TextGrid (align,trim)... 1 1 1 -35 0.1 0.1 0.08
765 Rename... AlignedTextGrid
766 select .recordedTextGrid