### PitchSettingsHirst.praat # Two-pass method to set pitch analysis parameters developed by Daniel Hirst # Reference: # Hirst, D. (2011) The Analysis by Synthesis of Speech Melody: from Data to Models. # Journal of Speech Sciences 1(1): 55-83. # http://www.journalofspeechsciences.org/index.php/journalofspeechsciences/article/view/21/7 # # This is an editor script! First open a Sound or TextGrid editor, then load the script # from within the editor and run it. If you use it routinely, think of adding it to the menu. # # The last line (Advanced pitch settings...) implements some settings that proved useful # for me. These are not proposed by Daniel Hirst. Comment (insert '#' in the first column) # or delete the line to get rid of these setings. # # jm 2015-12-15 initFloor = 60 ;60 (normal) or 50 (very low male pitch) initCeil = 700 floorFac = 0.75 ceilFac = 1.5 ;1.5 (normal) or 2.5 (expressive) soundinfo$ = Sound info startTime = extractNumber (soundinfo$, "Start time:") endTime = extractNumber (soundinfo$, "End time:") selStart = Get start of selection selEnd = Get end of selection Select: startTime, endTime snd = Extract selected sound (preserve times) Select: selStart, selEnd endeditor selectObject: snd pitch = To Pitch: 0.01, initFloor, initCeil q1 = Get quantile: 0, 0, 0.25, "Hertz" q3 = Get quantile: 0, 0, 0.75, "Hertz" floor = if q1 != undefined then round (q1 * floorFac) else initFloor fi ceiling = if q3 != undefined then round (q3 * ceilFac) else initCeil fi removeObject: snd, pitch editor Pitch settings: floor, ceiling, "Hertz", "autocorrelation", "automatic" # Advanced pitch settings: floor-20, ceiling, "no", 15, 0.03, 0.55, 0.05, 0.3, 0.2