-
Notifications
You must be signed in to change notification settings - Fork 0
/
instructions.txt
32 lines (17 loc) · 4.06 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
The analysis workflow
The Praat script collectPitchSamplesFromCorpus.praat analyzes and collects pitch data from annotated audio files (WAV/AIF file + Praat TextGrid file pairs). The R script f0distro_analysis.R contains the commands for processing and analyzing the pitch data that has been collected with the Praat script.
Please open the Praat script with a text editor before trying to run it in Praat. Read the instructions on file naming and annotation and edit the default values of the variables when necessary.
To make sure that the scripts will run properly, both the Praat script and the R script should be saved in the same directory. Under this top-level directory, four different subdirectories should be created in advance: one subdirectory containing all the original sound and TextGrid files to be analyzed (corpus/), one for the pitch objects that will be generated by the Praat script (pitch/), one for the output data files (data/), and one for the figures produced in R (fig/).
1. Using the Praat script
Before starting the Praat script, the speaker-specific parameters can optionally be typed into a text file called parms.txt, which should be saved to the corpus subdirectory. Each row in the parms.txt file should contain a speaker code, the minimum pitch in Hertz and the maximum pitch in Hertz, and these fields must be separated with tabs. If desired, it is also possible to supply the parameters for only a subset of the speakers in your corpus. In this case, the individual parameters will only be applied to the speakers in question, and the other speakers will be analyzed using the default parameters.
The script will open the existing Pitch files instead of recalculating them. So, in case you have changed the speaker-dependent analysis parameters, make sure that you either delete or move the old Pitch files away from the pitch/ directory.
The Praat script (collectPitchSamplesFromCorpus.praat) is a text file that contains the commands to be executed by the Praat program. Many of the commands are identical to the corresponding menu commands and options that are available within the graphical Praat interface. In addition to those, the full-scale scripting language in Praat allows the user to readily exploit and extend the regular functionalities without learning a general-purpose programming language (such as C++). At least in principle, Praat scripts can be run on any operating system where Praat is installed.
The Praat script can be executed in the regular Praat application, either by the Read from file… command or the Open Praat script… command. The script file will open in the script editor window in which it can also be executed by selecting Run: Run from the menu.
Alternatively, it is possible to run the Praat script in batch mode from the command line. This is possible by opening the separate praatcon application (in Windows), using the Terminal application (in MacOSX systems), or in a Linux/Unix console window. The batch mode can be both practical and more efficient for time-consuming tasks that do not require manual intervention during the execution of the script.
To run the Praat script in batch mode, first change to the directory where you saved the script and then type the following command:
praat collectPitchSamplesFromCorpus.praat
or, if using Windows,
praatcon collectPitchSamplesFromCorpus.praat
Note: With the same general idea, the acoustic analysis of a large speech corpus (including sound files and possibly their accompanying annotation files) could be completely automated using a Praat script, given that the annotation work has been performed in a suitable way. If the corpus is truly massive and requires extensive analysis, the data can be stored and analyzed on a remote cloud or supercomputing server environment.
2. Running the R code
The R code, supplied in the file f0distro_analysis.R, can be opened and run in R or RStudio. In the R script, comment lines begin with the # character. Please read the comments in order to find out which lines of code you need to run in order to analyze the pitch data and to produce the various plots.