# Add speaker name between quotation marks. speaker$ = "" # Specify which directory to put the log files in. # Put path between quotation marks. (Do not include file name.) # Be sure to include trailing slash. # (Leave empty for current directory.) filepath$ = "" ################################## ### DON'T EDIT BELOW THIS LINE ### ################################## # Copyright (C) 2010 Gordon P. Hemsley # Licensed under a simplified BSD License # See LICENSE file for more details. # Prompt the user for information about the vowel form Record vowel data word Word natural Vowel_code word Vowel_name sentence Comment endform # Find out what type of file we'll need beginPause ("Select target program") comment ("What is your target program?") target = endPause ("Plotnik", "NORM", 2) # NORM supports diphthongs, if necessary if ( target == 2 ) beginPause ("Select phthong") comment ("Please select phthong") phthong = endPause ("Monophthong", "Diphthong", 1) printline 'phthong' selection_start = Get start of selection selection_end = Get end of selection selection_length = Get selection length # If a monophthong, use the mean of the full selection. # If a diphthong, use the means of the first and last quarters of the selection if ( phthong == 1 || selection_length == 0 ) f1 = Get first formant f2 = Get second formant f3 = Get third formant f1g = 0 f2g = 0 f3g = 0 # printline 'f1' 'f2' 'f3' # printline 'f1g' 'f2g' 'f3g' else selection_quarter = selection_length / 4 selection_first_quarter = selection_start + selection_quarter selection_last_quarter = selection_end - selection_quarter Select... selection_start selection_first_quarter f1 = Get first formant f2 = Get second formant f3 = Get third formant Select... selection_last_quarter selection_end f1g = Get first formant f2g = Get second formant f3g = Get third formant Select... selection_start selection_end # printline 'f1' 'f2' 'f3' # printline 'f1g' 'f2g' 'f3g' endif endif # Write to the file if ( target == 1 ) filename$ = filepath$ + speaker$ + ".plt" if !fileReadable (filename$) fileappend 'filename$' 'speaker$''newline$'500'newline$' endif fileappend 'filename$' 'f1:0','f2:0','f3:0','Vowel_code',1,'Word$' -- 'Comment$' 'selection_start:4' 'selection_start:4' 'newline$' elsif ( target == 2 ) filename$ = filepath$ + speaker$ + ".tsv" if !fileReadable (filename$) fileappend 'filename$' Speaker'tab$'Vowel'tab$'Word'tab$'F1'tab$'F2'tab$'F3'tab$'F1g'tab$'F2g'tab$'F3g'newline$' endif if ( f1g && f2g && f3g ) fileappend 'filename$' 'speaker$''tab$''Vowel_name$''tab$''Word$''tab$''f1:0''tab$''f2:0''tab$''f3:0''tab$''f1g:0''tab$''f2g:0''tab$''f3g:0''newline$' else fileappend 'filename$' 'speaker$''tab$''Vowel_name$''tab$''Word$''tab$''f1:0''tab$''f2:0''tab$''f3:0''tab$''tab$''tab$''newline$' endif endif