ATSbufread
Prev | Orchestra Opcodes and Operators | Next

## ATSbufread

ATSbufread — reads data from and ATS data file and stores it in an internal data table of frequency, amplitude pairs.

## Description

ATSbufread reads data from and ATS data file and stores it in an internal data table of frequency, amplitude pairs.

## Syntax

    ATSbufread ktimepnt, kfmod, iatsfile, ipartials[, ipartialoffset, \
              ipartialincr]

## Initialization

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

ipartials – number of partials that will be used in the resynthesis (the noise has a maximum of 25 bands)

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 ATSbufread 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.

ATSbufread is based on pvbufread by Richard Karpen. ATScross, ATSinterpread and ATSpartialtap are all dependent on ATSbufread just as pvcross and pvinterp are on pvbufread. ATSbufread reads data from and ATS data file and stores it in an internal data table of frequency, amplitude pairs. The data stored by an ATSbufread can only be accessed by other unit generators, and therefore, due to the architecture of Csound, an ATSbufread must come before (but not necessarily directly) any dependent unit generator. Besides the fact that ATSbufread doesn't output any data directly, it works almost exactly as ATSadd. The ugen uses a time pointer (ktimepnt) to index the data in time, ipartials, ipartialoffset and ipartialincr to select which partials to store in the table and kfmod to scale partials in frequency.

## Examples

Here is an example of the ATSbufread opcode. It uses the file ATSbufread.csd.

Example 57. Example of the ATSbufread opcode.

    <CsoundSynthesizer>
    <CsOptions>
    ; Select audio/midi flags here according to platform
    -odac     ;;;RT audio out
    ;-iadc    ;;;uncomment -iadc for RT audio input is needed too
    ; For Non-realtime ouput leave only the line below:
    ; -o ATSbufread.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    sr = 44100
    ksmps = 32
    nchnls = 2
    0dbfs = 1

    instr 1	; "beats.ats" and  "fox.ats" are created by atsa

    ktime	line	0, p3, 4
    ktime2	line	0, p3, 4
    kline	expseg	0.001, .3, 1, p3-.3, 1
    kline2	expseg	0.001, p3, 3
      	ATSbufread ktime2, 1, "fox.ats", 20
    aout	ATScross   ktime, 2, "beats.ats", 1, kline, 0.001 * (4 - kline2), 180
    	outs aout*2, aout*2

    endin

    </CsInstruments>
    <CsScore>
    ; sine wave.
    f 1 0 16384 10 1

    i 1 0 4
    e
    </CsScore>
    </CsoundSynthesizer>

See also the examples for ATScross, ATSinterpread and ATSpartialtap

## See also

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

## Credits

Author: Alex Norman
Seattle,Washington
2004

Prev | Up | Next
ATSaddnz | Home | ATScross