Learn R Programming

⚠️There's a newer version (2.7.2) 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

706

Version

1.3.0

License

GPL (>= 2)

Maintainer

Andrey Anikin

Last Published

August 31st, 2018

Functions in soundgen (1.3.0)

analyzeFrame

Analyze fft frame
costPerPath

Cost per path
drawContour

Draw contour
findGrad

Find gradient
estimateVTL

Estimate vocal tract length
findSyllables

Find syllables
addFormants

Add formants
evaluatePars

Evaluate parameters for optimization
fade

Fade
getCheckerboardKernel

Checkerboard kernel
addVectors

Add overlapping vectors
getDiscreteContour

Discrete smooth contour from anchors
convertStringToFormants

Prepare a list of formants
convert_sec_to_hms

Print time
getEnv

Get amplitude envelope
findVoicedSegments

Find voiced segments
getFormantDispersion

Get formant dispersion
generateEpoch

Generate an epoch
getSigmoid

Get sigmoid filter
getSmoothContour

Smooth contour from anchors
generateGC

Generate glottal cycles
matchPars

Match soundgen pars (experimental)
matchLengths

Resize vector to required length
findZeroCrossing

Find zero crossing
reformatFormants

Reformat formants
reformatAnchors

Reformat anchors
generatePath

Generate path
getFrameBank

Frame bank
getBandwidth

Get bandwidth
getGlottalCycles

Divide f0 contour into glottal cycles
schwa

Schwa-related formant conversion
scaleNoiseAnchors

Scale noise anchors
getIntegerRandomWalk

Discrete random walk
splitContour

Split contour
clumper

Clump a sequence into large segments
compareSounds

Compare sounds (experimental)
getVocalFry_per_epoch

Constant subharmonics regime
getMelSpec

Mel-transformed spectrum
divideIntoSyllables

Syllable structure of a bout
downsample

Simple downsampling
htmlPlots

HTML for clickable plots
getSpectralEnvelope

Spectral envelope
ssm

Self-similarity matrix
flatEnv

Flat envelope
getVocalFry

Subharmonics
interpolate

Interpolate
killDC

Kill envelope
analyze

Analyze sound
analyzeFolder

Analyze folder
forcePerPath

Force per path
isCentral.localMax

Simple peak detection
crossFade

Join two waveforms by cross-fading
listDepth

List depth
pathfinding_fast

Path through pitch candidates: fast
ftwindow_modif

Fourier transform windows (seewave)
morphFormants

Morph formants
defaults

Shiny app defaults
generateHarmonics

Generate harmonics
pathfinding_slow

Path through pitch candidates: slow
generateNoise

Generate noise
getRandomWalk

Random walk
playme

Play audio
gaussian.w

Gaussian window
presets

Presets
getDom

Get lowest dominant frequency band
HzToSemitones

Convert Hz to semitones
Mode

Modified mode
getEntropy

Entropy
morphList

Morph lists
fart

Fart
permittedValues

Defaults and ranges
getRolloff

Control rolloff of harmonics
log01

log01
segment

Segment a sound
findBursts

Find bursts
getNovelty

SSM novelty
pitchManual

Manual pitch estimation in 260 sounds
segmentFolder

Segment all files in a folder
wigglePars

Wiggle parameters
zeroOne

Normalize 0 to 1
morphDF

Morph dataframes
morph

Morph sounds
rnorm_bounded

Random draw from a truncated normal distribution
soundgen

Generate a sound
matchColumns

Match number of columns
getPitchAutocor

Autocorrelation pitch tracker
getPitchCep

Cepstral pitch tracker
sampleModif

sampleModif
notesDict

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

BaNa pitch tracker
medianSmoother

Median smoothing
soundgen_app

Soundgen shiny app
optimizePars

Optimize parameters for acoustic analysis
reportCI

Report CI
spectrogram

Spectrogram
reportTime

Report time
spectrogramFolder

Save spectrograms per folder
mergeSyllables

Merge syllables
osc_dB

Oscillogram dB
semitonesToHz

Convert semitones to Hz
pathfinder

Pathfinder
snake

Snake
segmentManual

Manual counts of syllables in 260 sounds
selfsim

Compute self-similarity
wiggleAnchors

Randomly modify anchors
to_dB

Convert to dB
wiggleGC

Wiggle glottal cycles
upsample

Upsample pitch contour
beat

Generate beat
costJumps

Cost of jumps