atone
Prev | Orchestra Opcodes and Operators | Next

## atone

atone — A notch filter whose transfer functions are the complements of the tone opcode.

## Description

A notch filter whose transfer functions are the complements of the tone opcode.

## Syntax

    ares atone asig, khp [, iskip]

## Initialization

iskip (optional, default=0) -- initial disposition of internal data space. Since filtering incorporates a feedback loop of previous output, the initial status of the storage space used is significant. A zero value will clear the space; a non-zero value will allow previous information to remain. The default value is 0.

## Performance

ares -- the output signal at audio rate.

asig -- the input signal at audio rate.

khp -- the response curve's half-power point, in Hertz. Half power is defined as peak power / root 2.

atone is a filter whose transfer functions is the complement of tone. atone is thus a form of high-pass filter whose transfer functions represent the “filtered out” aspects of their complements. However, power scaling is not normalized in atone but remains the true complement of the corresponding unit. Thus an audio signal, filtered by parallel matching tone and atone units, would under addition simply reconstruct the original spectrum.

This property is particularly useful for controlled mixing of different sources (see lpreson). Complex response curves such as those with multiple peaks can be obtained by using a bank of suitable filters in series. (The resultant response is the product of the component responses.) In such cases, the combined attenuation may result in a serious loss of signal power, but this can be regained by the use of balance.

## Examples

Here is an example of the atone opcode. It uses the files atone.orc and atone.sco.

Example 34. Example of the atone opcode.

    /* atone.orc */
    ; Initialize the global variables.
    sr = 22050
    kr = 2205
    ksmps = 10
    nchnls = 1

    ; Instrument #1 - an unfiltered noise waveform.
    instr 1
      ; Generate a white noise signal.
      asig rand 20000

      out asig
    endin

    ; Instrument #2 - a filtered noise waveform.
    instr 2
      ; Generate a white noise signal.
      asig rand 20000

      ; Filter it using the atone opcode.
      khp init 2000
      afilt atone asig, khp

      ; Clip the filtered signal's amplitude to 85 dB.
      a1 clip afilt, 2, ampdb(85)
      out a1
    endin
    /* atone.orc */

    /* atone.sco */
    ; Play Instrument #1 for two seconds.
    i 1 0 2
    ; Play Instrument #2 for two seconds.
    i 2 2 2
    e
    /* atone.sco */

## See Also

areson, aresonk, atonek, port, portk, reson, resonk, tone, tonek

Prev | Up | Next
aresonk | Home | atonek