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.7.0

License

GPL (>= 2)

Maintainer

Andrey Anikin

Last Published

May 24th, 2020

Functions in soundgen (1.7.0)

addFormants

Add formants
beat

Generate beat
HzToSemitones

Convert Hz to semitones
analyzeFolder

Analyze folder
analyzeFrame

Analyze fft frame
analyze

Analyze sound
addVectors

Add overlapping vectors
costJumps

Cost of jumps
compareSounds

Compare sounds (experimental)
clumper

Clump a sequence into large segments
convert_sec_to_hms

Print time
filterSoundByMS

Filter sound by modulation spectrum
defaults_analyze_pitchCand

Defaults for plotting with analyze()
divideIntoSyllables

Syllable structure of a bout
convertStringToFormants

Prepare a list of formants
estimateVTL

Estimate vocal tract length
crossFade

Join two waveforms by cross-fading
addPitchCands

Plot pitch candidates
Mode

Modified mode
filterMS

Filter modulation spectrum
costPerPath

Cost per path
filled.contour.mod

Modified filled.contour
evaluatePars

Evaluate parameters for optimization
defaults

Shiny app defaults
downsample

Simple downsampling
drawContour

Draw contour
forcePerPath

Force per path
fade

Fade
findSyllables

Find syllables
fart

Fart
findBursts

Find bursts
ftwindow_modif

Fourier transform windows (seewave)
findGrad

Find gradient
defaults_analyze

Defaults and ranges for analyze()
findVoicedSegments

Find voiced segments
findZeroCrossing

Find zero crossing
gaussian.w

Gaussian window
generatePath

Generate path
flatEnv

Flat envelope
gaussianSmooth2D

Gaussian smoothing in 2D
flatSpectrum

Flat spectrum
getBandwidth

Get bandwidth
generateGC

Generate glottal cycles
generateEpoch

Generate an epoch
getCheckerboardKernel

Checkerboard kernel
getDiscreteContour

Discrete smooth contour from anchors
getPrior

Get prior for pitch candidates
getRMS

RMS amplitude per frame
getFrameBank

Frame bank
generateNoise

Generate noise
generateHarmonics

Generate harmonics
getLoudnessFolder

Loudness per folder
getGlottalCycles

Divide f0 contour into glottal cycles
getLoudnessPerFrame

Get loudness per frame
getIntegerRandomWalk

Discrete random walk
getDom

Get lowest dominant frequency band
getEntropy

Entropy
getFormantDispersion

Get formant dispersion
getEnv

Get amplitude envelope
guessPhase_spsi

Guess phase SPSI
getLoudness

Get loudness
getVocalFry_per_epoch

Constant subharmonics regime
getMelSpec

Mel-transformed spectrum
getNovelty

SSM novelty
getRolloff

Control rolloff of harmonics
harmEnergy

Energy in harmonics
getRMSFolder

RMS amplitude per folder
getRandomWalk

Random walk
getRough

Get roughness
guessPhase_GL

Guess phase GL
getPitchAutocor

Autocorrelation pitch tracker
htmlPlots

HTML for clickable plots
harmHeight_peaks

Height of harmonics: peaks method
killDC

Kill DC
getSigmoid

Get sigmoid filter
listDepth

List depth
matchPars

Match soundgen pars (experimental)
logMatrix

Log-warp matrix
matchLengths

Resize vector to required length
interpolMatrix

Interpolate matrix
interpolate

Interpolate
getSmoothContour

Smooth contour from anchors
matchColumns

Match number of columns
getPitchCep

Cepstral pitch tracker
morphFormants

Morph formants
morphList

Morph lists
modulationSpectrum

Modulation spectrum
modulationSpectrumFolder

Modulation spectrum per folder
parabPeakInterpol

Parabolic peak interpolation
pathfinder

Pathfinder
getPitchSpec

BaNa pitch tracker
getPitchHps

Harmonic product spectrum
reformatAnchors

Reformat anchors
reformatFormants

Reformat formants
harmHeight

Height of harmonics
getSpectralEnvelope

Spectral envelope
mergeSyllables

Merge syllables
medianSmoother

Median smoothing
osc_dB

Oscillogram dB
notesDict

Conversion table from Hz to musical notation
getVocalFry

Subharmonics
pDistr

Proportion of total
snake

Snake
intplPitch

Interpolate pitch contour
invertSpectrogram

Invert spectrogram
harmHeight_dif

Height of harmonics: difference method
msToSpec

Modulation spectrum to spectrogram
pitchSmoothPraat

Pitch smoothing as in Praat
pathfinding_fast

Path through pitch candidates: fast
pitch_app

Interactive pitch editor
optimizePars

Optimize parameters for acoustic analysis
scaleNoiseAnchors

Scale noise anchors
iso226

iso226
isCentral.localMax

Simple peak detection
scaleSPL

Scale SPL
normalizeFolder

Normalize folder
pathfinding_slow

Path through pitch candidates: slow
specToMS

Spectrogram to modulation spectrum
soundgen_app

Interactive sound synthesizer
soundgen

Generate a sound
transplantEnv

Transplant envelope
sampleModif

sampleModif
rnorm_truncated

Random draw from a truncated normal distribution
lockToFormants

Lock to formants
ssm

Self-similarity matrix
reportTime

Report time
transplantFormants

Transplant formants
summarizeAnalyze

Summarize the output of analyze()
reportCI

Report CI
pitchContour

Manually corrected pitch contours in 260 sounds
log01

log01
upsamplePitchContour

Upsample pitch contour
playme

Play audio
upsample

Upsample pitch contour
pitchManual

Manual pitch estimation in 260 sounds
presets

Presets
wigglePars

Wiggle parameters
validatePars

Validate parameters
segmentFolder

Segment all files in a folder
semitonesToHz

Convert semitones to Hz
zeroOne

Normalize 0 to 1
selfsim

Compute self-similarity
segmentManual

Manual counts of syllables in 260 sounds
updateAnalyze

Update analyze
morph

Morph sounds
spectrogram

Spectrogram
to_dB

Convert to dB
morphDF

Morph dataframes
switchColorTheme

Switch color theme
permittedValues

Defaults and ranges for soundgen()
spectrogramFolder

Save spectrograms per folder
phon2sone

Convert phon to sone
schwa

Schwa-related formant conversion
splitContour

Split contour
segment

Segment a sound
wiggleAnchors

Randomly modify anchors
wiggleGC

Wiggle glottal cycles
spreadSpec

Spread spectrum