Internal soundgen function.
getDiscreteContour(
len,
anchors = data.frame(time = c(0, 1), value = c(1, 1)),
interpol = c("spline", "loess")[2],
valueFloor = NULL,
valueCeiling = NULL,
ylim = NULL,
plot = FALSE,
...
)
Numeric vector.
the number of syllables (equivalently, the length of generated contour)
a numeric vector of values or a list/dataframe with one column
(value) or two columns (time and value). achors$time
can be in ms
(with len=NULL) or in arbitrary units, eg 0 to 1 (with duration determined
by len, which must then be provided in ms). So anchors$time is assumed to
be in ms if len=NULL and relative if len is specified. anchors$value
can be on any scale.
method of interpolation between anchors: "approx" = linear
with approx
, "spline" = cubic splines with
spline
, "loess" = local polynomial regression with
loess
lowser/upper bounds for the contour
ylim for plotting
(boolean) produce a plot?
other plotting options passed to plot()
A discrete version of getSmoothContour
with modified plotting.
Intended for plotting variation in parameters across syllables.
# for a bout consisting of 10 syllables
soundgen:::getDiscreteContour(len = 10, interpol = 'spline', plot = TRUE,
ylab = 'Semitones', anchors = data.frame(time = c(0, .2, .6, 1),
value = c(0, -3, 1, 0)))
Run the code above in your browser using DataLab