####################################### ### DURATION extraction from TextGrid files ### Written by Kyuchul Yoon, kyoon@ling.osu.edu ### With much help from Mary Beckman ####################################### form Select a file and parameters for spectral analysis word textGridFile_(to_be_created) sh-f1-1-ipi word outputFile_(to_be_created_for_duration) segment.duration endform Read from file... 'textGridFile$'.TextGrid fricBegin = Get time of point... 1 1 aspBegin = Get time of point... 1 2 vowBegin = Get time of point... 1 3 vowEnd = Get time of point... 1 4 fricDur = (aspBegin - fricBegin) * 1000 aspDur = (vowBegin - aspBegin) * 1000 vowDur = (vowEnd - vowBegin) * 1000 #Edit #editor TextGrid 'textGridFile$' # Add interval tier... 2 duration #endeditor # Insert boundary... 2 'fricBegin' # Insert boundary... 2 'aspBegin' # Insert boundary... 2 'vowBegin' # Insert boundary... 2 'vowEnd' # Set interval text... 2 2 'fricDur:3' # Set interval text... 2 3 'aspDur:3' # Set interval text... 2 4 'vowDur:3' Write to text file... 'textGridFile$'.TextGrid Remove fileappend 'outputFile$' 'textGridFile$' 'tab$' fricDur-aspDur-vowDur 'tab$' ... 'fricDur:0' 'tab$' 'aspDur:0' 'tab$' 'vowDur:0' 'newline$' ####### END OF SCRIPT #######