Function for overlaying pitch contour on another plot frame, viz. the
waveform or spectrogram. Instead of using this function directly, just use
praatpicture('my_sound_file')
with pitch_plotOnSpec
or pitch_plotOnWave
set to TRUE
.
pitch_overlay(
pt,
bottomRange,
topRange,
start,
org_start = 0,
tfrom0 = TRUE,
freqRange = NULL,
plotType = "draw",
scale = "hz",
color = "black",
ind = NULL,
drawSize = 1,
speckleSize = 1,
axisLabel = NULL,
min_max_only = TRUE,
highlight = NULL,
intensity_overlay = FALSE
)
No return values, called internally by praatpicture and sibling functions.
PitchTier object loaded using rPraat::pt.read or other object
formatted in a similar way, i.e. a list
object containing the elements
t
(a vector of time values) and f
(a vector of frequency values) of
identical length.
Bottom y-axis range of the plot frame that pitch is plotted on.
Top y-axis range of the plot frame that pitch is plotted on.
Start time (in seconds) of desired plotted area.
Start time (in seconds) of desired plotted area in the original sound file.
Logical; should time on the x-axis run from 0 or from the
original time? Default is TRUE
.
Vector of two integers giving the frequency range to be
used for producing pitch plots. Default is NULL
, in which case the pitch
range is automatically reset to c(-12,30)
for the semitones
scale,
c(0,10)
for the erb
scale, and c(50,500)
for the Hz-based scales,
following Praat defaults.
String giving the type of pitch plot to produce; default
is draw
(a line plot), the only other option is speckle
(a point plot).
Alternatively a vector c('draw','speckle')
can be passed, in which case
both are used.
String giving the frequency scale to use when producing
pitch plots. Default is hz
; other options are logarithmic
(also in Hz),
semitones
, erb
, and mel
.
String giving the name of the color to be used for
plotting pitch. Default is 'black'
.
Integer indexing current plot frame relative to other plot
components. Default is NULL
.
Number indicating the line width if
plotType
is 'draw'
. Default is 1
. Controls the lwd
argument of
graphics::lines.
Number indicating the point size of if _plotType
is
'speckle'
. Default is 1
. Controls the cex
arguments of
graphics::points.
String giving the name of the label to print along the
y-axis when printing a pitch track. Default is NULL
, in which case the
axis label will depend on the scale.
Logical; should only minimum and maximum values be given
on the y-axis? Default is TRUE
. Can also be a logical vector if some but
not all plot components should have minimum and maximum values on the y-axis.
Ignored for TextGrid component.
Named list giving parameters for differential
highlighting of pitch based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the start
and end
arguments which must be numbers or numeric
vectors, or using the tier
and label
arguments to highlight based on
information in a plotted TextGrid. Further contains the optional arguments
color
(string or vector of strings, see color
),
drawSize
or speckleSize
(both numeric), and background
(a string specifying a background color).
Logical; is intensity also overlaid on the same
plot frame? Default is FALSE
.
# Don't use directly
datapath <- system.file('extdata', package='praatpicture')
soundFile <- paste0(datapath, '/1.wav')
praatpicture(soundFile, frames = 'spectrogram', pitch_plotOnSpec = TRUE)
Run the code above in your browser using DataLab