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

623

Version

1.6.2

License

GPL (>= 2)

Maintainer

Andrey Anikin

Last Published

February 6th, 2020

Functions in soundgen (1.6.2)

beat

Generate beat
compareSounds

Compare sounds (experimental)
filterMS

Filter modulation spectrum
filterSoundByMS

Filter sound by modulation spectrum
flatEnv

Flat envelope
convertStringToFormants

Prepare a list of formants
findZeroCrossing

Find zero crossing
getEntropy

Entropy
getEnv

Get amplitude envelope
getGlottalCycles

Divide f0 contour into glottal cycles
getIntegerRandomWalk

Discrete random walk
analyzeFolder

Analyze folder
addFormants

Add formants
analyzeFrame

Analyze fft frame
addPitchCands

Plot pitch candidates
crossFade

Join two waveforms by cross-fading
costPerPath

Cost per path
downsample

Simple downsampling
getRMSFolder

RMS amplitude per folder
gaussianSmooth2D

Gaussian smoothing in 2D
findBursts

Find bursts
generateEpoch

Generate an epoch
findGrad

Find gradient
divideIntoSyllables

Syllable structure of a bout
getRandomWalk

Random walk
generateNoise

Generate noise
drawContour

Draw contour
flatSpectrum

Flat spectrum
estimateVTL

Estimate vocal tract length
generateGC

Generate glottal cycles
forcePerPath

Force per path
generateHarmonics

Generate harmonics
htmlPlots

HTML for clickable plots
getLoudnessPerFrame

Get loudness per frame
guessPhase_spsi

Guess phase SPSI
generatePath

Generate path
HzToSemitones

Convert Hz to semitones
getSpectralEnvelope

Spectral envelope
getRolloff

Control rolloff of harmonics
getRough

Get roughness
getFrameBank

Frame bank
convert_sec_to_hms

Print time
modulationSpectrum

Modulation spectrum
Mode

Modified mode
logMatrix

Log-warp matrix
getVocalFry

Subharmonics
modulationSpectrumFolder

Modulation spectrum per folder
getFormantDispersion

Get formant dispersion
getPitchCep

Cepstral pitch tracker
matchColumns

Match number of columns
getMelSpec

Mel-transformed spectrum
getPitchSpec

BaNa pitch tracker
pitchContour

Manually corrected pitch contours in 260 sounds
phon2sone

Convert phon to sone
addVectors

Add overlapping vectors
analyze

Analyze sound
fart

Fart
killDC

Kill DC
filled.contour.mod

Modified filled.contour
costJumps

Cost of jumps
reportTime

Report time
defaults

Shiny app defaults
defaults_analyze

Defaults and ranges for analyze()
lockToFormants

Lock to formants
invertSpectrogram

Invert spectrogram
rnorm_truncated

Random draw from a truncated normal distribution
sampleModif

sampleModif
findSyllables

Find syllables
evaluatePars

Evaluate parameters for optimization
intplPitch

Interpolate pitch contour
getSmoothContour

Smooth contour from anchors
findVoicedSegments

Find voiced segments
getNovelty

SSM novelty
getDom

Get lowest dominant frequency band
getDiscreteContour

Discrete smooth contour from anchors
fade

Fade
interpolMatrix

Interpolate matrix
matchLengths

Resize vector to required length
getPitchAutocor

Autocorrelation pitch tracker
matchPars

Match soundgen pars (experimental)
listDepth

List depth
interpolate

Interpolate
morph

Morph sounds
ftwindow_modif

Fourier transform windows (seewave)
osc_dB

Oscillogram dB
morphFormants

Morph formants
getSigmoid

Get sigmoid filter
morphDF

Morph dataframes
scaleNoiseAnchors

Scale noise anchors
log01

log01
pDistr

Proportion of total
reportCI

Report CI
getBandwidth

Get bandwidth
reformatFormants

Reformat formants
gaussian.w

Gaussian window
mergeSyllables

Merge syllables
medianSmoother

Median smoothing
spectrogram

Spectrogram
specToMS

Spectrogram to modulation spectrum
wigglePars

Wiggle parameters
optimizePars

Optimize parameters for acoustic analysis
pitchSmoothPraat

Pitch smoothing as in Praat
getCheckerboardKernel

Checkerboard kernel
notesDict

Conversion table from Hz to musical notation
segmentManual

Manual counts of syllables in 260 sounds
morphList

Morph lists
pitchManual

Manual pitch estimation in 260 sounds
pathfinder

Pathfinder
pitch_app

Interactive pitch editor
playme

Play audio
getLoudnessFolder

Loudness per folder
getLoudness

Get loudness
pathfinding_fast

Path through pitch candidates: fast
zeroOne

Normalize 0 to 1
semitonesToHz

Convert semitones to Hz
scaleSPL

Scale SPL
selfsim

Compute self-similarity
ssm

Self-similarity matrix
wiggleAnchors

Randomly modify anchors
snake

Snake
spectrogramFolder

Save spectrograms per folder
getPrior

Get prior for pitch candidates
getRMS

RMS amplitude per frame
transplantFormants

Transplant formants
spreadSpec

Spread spectrum
schwa

Schwa-related formant conversion
soundgen

Generate a sound
soundgen_app

Interactive sound synthesizer
guessPhase_GL

Guess phase GL
splitContour

Split contour
isCentral.localMax

Simple peak detection
wiggleGC

Wiggle glottal cycles
getVocalFry_per_epoch

Constant subharmonics regime
updateAnalyze

Update analyze
upsample

Upsample pitch contour
iso226

iso226
msToSpec

Modulation spectrum to spectrogram
normalizeFolder

Normalize folder
upsamplePitchContour

Upsample pitch contour
presets

Presets
pathfinding_slow

Path through pitch candidates: slow
segment

Segment a sound
segmentFolder

Segment all files in a folder
reformatAnchors

Reformat anchors
permittedValues

Defaults and ranges for soundgen()
summarizeAnalyze

Summarize the output of analyze()
switchColorTheme

Switch color theme
transplantEnv

Transplant envelope
to_dB

Convert to dB
clumper

Clump a sequence into large segments