# This is Joseph Tyler's script for measurements for his QRP; thanks to Susan Lin for her help. # This script takes every interval in the textgrid and returns: text, duration, f0max, f0min and span # For men: To Pitch... 0.0 75 300 # For women: To Pitch... 0.0 100 500 # To delimit in Excel, copy in and click "Text to Columns" and delimit by "|". ## This is just to make sure the right files are selected if numberOfSelected ("Sound") <> 1 or numberOfSelected ("TextGrid") <> 1 exit Please select a Sound and a TextGrid First endif sound = selected ("Sound") textgrid = selected ("TextGrid") echo Result: select sound ### This line below creates a pitch object and then assigns it the settings below (0.6 = voicing threshold, 300 is f0 max, 75 is f0 min [for men]) To Pitch (ac)... 0.0 100 15 no 0.03 0.6 0.01 0.35 0.14 500 pitch = selected ("Pitch") select textgrid # external variable for duration of preceding silence silencedur = 0 n = Get number of intervals... 1 for i to n select textgrid tekst$ = Get label of interval... 1 i if (tekst$ = "SIL2") or (tekst$ = "") t1 = Get starting point... 1 i t2 = Get end point... 1 i silencedur = 1000 * (t2-t1) last = 0 else # I can't get this next line to work label$ = Get label of interval... 1 i t1 = Get starting point... 1 i t2 = Get end point... 1 i midpoint = t1 + ((t2 - t1) / 2) duration = 1000 * (t2-t1) #PITCH select pitch f0maximum = Get maximum... t1 t2 Hertz Parabolic meanpitch = Get mean... t1 t2 Hertz # Get pitch at X% around quarter, half and threequarter points, and over all mean pitch. # First, get time points initt2 = t1 + ((t2-t1)*0.05) finalt2 = t1 + ((t2-t1)*0.95) # Second, get mean pitch values at each of the intervals initpitch = Get mean... t1 initt2 Hertz finalpitch = Get mean... finalt2 t2 Hertz print 'label$' | 'duration:0' | 'f0maximum:0' | 'meanpitch:0' | 'initpitch:0' | 'finalpitch:0' printline endif endfor select sound plus textgrid