Internal soundgen function
drawContour(
len,
anchors,
interpol,
valueFloor,
duration_ms = 500,
loessSpan = NULL
)
the required length of the output contour. If NULL, it will be
calculated based on the maximum time value (in ms) and samplingRate
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
contour duration, ms
controls the amount of smoothing when interpolating between
anchors with loess
, so only has an effect if interpol
= 'loess' (1 = strong, 0.5 = weak smoothing)
The core part of getSmoothContour() that actually performs the interpolation between anchors.