install.packages('praatpicture')
Make Praat Picture-style plots of acoustic data in R
Preface
Getting started
Many phoneticians and linguists use R for a big portion of their data processing and analysis pipeline, and increasingly also for preparing manuscripts and presentations using the RMarkdown and Quarto formats. A big advantage of these formats is the ability to generate plots on the fly using R code. A very important visualization in the phonetician’s arsenal shows one or more time-aligned signals (such as waveform, spectrogram, or pitch) together with an annotation. These are usually made in Praat. praatpicture
– named in tribute of Praat’s plotting GUI – implements this kind of visualization as a base R plot. The package provides easy and fast out-of-the-box solutions but also a high extent of flexibility.
Version 1.3.0 of praatpicture
is in the R package repository CRAN, and can be installed with the following command:
praatpicture
is being continuously updated, and the current development version can always be installed from GitHub. Bug fixes and new functionality will be introduced in the development version before they are introduced to CRAN. You can install the development version using the package devtools
like so:
::install_github('rpuggaardrode/praatpicture') devtools
You can now load the library and make a Praat Picture style-plot using a very simple praatpicture()
command pointing to the name of a sound file with the .wav
extension:
library(praatpicture)
praatpicture('ex/index.wav')
praatpicture
has many other options and functions for customizing these figures. These are covered in detail in the following chapters.
Citing praatpicture
A fair amount of time goes into making praatpicture
, so if you use it for publications, please consider citing it!
You can either cite the R package directly, or refer to this paper:
Crucial libraries and data sources
The following libraries are crucial for the functionality of praatpicture
:
av
is used to make MP4 videos with embedded audio and animationsemuR
is used for EMU-SDMS integrationgifski
is used to make GIF animationsgsignal
is used for power-to-decibel conversionipa
is used to dynamically convert SAMPA to IPAphonTools
is used to generate spectrogramsrPraat
is used to import TextGrids and derived signals calculated in Praat into Rsoundgen
is used to used for Hertz-to-ERB conversiontuneR
is used to import WAV files into Rwrassp
is used for calculating pitch, formants, and intensity on the fly
The Shiny implementation relies on the shiny
, shinyjs
, and bslib
libraries.
The data used for illustrations in this manual come from a few different sources:
- This repository with recordings in Eastern Khmu’ associated with a paper from Kirby et al. 2023
- Multichannel data in Tzotzil was shared with me by Heriberto Avelino
- Danish data was gathered by myself. You hear and see the voice of Søren Sandager Sørensen
Bug reports, suggestions, ideas
If you run into any problems using praatpicture
, I’m very happy to hear about them! Feel free to file an issue on GitHub, or reach out via e-mail.