library(soundgen) library(seewave) ampl = soundgen:::rnorm_truncated(16, 0, 20, low = -80, high = 0) ampl[seq(2, length(ampl), by = 2)] = 0 s1 = soundgen( sylLen = 900, pitch = data.frame(time = c(0, 130, 900), value = c(280, 200, 200)), ampl = ampl, rolloff = -8, nonlinBalance = 70, jitterDep = 1, shimmerDep = 15, temperature = 0.1, tempEffects = list(pitchDriftFreq = 1, pitchDriftDep = 3, amplDriftDep = 2), formants = list(f1 = 1250, f2 = 1900, f3 = c(3700, 3000), f4 = 4600), addSilence = 0, samplingRate = 22050, play = T, plot = T, osc = T ) s2 = soundgen( nSyl = 4, sylLen = 70, pauseLen = 70, pitch = 240, ampl = c(0, -20), rolloff = -8, jitterDep = .2, shimmerDep = 15, temperature = 0.1, formants = c(1200, 1700, 3600, 4500), addSilence = 0, attackLen = 10, samplingRate = 22050, play = T, plot = T, osc = T ) s3 = soundgen( sylLen = 260, pitch = data.frame(time = c(0, 150, 260), value = c(240, 240, 490)), rolloff = c(-8, -4), subFreq = 150, subDep = 100, subWidth = 100, jitterDep = 1, shimmerDep = 15, temperature = 0.1, formants = list(f1 = 1300, f2 = 1900, f3 = c(3200, 4100, 3200), f4 = 4500), addSilence = 0, attackLen = 10, samplingRate = 22050, play = T, plot = T, osc = T ) s = addVectors(s1, s2, insertionPoint = length(s1) + 22050 * .1) s = addVectors(s, s3, insertionPoint = length(s) + 22050 * .1) playme(s, 22050) savewav(s, f = 22050, filename = 'laugh_276_soundgen.wav')