n = 50
pitch = getSmoothContour(len = n, anchors = c(600, 2000, 1900, 400),
thisIsPitch = TRUE, plot = TRUE)
rolloffMatrix = getRolloff(pitch_per_gc = pitch)
specEnv = getSpectralEnvelope(nr = 512, nc = length(pitch),
formants = list(f1 = c(800, 1200), f2 = 2000, f3 = c(3500, 3200)),
lipRad = 0, temperature = .00001, plot = TRUE)
formantSummary = t(data.frame(f1 = c(800, 1200), f2 = c(2000, 2000), f3 = c(3500, 3200)))
pitch2 = soundgen:::lockToFormants(pitch = pitch, specEnv = specEnv,
rolloffMatrix = rolloffMatrix,
formantSummary = formantSummary,
lockProb = .5, minLength = 5, plot = TRUE)
pitch3 = soundgen:::lockToFormants(pitch = pitch, specEnv = specEnv,
rolloffMatrix = rolloffMatrix,
formantSummary = formantSummary,
lockProb = list(time = c(0, .7, 1), value = c(0, 1, 0)),
minLength = 5, plot = TRUE)
Run the code above in your browser using DataLab