UT LIN 393P - Handout #18: Annotating and scripting in Praat

Unformatted text preview:

Handout #18: Annotating and scripting in Praat(1) One way to get a measurement from Praat to a spreadsheet is by using logging. (a) You can set up a logging procedure in the Edit window by selecting Query > Logsettings. (b) You can specify what measurements you will log, and what files the loggedmeasurements will go to on your computer.(2) But an alternative method is to use scripting. (a) A script is just a sequence of commands run in Praat. (b) You can design a script to search through soundfiles for a particular markedinterval, do measurements within that interval, and log the result to a designatedfile.(3) Advantages of scripting (a) Measurement errors are reduced. (b) If you have many similar measurements to do, a script will speed up themeasurement process. (c) Measurements are perfectly replicable.A. Annotation (4) The first step in developing a measurement script is to make a TextGrid file. (a) In the Praat objects window, select the soundfile. (b) Under Annotate, select To TextGrid. (c) In the dialog box, for All tier names fill in 1, and clear the box that says Which ofthese are point tiers? This will give you one tier of annotations, named “1”. (d) Select both the soundfile and the TextGrid file in the Praat objects window byclicking on the filenames while pressing Shift. (e) Click on Edit. Now in addition to the waveform window and the spectrogramwindow, you have a yellow annotation window.(5) How to annotate (a) To mark the boundary of an interval, select the point in the spectrogram orwaveform windows and press Command + F1. (b) To label an interval, just put the cursor in the interval in the annotation window andtype the label. (c) You can change the location of a boundary just by clicking on it and dragging it toanother location.(6) Strategies of annotation (a) If you’re measuring duration, the annotation boundaries should correspond to thebeginning and ending points of whatever you are measuring. (b) If you’re measuring anything else, the annotation boundaries should correspond tosome unit (e.g. word, syllable) that contains the measurement point. (c) The labels should be short so you can type them quickly. (d) If you have more than one type of interval, each type should have a characteristiclabel. (e) If you are going to measure more than one instance of the same type of interval in agiven soundfile, the label should include a number identifying which token it is. (f) With the name of the soundfile and the label of the interval you should be able todetermine what utterance that interval belongs to and what type of interval it is.B. Scripting(7) Starting a script (a) A script is just a text file. A lot of them are available on the Web. You can copy oneof mine from our course website. Open it by going to the Praat menu and selectingOpen Praat script…. (b) Or you can start one from scratch by going to the Praat menu and selecting NewPraat Script. (8) The measurement sequence (a) At the heart of a measurement script is a sequence of measurement commands.(b) The measurements in the script f0max are the maximum f0 for the interval, and theduration from the onset of the interval to that maximum f0 point. (c) The measurement in the script duration is the duration of each annotated interval. (d) To record the text version of any measurement sequence:• Start up a new script window by selecting Praat > New Praat Script.• Under Edit, select Clear history.• In the Edit window, execute the full series of measurement commands youwant.• Back in the script window, select Edit > Paste history.(9) The for loop (a) What gives scripting its power is the ability to cycle through a series of comparablethings and do the same series of commands. (b) This is done by means of a for loop. (c) The unit that you cycle through can either by the whole soundfile or an intervalwithin a soundfile. (d) For example, you can break up your recording into utterance-size soundfiles, eachof which has one measurement interval, as in f0max. In this case every soundfilecontains just one interval of the designated sort. (e) Or you can mark off the original unedited recording soundfile into annotationintervals, as in duration. In this case, each interval is labeled with a number toindicate which token it represents. (f) To cycle through a series of files:• Specify the full path to the directory of the soundfilesdirectory$ = "/Users/scottmyers/Documents/finaldevoicing/recordings/f1/"• Create a list of the soundfilesCreate Strings as file list... list 'directory$'*.wavnumber_files = Get number of strings• Create the for loop.for i to number_files(Sequence of commands)endfor(g) To cycle through a series of intervals within one file:• Create a list of intervalsnintervals = Get number of intervals... 1• Create the for loop.for i to nintervalslabel$ = Get label of interval... 1 'i'if label$ <> ""(Sequence of commands)endif endfor(10) Logging the measurements (a) At the beginning of the script, specify the columns for the log:print filename 'tab$' f0max 'tab$' f0maxtime 'newline$' (b) Within the for loop, record the measurements for each measurement interval in theInfo window in Praat.print 'fileName2$' 'tab$' 'f0:0''tab$' 'time:0' 'newline$' (c) After the for loop,copy the contents of the Info window into a text file.fappendinfo f0.txtclearinfo(11) You run a script by opening it in the script editor window and clicking Run.(12) Using f0max (a) Put all your soundfiles and TextGrid files in one folder with nothing else in it. (b) To get the full path to that directory, follow the directions in (8d) while you executethe command in the Praat object window of selecting the appropriate file throughRead. (c) The soundfiles should be .wav files with a 5-character filename. (d) The starting point for each measurement interval should be the onset of the testsyllable or test vowel. (e) The label for the measurement interval should be


View Full Document

UT LIN 393P - Handout #18: Annotating and scripting in Praat

Download Handout #18: Annotating and scripting in Praat
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Handout #18: Annotating and scripting in Praat and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Handout #18: Annotating and scripting in Praat 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?