Script for listing time–F0–intensity

"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 = Get start time
    tmax = Get end time
    To Pitch: 0.001, 75, 300
    Rename: "pitch"
    selectObject: sound
    To Intensity: 75, 0.001
    Rename: "intensity"
    writeInfoLine: "Here are the results:"
    for i to (tmax-tmin)/0.01
       time = tmin + i * 0.01
       selectObject: "Pitch pitch"
       pitch = Get value at time: time, "Hertz", "linear"
       selectObject: "Intensity intensity"
       intensity = Get value at time: time, "cubic"
       appendInfoLine: fixed$ (time, 2), " ", fixed$ (pitch, 3), " ", fixed$ (intensity, 3)
    endfor

Links to this page


© ppgb 20200912