getDiscreteContour: Discrete smooth contour from anchors

Description Usage Arguments Details Value Examples

View source: R/smoothContours.R

Description

Internal soundgen function.

Usage

1
2
3
getDiscreteContour(len, anchors = data.frame(time = c(0, 1), value = c(1, 1)),
  method = c("spline", "loess")[2], valueFloor = NULL,
  valueCeiling = NULL, ylim = NULL, plot = FALSE, ...)

Arguments

len

the number of syllables (equivalently, the length of generated contour)

anchors

a dataframe of anchors with specified time and amplitude. 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

smoothing method: 'spline' or 'loess' (default). Consider 'spline' if you have a lot of anchors and not much patience, since it is much faster than 'loess', but it may produce weird results when there are only a few anchors

valueFloor

lower/upper bounds for the contour

valueCeiling

lower/upper bounds for the contour

ylim

ylim for plotting

plot

(boolean) produce a plot?

...

other plotting options passed to plot()

Details

A discrete version of getSmoothContour with modified plotting. Intended for plotting variation in parameters across syllables.

Value

Numeric vector.

Examples

1
2
3
4
# for a bout consisting of 10 syllables
soundgen:::getDiscreteContour(len = 10, method = 'spline', plot = TRUE,
  ylab = 'Semitones', anchors = data.frame(time = c(0, .2, .6, 1),
  value = c(0, -3, 1, 0)))

tatters/soundgen_beta documentation built on May 14, 2019, 9 a.m.