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/mp3 file: analyze()
  • Measuring syllables, pauses, and bursts in a wav/mp3 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

746

Version

1.3.2

License

GPL (>= 2)

Maintainer

Andrey Anikin

Last Published

January 10th, 2019

Functions in soundgen (1.3.2)

analyze

Analyze sound
findGrad

Find gradient
HzToSemitones

Convert Hz to semitones
beat

Generate beat
analyzeFrame

Analyze fft frame
divideIntoSyllables

Syllable structure of a bout
downsample

Simple downsampling
findSyllables

Find syllables
Mode

Modified mode
getCheckerboardKernel

Checkerboard kernel
getDiscreteContour

Discrete smooth contour from anchors
findVoicedSegments

Find voiced segments
drawContour

Draw contour
getSigmoid

Get sigmoid filter
flatEnv

Flat envelope
findZeroCrossing

Find zero crossing
forcePerPath

Force per path
estimateVTL

Estimate vocal tract length
getSmoothContour

Smooth contour from anchors
generateEpoch

Generate an epoch
log01

log01
medianSmoother

Median smoothing
matchColumns

Match number of columns
generateHarmonics

Generate harmonics
mergeSyllables

Merge syllables
generateGC

Generate glottal cycles
ftwindow_modif

Fourier transform windows (seewave)
permittedValues

Defaults and ranges
gaussian.w

Gaussian window
getEnv

Get amplitude envelope
getFormantDispersion

Get formant dispersion
getDom

Get lowest dominant frequency band
phon2sone

Convert phon to sone
sampleModif

sampleModif
scaleNoiseAnchors

Scale noise anchors
convertStringToFormants

Prepare a list of formants
convert_sec_to_hms

Print time
spectrogram

Spectrogram
fade

Fade
evaluatePars

Evaluate parameters for optimization
getRandomWalk

Random walk
getRolloff

Control rolloff of harmonics
getEntropy

Entropy
killDC

Kill DC
getPitchCep

Cepstral pitch tracker
getIntegerRandomWalk

Discrete random walk
getLoudness

Get loudness
listDepth

List depth
morphFormants

Morph formants
morphList

Morph lists
playme

Play audio
pitchManual

Manual pitch estimation in 260 sounds
getSpectralEnvelope

Spectral envelope
semitonesToHz

Convert semitones to Hz
generateNoise

Generate noise
snake

Snake
getPitchSpec

BaNa pitch tracker
getVocalFry

Subharmonics
getFrameBank

Frame bank
isCentral.localMax

Simple peak detection
zeroOne

Normalize 0 to 1
spectrogramFolder

Save spectrograms per folder
getVocalFry_per_epoch

Constant subharmonics regime
wiggleGC

Wiggle glottal cycles
htmlPlots

HTML for clickable plots
morph

Morph sounds
clumper

Clump a sequence into large segments
iso226

iso226
getGlottalCycles

Divide f0 contour into glottal cycles
morphDF

Morph dataframes
matchLengths

Resize vector to required length
osc_dB

Oscillogram dB
pathfinder

Pathfinder
reformatFormants

Reformat formants
wigglePars

Wiggle parameters
reportCI

Report CI
compareSounds

Compare sounds (experimental)
segment

Segment a sound
crossFade

Join two waveforms by cross-fading
matchPars

Match soundgen pars (experimental)
segmentFolder

Segment all files in a folder
presets

Presets
reformatAnchors

Reformat anchors
segmentManual

Manual counts of syllables in 260 sounds
getNovelty

SSM novelty
interpolate

Interpolate
interpolMatrix

Interpolate matrix
getPitchAutocor

Autocorrelation pitch tracker
defaults

Shiny app defaults
selfsim

Compute self-similarity
upsample

Upsample pitch contour
wiggleAnchors

Randomly modify anchors
notesDict

Conversion table from Hz to musical notation
fart

Fart
optimizePars

Optimize parameters for acoustic analysis
ssm

Self-similarity matrix
findBursts

Find bursts
to_dB

Convert to dB
generatePath

Generate path
getBandwidth

Get bandwidth
getLoudnessPerFrame

Get loudness per frame
reportTime

Report time
rnorm_bounded

Random draw from a truncated normal distribution
getMelSpec

Mel-transformed spectrum
spreadSpec

Spread spectrum
splitContour

Split contour
pathfinding_fast

Path through pitch candidates: fast
pathfinding_slow

Path through pitch candidates: slow
scaleSPL

Scale SPL
schwa

Schwa-related formant conversion
soundgen

Generate a sound
soundgen_app

Soundgen shiny app
analyzeFolder

Analyze folder
addFormants

Add formants
costJumps

Cost of jumps
addVectors

Add overlapping vectors
costPerPath

Cost per path