Script for listing time–F0 pairs

“I wish to have a list of time markers in one column and F0 in the other. Those times that have no voiced data should be represented as “.” in the F0 column.”

    writeInfoLine: "Time: Pitch:"
    numberOfFrames = Get number of frames
    for iframe to numberOfFrames
       time = Get time from frame: iframe
       pitch = Get value in frame: iframe, "Hertz"
       if pitch = undefined
          appendInfoLine: fixed$ (time, 6)
       else
          appendInfoLine: fixed$ (time, 6), " ", fixed$ (pitch, 3)
       endif
    endfor

If you want to see this in a text file, you can copy and paste from the Info window, or save the Info window, or add a line to the script like

    appendFile: "out.txt", info$ ( )

Links to this page


© ppgb 20140223