## the goal of this script is to measure vowel formants at the onset and half way through
## the vowel. The script does this by locating intervals on a textgrid tier labelled as
## "V". For each "V" interval, the cursor is placed at 5% into the vowel and then again at
## 50% into the vowel. At each cursor point, F1, F2, and F3 are measured. The values are exported
## to an Excel spread sheet.
clearinfo
sound$ = selected$ ("Sound")
textgrid$ = selected$ ("TextGrid")
select TextGrid 'textgrid$'
numberofintervals = Get number of intervals... 1
fileappend 'sound$'.xls Segment 'tab$' 'F1beg' 'tab$' 'F2beg' 'tab$' 'F1mid' 'tab$' 'F2mid' 'newline$'
for i = 1 to numberofintervals
intervallabel$ = Get label of interval... i
if intervallabel$ = "V"
start = Get starting point of interval... i
end = Get end point of interval... i
dur = (end - start)
beg = start + (dur*(5/100))
mid = start + (dur*(50/100))
Move cursor to... beg
Formant listing
f1beg = Get first formant
f2beg = Get second formant
f3beg = Get third formant
Move cursor to... mid
f1mid = Get first formant
f2mid = Get second formant
f3mid = Get third formant
print f1beg f2beg f3beg f1mid f2mid f3mid
resultline$ = "'intervallabels$' 'tab$' 'F1beg' 'tab$' 'F2beg' 'tab$' 'F3beg' 'tab$' 'F1mid' 'tab$' 'F2mid' 'F3mid' 'tab$' 'newline$'"
fileappend 'sound$'.xls 'resultline$'
endif
next