# `tecs.audio.effects` ## Overview ::: api-overview **functions** - [`custom`](#tecs.audio.effects.custom) - [`eq`](#tecs.audio.effects.eq) - [`filter`](#tecs.audio.effects.filter) - [`limiter`](#tecs.audio.effects.limiter) - [`reverb`](#tecs.audio.effects.reverb) **types** - [`Spec`](#tecs.audio.effects.Spec) **values** - [`EQ`](#tecs.audio.effects.EQ) - [`FILTER`](#tecs.audio.effects.FILTER) - [`LIMITER`](#tecs.audio.effects.LIMITER) - [`REVERB`](#tecs.audio.effects.REVERB) ::: ::: api-group ## Functions ::: api-item tecs.audio.effects.custom ### `custom` _function_ ```nupp function( kind: integer, name: string, names: {[string]: integer}?, values: {[string]: number}?, params: string? ): Spec ``` A spec for a kind a library registered. #### Arguments `kind` - `integer` : what `Audio.registerEffect` returned `name` - `string` : the kind's name, for a snapshot `names` - `{[string]: integer}?` : parameter ids by name `values` - `{[string]: number}?` : starting values by name `params` - `string?` : bytes the library's `open` reads #### Returns [`Spec`](../../../../modules/tecs/audio/effects/index.html#tecs.audio.effects.Spec) : the spec ::: ::: api-item tecs.audio.effects.eq ### `eq` _function_ ```nupp function(options: {[string]: number}?): Spec ``` A three-band equalizer, flat until a band's gain moves. #### Arguments `options` - `{[string]: number}?` : gains in dB and frequencies in hertz: `lowGain`, `lowFrequency` (200), `midGain`, `midFrequency` (1000), `midQ` (1), `highGain`, `highFrequency` (5000) #### Returns [`Spec`](../../../../modules/tecs/audio/effects/index.html#tecs.audio.effects.Spec) : the spec ::: ::: api-item tecs.audio.effects.filter ### `filter` _function_ ```nupp function(options: { shape: string?, frequency: number?, q: number?, gain: number? }?): Spec ``` A biquad filter. #### Arguments `options` - `{ shape: string?, frequency: number?, q: number?, gain: number? }?` : `shape`: "lowpass" (the default), "highpass", "bandpass", "notch", "peak", "lowshelf" or "highshelf"; `frequency` in hertz (20000); `q` (0.707); `gain` in dB for the peak and shelves (0) #### Returns [`Spec`](../../../../modules/tecs/audio/effects/index.html#tecs.audio.effects.Spec) : the spec #### Raises | Type | Condition | | --- | --- | | `string` | for a shape it does not know | ::: ::: api-item tecs.audio.effects.limiter ### `limiter` _function_ ```nupp function(options: { ceiling: number?, release: number? }?): Spec ``` A lookahead peak limiter: nothing past `ceiling` leaves it. #### Arguments `options` - `{ ceiling: number?, release: number? }?` : `ceiling`, linear full scale (0.891, -1 dBFS, by default), and `release` in seconds (0.05) #### Returns [`Spec`](../../../../modules/tecs/audio/effects/index.html#tecs.audio.effects.Spec) : the spec ::: ::: api-item tecs.audio.effects.reverb ### `reverb` _function_ ```nupp function(options: {[string]: number}?): Spec ``` An algorithmic room, for a return bus. #### Arguments `options` - `{[string]: number}?` : each from zero to one: `size` (0.5), `damping` (0.5), `wet` (1), `dry` (0) and `width` (1) #### Returns [`Spec`](../../../../modules/tecs/audio/effects/index.html#tecs.audio.effects.Spec) : the spec ::: ::: ::: api-group ## Types ::: api-item tecs.audio.effects.Spec ### `Spec` _record_ ```nupp record Spec ``` What an insert builds: a kind, its parameter names, and their values. #### Members ::: api-overview **constructors** - [`constructor`](#tecs.audio.effects.Spec.constructor) **fields** - [`kind`](#tecs.audio.effects.Spec.kind) - [`name`](#tecs.audio.effects.Spec.name) - [`names`](#tecs.audio.effects.Spec.names) - [`params`](#tecs.audio.effects.Spec.params) - [`values`](#tecs.audio.effects.Spec.values) ::: ::: api-item tecs.audio.effects.Spec.constructor #### `constructor` _constructor_ ```nupp function( kind: integer, name: string, names: {[string]: integer}, values: {[integer]: number}, params: string ): tecs.audio.effects.Spec ``` Constructs an instance from named fields. Optional fields may be omitted. ##### Arguments `kind` - `integer` : Required. Read-only. The native kind. `name` - `string` : Required. Read-only. The kind's name, for a snapshot. `names` - `{[string]: integer}` : Required. Read-only. Parameter ids by name, for `Effect.set`. `values` - `{[integer]: number}` : Required. Read-only. Starting values by parameter id. `params` - `string` : Required. Read-only. Bytes a registered kind's `open` reads, empty for a built-in. ##### Returns [`tecs.audio.effects.Spec`](../../../../modules/tecs/audio/effects/index.html#tecs.audio.effects.Spec) : the constructed instance ##### Examples Using values of the argument types above: ```nupp local value = require("tecs.audio.effects").Spec( kind = kind, name = name, names = names, values = values, params = params ) ``` ::: ::: api-item tecs.audio.effects.Spec.kind #### `kind` _field_ ```nupp kind: integer ``` Read-only. The native kind. ::: ::: api-item tecs.audio.effects.Spec.name #### `name` _field_ ```nupp name: string ``` Read-only. The kind's name, for a snapshot. ::: ::: api-item tecs.audio.effects.Spec.names #### `names` _field_ ```nupp names: {[string]: integer} ``` Read-only. Parameter ids by name, for `Effect.set`. ::: ::: api-item tecs.audio.effects.Spec.values #### `values` _field_ ```nupp values: {[integer]: number} ``` Read-only. Starting values by parameter id. ::: ::: api-item tecs.audio.effects.Spec.params #### `params` _field_ ```nupp params: string ``` Read-only. Bytes a registered kind's `open` reads, empty for a built-in. ::: ::: ::: ::: api-group ## Values ::: api-item tecs.audio.effects.EQ ### `EQ` _variable_ ```nupp const EQ: integer ``` ::: ::: api-item tecs.audio.effects.FILTER ### `FILTER` _variable_ ```nupp const FILTER: integer ``` ::: ::: api-item tecs.audio.effects.LIMITER ### `LIMITER` _variable_ ```nupp const LIMITER: integer ``` Built-in kinds, as the native mixer numbers them. ::: ::: api-item tecs.audio.effects.REVERB ### `REVERB` _variable_ ```nupp const REVERB: integer ``` ::: :::