Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


soundgen (version 1.1.0)

fart: Fart

Description

While the same sounds can be created with soundgen(), this dedicated facetious function produces the same effect more efficiently and with very few control parameters. With default settings, execution time is ~ 10 ms per second of audio sampled at 16000 Hz. Principle: creates separate glottal cycles with harmonics, but no formants. See soundgen for more details.

Usage

fart(glottisAnchors = c(350, 700), pitchAnchors = 75, temperature = 0.25,
  sylLen = 600, rolloff = -20, samplingRate = 16000, play = FALSE,
  plot = FALSE)

Arguments

glottisAnchors

anchors for specifying the proportion of a glottal cycle with closed glottis, long as open phase); numeric vector or dataframe specifying time and value

pitchAnchors

a numeric vector of f0 values in Hz (assuming equal time steps) or a dataframe specifying the time (ms or 0 to 1) and value (Hz) of each anchor. These anchors are used to create a smooth contour of fundamental frequency f0 (pitch) within one syllable (see Examples)

temperature

hyperparameter for regulating the amount of stochasticity in sound generation

sylLen

average duration of each syllable, ms

rolloff

basic rolloff at a constant rate of rolloff db/octave (exponential decay). See getRolloff for more details

samplingRate

sampling frequency, Hz

play

if TRUE, plays the synthesized sound. In case of errors, try setting another default player for play

plot

if TRUE, plots the waveform

Value

Returns a normalized waveform.

Examples

Run this code
# NOT RUN {
f = fart()
# playme(f)
# }

Run the code above in your browser using DataLab