|
"I want a list of pitch and intensity values at the same times."
Since Sound: To Pitch... and Sound: To Intensity... do not give values at the same times, you create separate pitch and intensity contours with high time resolution, then interpolate. In the following example, you get pitch and intensity values at steps of 0.01 seconds by interpolating curves that have a time resolution of 0.001 seconds.
sound = selected ("Sound")
tmin = do ("Get start time")
tmax = do ("Get end time")
do ("To Pitch...", 0.001, 75, 300)
do ("Rename...", "pitch")
select sound
do ("To Intensity...", 75, 0.001)
do ("Rename...", "intensity")
writeInfoLine ("Here are the results:")
for i to (tmax-tmin)/0.01
time = tmin + i * 0.01
select Pitch pitch
pitch = do ("Get value at time...", time, "Hertz", "Linear")
select Intensity intensity
intensity = do ("Get value at time...", time, "Cubic")
appendInfoLine (fixed$ (time, 2), " ", fixed$ (pitch, 3), " ", fixed$ (intensity, 3))
endfor
© ppgb, April 7, 2013