######################################################## # # NAME: lst2f0&check.psc # # INPUT: - list of filenames; the filenames in the list don't have an extension. # - for each item in list TextGrid and sound file. The TextGrid is segmented # in such a way that there is a interval tier on tier 1. The section of the F0 track # between the end of interval one and the start of the last interval is visualized. # # USAGE/COMMENTS: # This script carries out all the repetitive actions involved in the checking # of F0 tracks. The scripts calculates the Pitch object, plots it in the Picture # window, gives time to check and fix if need be, and then writes the (fixed) # Pitch object to a file. Batch processing using file list. # # BY: Bert Remijsen # LAST CHANGE: 23/07/2008 # ######################################################## form Make and check Pitch objects for batch comment filename of inputlist (without extension .txt): text listfile testlist2 comment list and files are located in dir: text inputdir C:\tmp\testdata2 comment output files are written to input dir. comment Minimum and maximum of range within which F0 is detected: positive left_range 60 positive right_range 350 comment Get an F0 measurement every (s): positive step 0.005 comment The section of the F0 track between the end of interval comment one and the start of the last interval is plotted to the comment Picture window. endform Read Strings from raw text file... 'inputdir$'\'listfile$'.txt end = Get number of strings for fileteller from 1 to 'end' select Strings 'listfile$' file$ = Get string... 'fileteller' echo Processing 'file$', file 'fileteller' out of a total of 'end' Read from file... 'inputdir$'\'file$'.TextGrid textgridID = selected ("TextGrid", 1) Read from file... 'inputdir$'\'file$'.aiff soundID = selected ("Sound", 1) To Pitch... 'step' 'left_range' 'right_range' pitchID = selected ("Pitch", 1) call domain Erase all Viewport... 0 12 0 8 select 'soundID' Play select 'textgridID' plus 'pitchID' Draw separately... 'label_beg_t' 'label_fin_t' 'left_range' 'right_range' yes yes yes pause ok? Erase all select 'pitchID' Write to binary file... 'inputdir$'\'file$'.Pitch select 'soundID' plus 'textgridID' plus 'pitchID' Remove endfor procedure domain select 'textgridID' nlabels = Get number of intervals... 1 label_beg_t = Get end point... 1 1 label_fin_t = Get starting point... 1 nlabels endproc