ATScross
Prev | Orchestra Opcodes and Operators | Next

## ATScross

ATScross — perform cross synthesis from ATS analysis files.

## Description

ATScross uses data from an ATS analysis file and data from an ATSbufread to perform cross synthesis.

## Syntax

    ar ATScross ktimepnt, kfmod, iatsfile, ifn, kmylev, kbuflev, ipartials \
              [, ipartialoffset, ipartialincr]

## Initialization

iatsfile – integer or character-string denoting a control-file derived from ATS analysis of an audio signal. An integer denotes the suffix of a file ATS.m; a character-string (in double quotes) gives a filename, optionally a full pathname. If not full-path, the file is sought first in the current directory, then in the one given by the environment variable SADIR (if defined).

ifn – table number of a stored function containing a sine wave.

ipartials – number of partials that will be used in the resynthesis

ipartialoffset (optional) – is the first partial used (defaults to 0).

ipartialincr (optional) – sets an increment by which these synthesis opcodes counts up from ipartialoffset for ibins components in the re-synthesis (defaults to 1).

## Performance

ktimepnt – The time pointer in seconds used to index the ATS file. Used for ATScross exactly the same as for pvoc.

kfmod – an input for performing pitch transposition or frequency modulation on all of the synthesized partials, if no fm or pitch change is desired then use a 1 for this value.

kmylev - scales the ATScross component of the frequency spectrum applied to the partials from the ATS file indicated by the atscross opcode. The frequency spectrum information comes from the atscross ATS file. A value of 1 (and 0 for kbuflev) gives the same results as ATSadd.

kbuflev - scales the ATSbufread component of the frequency spectrum applied to the partials from the ATS file indicated by the ATScross opcode. The frequency spectrum information comes from the ATSbufread ATS file. A value of 1 (and 0 for kmylev) results in partials that have frequency information from the ATS file given by the ATScross, but amplitudes imposed by data from the ATS file given by ATSbufread.

ATScross uses data from an ATS analysis file (indicated by iatsfile) and data from an ATSbufread to perform cross synthesis. ATScross uses ktimepnt, kfmod, ipartials, ipartialoffset and ipartialincr just like ATSadd. ATScross synthesizes a sine-wave for each partial selected by the user and uses the frequency of that partial (after scaling in frequency by kfmod) to index the table created by ATSbufread. Interpolation is used to get in-between values. ATScross uses the sum of the amplitude data from its ATS file (scaled by kmylev) and the amplitude data gained from an ATSbufread (scaled by kbuflev) to scale the amplitude of each partial it synthesizes. Setting kmylev to one and kbuflev to zero will make ATScross act exactly like ATSadd. Setting kmylev to zero and kbuflev to one will produce a sound that has all the partials selected by the ATScross ugen, but with amplitudes taken from an ATSbufread. The time pointers of the ATSbufread and ATScross do not need to be the same.

## Examples

      ktime line 0, p3, 2.4
      ktime2 line 0, p3, .5
      kline expseg 0.001, .9, 1, p3-.9, 1
      kline2 expseg .001, p3, 1
      atsbufread  ktime2, 1, "crt.ats", 20
      aout atscross ktime, 1, "cl.ats", 1, kline, .001* (1 - kline2), 42

This example performs cross synthesis using two ATS files, "crt.ats" and "cl.ats". The result of this will be a sound that starts out with the shape (in frequency) of crt.ats, and ends with the shape of cl.ats. All the sine-wave frequencies come from cl.ats. The kbuflev value is scaled because the energy produced by applying crt.ats's frequency spectrum to cl.ats's partials is very large. Notice also that the time pointers of the atsbufread (crt.ats) and atscross (cl.ats) need not have the same value, this way you can read through the two ATS files at different rates.

## See also

ATSread, ATSreadnz, ATSinfo, ATSsinnoi, ATSbufread, ATSinterpread, ATSpartialtap, ATSadd, ATSaddnz

## Credits

Author: Alex Norman
Seattle,Washington
2004

Prev | Up | Next
ATSbufread | Home | ATSinfo