CAST Timbral Prototype File Formats

We are working on a "universal file format", SDIF and on importing timbral prototypes from Lemur and other analysis tools. In the meantime we support the following file formats derived from those used in IRCAM analysis tools:

F0 files

F0 files represent estimated fundamental frequency tracks. They are ascii text files. There are two flavors, ones ending in .f0 and ones ending in .F0. The reason the synthesizer reads these formats is to provide audible feedback from pitch estimation programs.

With .f0 files, each line of text contains two floating point numbers. The first gives a time, in seconds, and the second gives a frequency, in Hertz. Time is in ascending order.

The .F0 variant adds two fields, an estimated loudness of the signal at that time (expressed apparently in linear amplitude with 2^15 as Maximum), and a a value that represents the quality of the pitch estimate. Larger values being more likely to be the correct pitch.

These files can be viewed with xgraph

.fmt files

.fmt files contain time tagged frames of data describing sinusoidal partial track frequencies, phases and amplitudes.

.fmt files are binary with numbers stored as big-endian. The file contains no header, just a sequence of frames that begin with their own header containing two 32-bit floating point numbers: total number of partials in the frame, followed by the time in seconds. Then there are four floats for each partial:

Successive frames may be separated by any time interval but they should always appear in increasing order. A partial's index number identifies it uniquely, so that it can be tracked from frame to frame. The indices don't necessarily have any relationship to the frequencies, or partial index, but commonly the indices and frequencies are both in ascending order. It is unusual for all the partials to appear in every frame, there will be many "births and deaths."

The synthesizer currently ignores phase information in the .fmt file.

There are tools to view format files.

.format files

.format files are an obsolete version of the newer .fmt files. They contain the same information, but in human-readable ASCII instead of the binary .fmt files. .format files are much larger than the corresponding .fmt files, and it takes longer for programs like the synthesizer to read .format files into memory. One advantage of .format files is that they can be manipulated by awk.

The program tofmt converts .format files to .fmt files, and the program fromfmt does the reverse. These programs are pipes, so use shell redirection like this:

tofmt < foo.format > foo.fmt
fromfmt < bar.fmt > bar.format

These programs do not delete the original file; when they're done you have both the .fmt and the .format file. Please delete the original file (with Unix's rm) after you've converted it.