divideIntoSyllables: Syllable structure of a bout

divideIntoSyllablesR Documentation

Syllable structure of a bout

Description

Internal soundgen function.

Usage

divideIntoSyllables(
  nSyl,
  sylLen,
  pauseLen,
  sylDur_min = 20,
  sylDur_max = 10000,
  pauseDur_min = 20,
  pauseDur_max = 1000,
  temperature = 0.025,
  invalidArgAction = c("adjust", "abort", "ignore")[1],
  plot = FALSE
)

Arguments

nSyl

the desired number of syllables

sylLen

the desired mean syllable duration, in ms (vectorized)

pauseLen

the desired mean pause between syllables, in ms (vectorized)

sylDur_min, sylDur_max

the lower and upper bounds on possible syllable duration, in ms

pauseDur_min, pauseDur_max

the lower and upper bounds on possible pause duration, in ms

temperature

a non-negative float regulating the stochasticity of syllable segmentation; 0 = no stochasticity; 1 = sd of proposals is equal to sylLen (very strong stochasticity)

invalidArgAction

what to do if an argument is invalid or outside the range in permittedValues: 'adjust' = reset to default value, 'abort' = stop execution, 'ignore' = throw a warning and continue (may crash)

plot

produce a plot of syllable structure?

Details

Stochastic generation of syllable structure of a bout. Calls rnorm_truncated to vary the duration of each new syllable and of pauses between syllables. Total bout duration will also vary, unless temperature is zero. However, the output will always contain exactly nSyl syllables.

Value

Returns a matrix with a list of start-end points for syllables

Examples

soundgen:::divideIntoSyllables (nSyl = 1, sylLen = 180)
soundgen:::divideIntoSyllables (nSyl = 5, sylLen = 180,
  pauseLen = 55, temperature = 0.2, plot = TRUE)
soundgen:::divideIntoSyllables (nSyl = 5, sylLen = 180,
  pauseLen = 55, temperature = 0)
soundgen:::divideIntoSyllables (nSyl = 3, sylLen = 100,
  pauseLen = 25, temperature = 0.5)

# sylLen and pauseLen are vectorized:
soundgen:::divideIntoSyllables (nSyl = 15, sylLen = 100:200,
  pauseLen = c(80, 25, 80), temperature = 0.05, plot = TRUE)

soundgen documentation built on Sept. 12, 2024, 6:29 a.m.