atsbufread
Reads an ATS data file and stores frequency and amplitude pairs in an internal table.
Deprecated alias
ATSbufreadis a deprecated alias ofatsbufreadin Csound 7. Useatsbufreadin new code. The old name still works for compatibility.
Syntax
Initialization
iatsfile – the ATS number (n in ats.n) or the name in quotes of the analysis file made using ATSA.
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. It stores data for atscross, atsinterpread and atspartialtap, without producing an output signal itself. The time pointer ktimepnt selects a position in the file. The arguments ipartials, ipartialoffset and ipartialincr select the partials to store, and kfmod scales their frequencies.
Reader scope and order
In Csound 7, each instrument instance has its own current atsbufread. Each UDO and subinstrument instance also has its own reader. A reader inside a UDO or subinstrument does not replace its parent's reader, and a consumer inside it cannot use the parent's reader. Separate notes cannot share a reader through this implicit connection, even when they use the same instrument number.
Put atsbufread and its consumers in the same instance, with the reader before the consumers. If several readers run there, each consumer uses the last reader that ran in that instance. During performance, this follows execution order, so a consumer can use a different reader on a later control cycle.
atspartialtap and atsinterpread need a local reader when they initialize. atscross can initialize before its reader, but the reader must have filled its buffer before atscross runs during performance. Keeping the reader first handles both cases.
Older versions used one current reader across Csound. To update an orchestra that relied on a reader in another note, UDO or subinstrument, add an atsbufread in the instance that consumes the data. These scope rules also apply to the uppercase aliases and to both filename and numeric file arguments.
Examples
Here is an example of the atsbufread opcode. It uses the file atsbufread-modern.csd.
Here is an example of the ATSbufread opcode. It uses the file ATSbufread.csd.
See also the examples for atscross, atsinterpread and atspartialtap
See also
Credits
Author: Alex Norman
Seattle,Washington
2004