Learn R Programming

⚠️There's a newer version (2.7.3) of this package.Take me there.

soundgen

R package for sound synthesis and acoustic analysis.
Homepage with help, demos, etc: http://cogsci.se/soundgen.html
Source code on github: https://github.com/tatters/soundgen

Performs parametric synthesis of sounds with harmonic and noise components such as animal vocalizations or human voice. Also includes tools for spectral analysis, pitch tracking, audio segmentation, self-similarity matrices, morphing, etc.

Key functions:

  • Sound synthesis from R console: soundgen()
  • Shiny app for sound synthesis (opens in a browser): soungen_app()
  • Acoustic analysis of a .wav file: analyze()
  • Measuring syllables, pauses, and bursts in a .wav file: segment()

For more information, please see the vignettes on sound synthesis and acoustic analysis:

vignette("sound_generation", package="soundgen") vignette("acoustic_analysis", package="soundgen")

Or, to open the vignettes in a browser:
RShowDoc('sound_generation', package = 'soundgen')
RShowDoc('acoustic_analysis', package = 'soundgen')

Installation

To install the current release from CRAN: install.packages("soundgen")

NB: Make sure all dependencies have been installed correctly! For problems with seewave, see http://rug.mnhn.fr/seewave/

On Macs, you may need to do the following:

  • First install brew according to the instructions here: https://brew.sh/
  • Then run the following from the terminal
    brew install libsndfile
    brew install fftw
  • Finally, install soundgen in R:
    install.packages("soundgen")

Copy Link

Version

Install

install.packages('soundgen')

Monthly Downloads

827

Version

1.2.1

License

GPL (>= 2)

Maintainer

Andrey Anikin

Last Published

August 4th, 2018

Functions in soundgen (1.2.1)

addFormants

Add formants
defaults

Shiny app defaults
evaluatePars

Evaluate parameters for optimization
divideIntoSyllables

Syllable structure of a bout
downsample

Simple downsampling
findGrad

Find gradient
fade

Fade
findSyllables

Find syllables
getFrameBank

Frame bank
analyze

Analyze sound
convertStringToFormants

Prepare a list of formants
analyzeFolder

Analyze folder
convert_sec_to_hms

Print time
getGlottalCycles

Divide f0 contour into glottal cycles
ftwindow_modif

Fourier transform windows (seewave)
gaussian.w

Gaussian window
getDom

Get lowest dominant frequency band
getSpectralEnvelope

Spectral envelope
getEntropy

Entropy
getVocalFry

Subharmonics
getRandomWalk

Random walk
getRolloff

Control rolloff of harmonics
matchLengths

Resize vector to required length
matchPars

Match soundgen pars (experimental)
flatEnv

Flat envelope
analyzeFrame

Analyze fft frame
forcePerPath

Force per path
morph

Morph sounds
beat

Generate beat
getCheckerboardKernel

Checkerboard kernel
morphDF

Morph dataframes
getDiscreteContour

Discrete smooth contour from anchors
getPitchCep

Cepstral pitch tracker
clumper

Clump a sequence into large segments
generateEpoch

Generate an epoch
compareSounds

Compare sounds (experimental)
drawContour

Draw contour
estimateVTL

Estimate vocal tract length
generateGC

Generate glottal cycles
fart

Fart
HzToSemitones

Convert Hz to semitones
medianSmoother

Median smoothing
mergeSyllables

Merge syllables
pitchManual

Manual pitch estimation in 260 sounds
getNovelty

SSM novelty
Mode

Modified mode
notesDict

Conversion table from Hz to semitones above C0 to musical notation
costJumps

Cost of jumps
costPerPath

Cost per path
playme

Play audio
getPitchAutocor

Autocorrelation pitch tracker
findVoicedSegments

Find voiced segments
snake

Snake
findZeroCrossing

Find zero crossing
soundgen

Generate a sound
getVocalFry_per_epoch

Constant subharmonics regime
getPitchSpec

BaNa pitch tracker
upsample

Upsample pitch contour
morphFormants

Morph formants
morphList

Morph lists
reportTime

Report time
rnorm_bounded

Random draw from a truncated normal distribution
findBursts

Find bursts
generatePath

Generate path
soundgen_app

Soundgen shiny app
optimizePars

Optimize parameters for acoustic analysis
wiggleAnchors

Randomly modify anchors
getBandwidth

Get bandwidth
htmlPlots

HTML for clickable plots
getIntegerRandomWalk

Discrete random walk
generateHarmonics

Generate harmonics
reformatFormants

Reformat formants
generateNoise

Generate noise
killDC

Kill envelope
getMelSpec

Mel-transformed spectrum
spectrogram

Spectrogram
listDepth

List depth
wiggleGC

Wiggle glottal cycles
log01

log01
reportCI

Report CI
wigglePars

Wiggle parameters
getEnv

Get amplitude envelope
selfsim

Compute self-similarity
getFormantDispersion

Get formant dispersion
spectrogramFolder

Save spectrograms per folder
matchColumns

Match number of columns
getSigmoid

Get sigmoid filter
semitonesToHz

Convert semitones to Hz
splitContour

Split contour
getSmoothContour

Smooth contour from anchors
pathfinding_slow

Path through pitch candidates: slow
interpolate

Interpolate
isCentral.localMax

Simple peak detection
permittedValues

Defaults and ranges
sampleModif

sampleModif
pathfinder

Pathfinder
pathfinding_fast

Path through pitch candidates: fast
presets

Presets
scaleNoiseAnchors

Scale noise anchors
schwa

Schwa-related formant conversion
segment

Segment a sound
reformatAnchors

Reformat anchors
zeroOne

Normalize 0 to 1
segmentFolder

Segment all files in a folder
ssm

Self-similarity matrix
segmentManual

Manual counts of syllables in 260 sounds
to_dB

Convert to dB
addVectors

Add overlapping vectors
crossFade

Join two waveforms by cross-fading