Description Usage Arguments Details Value Examples
View source: R/utilities_soundgen.R
Internal soundgen function.
1 |
ampl |
numeric vector such as a waveform |
do_fadeIn, do_fadeOut |
(logical) perform linear fade-in / fade-out? |
length_fade |
the length of affected region, in points (expects an integer > 1, otherwise just returns the original vector with no modifications) |
Applies linear fade-in and fade-out of length 'length_fade' points to one or both ends of input vector.
Returns a numeric vector of the same length as input
1 2 3 4 5 6 7 | ampl = sin(1:1000)
plot(soundgen:::fadeInOut(ampl, length_fade = 100), type = 'l')
plot(soundgen:::fadeInOut(ampl, length_fade = 300,
do_fadeOut = FALSE), type = 'l')
# if the vector is shorter than twice the specified length_fade,
# fade-in/out regions overlap
plot(soundgen:::fadeInOut(ampl, length_fade = 700), type = 'l')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.