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()
  • Shiny app for editing intonation contours (opens in a browser): pitch_app()
  • 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

819

Version

1.6.0

License

GPL (>= 2)

Maintainer

Andrey Anikin

Last Published

December 9th, 2019

Functions in soundgen (1.6.0)

Mode

Modified mode
addVectors

Add overlapping vectors
HzToSemitones

Convert Hz to semitones
beat

Generate beat
analyzeFolder

Analyze folder
addFormants

Add formants
analyze

Analyze sound
clumper

Clump a sequence into large segments
analyzeFrame

Analyze fft frame
addPitchCands

Plot pitch candidates
costPerPath

Cost per path
crossFade

Join two waveforms by cross-fading
defaults

Shiny app defaults
gaussian.w

Gaussian window
getCheckerboardKernel

Checkerboard kernel
defaults_analyze

Defaults and ranges for analyze()
ftwindow_modif

Fourier transform windows (seewave)
getBandwidth

Get bandwidth
findGrad

Find gradient
findBursts

Find bursts
divideIntoSyllables

Syllable structure of a bout
getFormantDispersion

Get formant dispersion
downsample

Simple downsampling
getPrior

Get prior for pitch candidates
getFrameBank

Frame bank
getRMS

RMS amplitude per frame
flatEnv

Flat envelope
estimateVTL

Estimate vocal tract length
costJumps

Cost of jumps
convert_sec_to_hms

Print time
findZeroCrossing

Find zero crossing
drawContour

Draw contour
compareSounds

Compare sounds (experimental)
filterMS

Filter modulation spectrum
getMelSpec

Mel-transformed spectrum
getRough

Get roughness
generatePath

Generate path
getRolloff

Control rolloff of harmonics
generateNoise

Generate noise
getLoudnessPerFrame

Get loudness per frame
guessPhase_spsi

Guess phase SPSI
htmlPlots

HTML for clickable plots
iso226

iso226
isCentral.localMax

Simple peak detection
convertStringToFormants

Prepare a list of formants
getVocalFry_per_epoch

Constant subharmonics regime
guessPhase_GL

Guess phase GL
killDC

Kill DC
morphList

Morph lists
msToSpec

Modulation spectrum to spectrogram
permittedValues

Defaults and ranges for soundgen()
filled.contour.mod

Modified filled.contour
filterSoundByMS

Filter sound by modulation spectrum
flatSpectrum

Flat spectrum
fart

Fart
forcePerPath

Force per path
pitchSmoothPraat

Pitch smoothing as in Praat
pitch_app

Interactive pitch editor
phon2sone

Convert phon to sone
listDepth

List depth
segmentFolder

Segment all files in a folder
getEnv

Get amplitude envelope
getEntropy

Entropy
getGlottalCycles

Divide f0 contour into glottal cycles
getDiscreteContour

Discrete smooth contour from anchors
findSyllables

Find syllables
findVoicedSegments

Find voiced segments
getDom

Get lowest dominant frequency band
evaluatePars

Evaluate parameters for optimization
getNovelty

SSM novelty
fade

Fade
getPitchCep

Cepstral pitch tracker
getIntegerRandomWalk

Discrete random walk
getPitchAutocor

Autocorrelation pitch tracker
mergeSyllables

Merge syllables
getSpectralEnvelope

Spectral envelope
getRandomWalk

Random walk
getVocalFry

Subharmonics
getRMSFolder

RMS amplitude per folder
gaussianSmooth2D

Gaussian smoothing in 2D
modulationSpectrum

Modulation spectrum
segmentManual

Manual counts of syllables in 260 sounds
log01

log01
getPitchSpec

BaNa pitch tracker
osc_dB

Oscillogram dB
soundgen

Generate a sound
reportTime

Report time
soundgen_app

Interactive sound synthesizer
splitContour

Split contour
optimizePars

Optimize parameters for acoustic analysis
generateEpoch

Generate an epoch
snake

Snake
reportCI

Report CI
spreadSpec

Spread spectrum
zeroOne

Normalize 0 to 1
generateHarmonics

Generate harmonics
generateGC

Generate glottal cycles
getLoudness

Get loudness
logMatrix

Log-warp matrix
getLoudnessFolder

Loudness per folder
getSigmoid

Get sigmoid filter
getSmoothContour

Smooth contour from anchors
morphDF

Morph dataframes
intplPitch

Interpolate pitch contour
morphFormants

Morph formants
pDistr

Proportion of total
pathfinder

Pathfinder
reformatAnchors

Reformat anchors
interpolMatrix

Interpolate matrix
invertSpectrogram

Invert spectrogram
normalizeFolder

Normalize folder
matchColumns

Match number of columns
matchLengths

Resize vector to required length
interpolate

Interpolate
specToMS

Spectrogram to modulation spectrum
playme

Play audio
notesDict

Conversion table from Hz to musical notation
pathfinding_slow

Path through pitch candidates: slow
pathfinding_fast

Path through pitch candidates: fast
matchPars

Match soundgen pars (experimental)
upsamplePitchContour

Upsample pitch contour
presets

Presets
scaleNoiseAnchors

Scale noise anchors
updateAnalyze

Update analyze
summarizeAnalyze

Summarize the output of analyze()
upsample

Upsample pitch contour
ssm

Self-similarity matrix
scaleSPL

Scale SPL
wiggleAnchors

Randomly modify anchors
medianSmoother

Median smoothing
reformatFormants

Reformat formants
selfsim

Compute self-similarity
semitonesToHz

Convert semitones to Hz
switchColorTheme

Switch color theme
morph

Morph sounds
pitchManual

Manual pitch estimation in 260 sounds
pitchContour

Manually corrected pitch contours in 260 sounds
modulationSpectrumFolder

Modulation spectrum per folder
wiggleGC

Wiggle glottal cycles
to_dB

Convert to dB
wigglePars

Wiggle parameters
rnorm_truncated

Random draw from a truncated normal distribution
sampleModif

sampleModif
segment

Segment a sound
schwa

Schwa-related formant conversion
spectrogramFolder

Save spectrograms per folder
transplantFormants

Transplant formants
spectrogram

Spectrogram
transplantEnv

Transplant envelope