ATSaddnz
Prev | Orchestra Opcodes and Operators | Next

## ATSaddnz

ATSaddnz — uses the data from an ATS analysis file to perform noise resynthesis.

## Description

ATSaddnz reads from an ATS analysis file and uses the data to perform additive synthesis using a modified randi function.

## Syntax

    ar ATSaddnz ktimepnt, iatsfile, ibands[, ibandoffset, ibandincr]

## Initialization

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

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

ibandoffset (optional) – is the first noise band used (defaults to 0).

ibandincr (optional) – sets an increment by which these synthesis opcodes counts up from ibandoffset 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 ATSaddnz exactly the same as for pvoc and ATSadd.

ATSaddnz and ATSadd are based on pvadd by Richard Karpen and use files created by Juan Pampin's ATS (Analysis - Transformation - Synthesis).

ATSaddnz also reads from an ATS file but it resynthesizes the noise from noise energy data contained in the ATS file. It uses a modified randi function to create band limited noise and modulates that with a cosine wave, to synthesize a user specified selection of frequency bands. Modulating the noise is required to put the band limited noise in the correct place in the frequency spectrum.

## Examples

      ktime line     0, p3, 2.5
      asig  ATSaddnz ktime, "clarinet.ats", 25

In the example above we're synthesizing all 25 noise bands from the data contained in the ATS analysis file called "clarinet.ats".

## Examples

Here is a complete example of the ATSaddnz opcode. It uses the file ATSaddnz.csd.

Example 61. Example of the ATSaddnz 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 ATSaddnzwav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    instr 1	; "beats.ats" is created by atsa

    ktime	line     0, p3, 2
    asig	ATSaddnz ktime, "beats.ats", 1, 24
    	outs	asig*10, asig*10	;amplify
    endin

    </CsInstruments>
    <CsScore>

    i 1 0 2
    e

    </CsScore>
    </CsoundSynthesizer>

Here we synthesize only the 25th noise band (ibandoffset of 24 and ibands of 1).

Here is another example of the ATSaddnz opcode. It uses the file ATSaddnz-2.csd.

Example 62. Example 2 of the ATSaddnz opcode.

    <CsoundSynthesizer>
    <CsOptions>
    -odac -d -m1
    </CsOptions>
    <CsInstruments>
    ;example by joachim heintz
    sr = 44100
    ksmps = 32
    nchnls = 2
    0dbfs = 1

    instr AllTheNoise
    Sfile    =        "fox.ats"
             prints   "Resynthesizing with all the noise.\n"
    iDur     ATSinfo  Sfile, 7
    p3       =        iDur
    ktime    line     0, iDur, iDur
    asig     ATSaddnz ktime, Sfile, 25
             outs     asig, asig

    ;start next instr
             event_i  "i", "NoiseInBandsOfFive", iDur+1, 1, 0
    endin

    instr NoiseInBandsOfFive
    Sfile    =        "fox.ats"
             prints   "Resynthesizing with noise bands %d - %d.\n", p4, p4+5
    iDur     ATSinfo  Sfile, 7
    p3       =        iDur
    ktime    line     0, iDur, iDur
    asig     ATSaddnz ktime, Sfile, 5, p4
             outs     asig, asig

    ;start next instr
    if p4 < 20 then
             event_i  "i", "NoiseInBandsOfFive", iDur+1, 1, p4+5
    endif
    endin
    </CsInstruments>
    <CsScore>
    i "AllTheNoise" 0 1
    e 25
    </CsScore>
    </CsoundSynthesizer>

## See also

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

## Credits

Author: Alex Norman
Seattle,Washington
2004

Prev | Up | Next
ATSadd | Home | ATSbufread