Scripts

Table of Contents
The Praat scripts shared here are first and foremost intended as a lab archive, providing script snippets we frequently use. This means they require customization for each individual new project. Use at your own risk!

Praat syntax

Over the years, Praat has had three types of syntax:

  • Extract part... 0 0.1 rectangular 1 no (Praat versions 5.3.43 and older; before April 2013)
  • do("Extract part", 0, 0.1, "rectangular", 1, "no") (between 5.3.44 and 5.3.62; April 2013 - January 2014)
  • Extract part: 0, 0.1, "rectangular, 1, "no" (5.3.63 and after; after January 2014)

Current Praat versions are compatible with older and newer syntax types, and mixes thereof. The scripts shared here primarily use the first type of syntax (…shows my age), with occasional lines using the latest type of syntax. [ADVERTISEMENT:] Did you know the syntax highlighting in PraatVSCode works with either syntax?


List of available scripts

  • Save all

    Praat can only save one object at a time for you. If you have multiple objects in your object window you’d like to save in one go, you can use this script.

  • Annotate

    This script streamlines an annotation workflow: it presents a TextGrid for manual annotation to the user, you perform some changes, and when you click Next, it automatically saves the changes and presents the next TextGrid, and so on.

  • Batch processing

    This script is an in-house template / starting point for batch processing multiple files. Adapt it to your own needs to apply a particular function to multiple files or multiple time intervals within each file.

  • Move to zero-crossings

    This script automatically moves all boundaries in a given tier in a TextGrid file to zero-crossings, which is important for extracting sound intervals. Specifically, it adds a tier ’to0x’ at the top of the TextGrid that is identical to a given input tier, except that all boundaries are at zero-crossings.

  • Manipulate ITD/IID

    This script allows you to create a ‘virtual auditory reality’ by implementing interaural time differences (ITD) and interaural intensity differences (IID) for two sounds. Thus we simulate naturalistic perception of two fully lateralized sound sources.

  • Interpolate F0 continuum

    This script creates an F0 continuum for two segmentally matching words (e.g., SUBject vs. subJECT). First, it matches the two words in duration and then interpolates the F0 contour linearly in 11 steps (steps 1 and 11 being the original contours), controlling for intensity.

  • Manipulate formants

    This script gradually shifts a formant track (here: first formant, F1) to create a phonetic continuum from high-to-low (e.g., from “bet” to “bit”). It takes a list of word pairs as input, reads the first member, and applies the formant shift while controlling for intensity and f0.

  • Transplant intensity contour

    This script takes pairs of items (e.g., bet and bit) from a directory and transplants the intensity contour of word2 onto word1. It does so by first scaling the duration of word2 to be identical to that of word1, and then transplanting the duration-scaled intensity contour onto word1.

  • Dynamic Time Warping

    This script takes pairs of items (e.g., bet and bit) from a directory and matches the duration of individual speech sounds in word1 to the duration of individual speech sounds in word2 (…a kind of simplistic Dynamic Time Warping).


Not finding what you were looking for? There are thousands of other Praat scripts available online. Some resources with particularly useful code are:

License

All scripts are shared under an MIT license.

2023, Hans Rutger Bosker