# This Praat script goes through WAV files in a folder and logs the Pitch tracks # CC by Pärtel Lippus, 2024 dir$ = "basewords/" tulem$ = "baseword_pitch_tracks.txt" strings = Create Strings as file list: "tmp", dir$ + "*.wav" faile = Get number of strings # write a header for the log file writeFile: tulem$, "Word", tab$, "Quantity", tab$, "segm", tab$, "time", tab$, "Pitch", newline$ for f to faile selectObject: strings wav$ = Get string: f fail$ = wav$ - ".wav" tg = Read from file: dir$ + fail$ + ".TextGrid" wav = Read from file: dir$ + wav$ pitch1 = To Pitch (filtered autocorrelation): 0, 120, 300, 15, "no", 0.03, 0.09, 0.5, 0.055, 0.35, 0.14 pitch2 = Smooth: 10 points = Get number of frames time# = List all frame times pitch# = List values in all frames: "Hertz" for p to points selectObject: tg segm = Get interval at time: 3, time# [p] appendFile: tulem$, right$(fail$, 4), tab$, left$(fail$, 2), tab$, segm, tab$, time# [p], tab$, pitch# [p], newline$ endfor #Save as text file: dir$ + fail$ + ".Pitch" selectObject: pitch2 plusObject: pitch1 plusObject: wav plusObject: tg Remove endfor