atsinfo

Description

atsinfo reads data out of the header of an ATS file.

Initialization

iatsfile – the ATS number (n in ats.n) or the name in quotes of the analysis file made using ATS.

ilocation – indicates which location in the header file to return. The data in the header
gives information about the data contained in the rest of the ATS file. The possible values for ilocation are given in the following list:

atsinfo can be useful for writing generic instruments that will work with many ATS files, even if they have different lengths and different numbers of partials etc. Example 2 is a simple application of this.

Examples

1.

imax_freq atsinfo "cl.ats", $ATS_FREQ_MAX

In the example above we get the maximum frequency value from the ATS file "cl.ats" and store it in imax_freq. We use at Csound Macro (defined above) $ATS_FREQ_MAX, which is equivalent to the number 6

In the example above we use atsinfo to retrieve the duration and number of partials in the ATS file indicated by p4. With this info we synthesize the partials using atsadd. Since the duration and number of partials are not "hard-coded" we can use this code with any ats file.