Phonetics Lab Scripting

From UW Phonetics/Sociolinguistics Lab Wiki
Jump to: navigation, search

Praat Scripts

New to Praat scripting? See Amandalynne's talk on Praat scripting basics File:PraatScripting.zip , or Matt Winn's talk on more Praat Scripting File:PraatScripting2.zip.

Arpabet Vowel Analyzer (John Riebold)

A script designed to extract vowel formants, duration, timestamps, and other information from P2FA-generated TextGrids.

Arpabet Hand-Corrector (John Riebold)

Forced-aligned TextGrids must be hand-corrected before any automated measurement can be done. This script is designed to speed up the process and be customized to fit the needs of the analyst.

Get duration, pitch, formants

This script cycles through a directory of sound files and matching text grids and extracts the duration and midpoint f0, F1, and F2 of every TextGrid interval that has a label, and writes it all to a tab-delimited file. It is a modification of one of Mietta Lennes's scripts.

Get duration, pitch, formants

This script, by Stella Podgornik, is similar to the one above but is optimized for command-line interface. It extracts pitch, duration, and F1-2-3 at 20-50-80% of each labeled interval of a specified tier, writing them all to a tab-delimited text file. It can be batch-run over multiple wav/textgrid pairs residing within specified folders. It is a modification of a Mietta Lennes script.

Get duration, pitch, intensity, formants (Esther Le Grézause)

This script, originally written by Mietta Lennes and modified by Dan McCloy, cycles through a directory of sound files and matching text grids and extracts the duration and midpoint f0, F1, and F2 of every TextGrid interval that has a label, and writes it all to a tab-delimited file. It has been further modified to extract intensity and to collect matching interval labels on other tiers at the same midpoint.

Grand-analyzer (Valerie Freeman)

Measures pretty much everything in a word and/or vowel, with many user-defined input options. An ongoing work in progress.

Remeasure (John Riebold) Editor window script for measuring vowels at 20%, 50%, and 80% of vowel duration and extracting various metadata, modeled on Wassink's pnwe_get_205080.

Semi-auto formant analysis

This script by August McGrath & Dan McCloy is the formant-oriented version of the pitch extractor above. It cycles through a directory of TextGrids, finds matching sound files in a specified folder, and displays each in sequence, automatically showing a table of F1, F2, F3 values at specified time points through the interval, and prompting the user to accept the values, modify formant settings, or mark for hand-measurement. Measurements are written to a tab-delimited file.

Semi-auto pitch analysis

This reasonably well-commented script by Dan McCloy cycles through a directory of TextGrids, finds matching sound files in a specified folder, and displays each in sequence, automatically placing the cursor at the midpoint of labelled intervals and prompting the user to accept, modify, or override the pitch measurement. Measurements are written to a tab-delimited file.

File:Tier-scripts.zip (Valerie Freeman)

Quick Praat scripts for various TextGrid tier manipulations (splitting, renaming, etc.)

Vowel Analyzer (John Riebold)

A script designed to extract vowel formants, duration, timestamps, and other information from TextGrids.

More coming soon. If you don't see a script here that will meet your needs, check Mietta Lenne's page, the UCLA Praat scripts page, or the praat-tools codebase maintained by the Speech Prosody Studies Group.

Python Scripts

"Play Stimuli and Record Verbal Responses" (Dan McCloy)

This script, from Dan McCloy plays stimuli for participants and records their verbal responses. It was used for the gender and intelligibility study.

MATLAB Scripts

RMS leveler

Here is a MATLAB function for RMS levelling WAV files, written by Dan McCloy. It will either RMS level a set of files to the maximum possible level without causing clipping, or alternatively, you can pass it a target file with a desired RMS and it will match the new files to the target file. Note that it depends on another MATLAB function cell2csv.m (from the MATLAB exchange website).

genericLookup

A general-purpose lookup script for text documents. Takes an input text file of one item per line, and a lookup table of two items per line. Handy for output files that are randomized by subject, where you want to convert, e.g., stimulus numbers to actual stimulus text, while maintaining the randomization order through the conversion.

R Code

Plotting a vowel space with Unicode labels


If you already know the basics and just want to make beautiful vowel plot graphs, install the phonR package (written by Dan McCloy). There is also a brief tutorial on how to use phonR.