API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classTremoloEffect

@codexo/exojs-audio-fx / audio / stable

Tremolo effect that amplitude-modulates the signal with a sine LFO using native WebAudio nodes. A sine-wave LFO drives a `GainNode`'s gain to produce the characteristic volume pulsing of tremolo. The base gain is `1 - depth` and the LFO peak deviation is `depth`, so the gain oscillates between `1 - 2 * depth` and `1`. Optionally the same LFO can drive a `StereoPannerNode.pan` for a synchronized auto-pan effect. Node graph (`autoPan = false`): ``` inputGain ┬── dryGain ──────────────────────────┐ │ ├── outputGain └── tremoloGain ── wetGain ─────────────┘ lfoOscillator ── lfoGain (depth) ── tremoloGain.gain ``` Node graph (`autoPan = true`): ``` inputGain ┬── dryGain ──────────────────────────────────┐ │ ├── outputGain └── tremoloGain ── panner ── wetGain ──────────┘ lfoOscillator ── lfoGain (depth) ── tremoloGain.gain lfoOscillator ── panGain (depth) ── panner.pan ``` Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`; `tremoloGain.gain` base = `1 - depth`.

7
props
1
methods
0
events
Import
import { TremoloEffect } from '@codexo/exojs-audio-fx'

Tremolo effect that amplitude-modulates the signal with a sine LFO using native WebAudio nodes.

A sine-wave LFO drives a `GainNode`'s gain to produce the characteristic volume pulsing of tremolo. The base gain is `1 - depth` and the LFO peak deviation is `depth`, so the gain oscillates between `1 - 2 * depth` and `1`. Optionally the same LFO can drive a `StereoPannerNode.pan` for a synchronized auto-pan effect.

Node graph (`autoPan = false`): ``` inputGain ┬── dryGain ──────────────────────────┐ │ ├── outputGain └── tremoloGain ── wetGain ─────────────┘

lfoOscillator ── lfoGain (depth) ── tremoloGain.gain ```

Node graph (`autoPan = true`): ``` inputGain ┬── dryGain ──────────────────────────────────┐ │ ├── outputGain └── tremoloGain ── panner ── wetGain ──────────┘

lfoOscillator ── lfoGain (depth) ── tremoloGain.gain lfoOscillator ── panGain (depth) ── panner.pan ```

Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`; `tremoloGain.gain` base = `1 - depth`.

Constructors1
Methods1
destroy(): void
Disconnects all audio nodes and releases resources. Must be called when the effect is no longer needed.
Properties7
autoPan: boolean
Whether auto-pan is enabled. Set at construction time via TremoloEffectOptions.autoPan; read-only at runtime. Default false.
depth: number
Modulation depth, 0..1. At 0 the effect is transparent; at 0.5 the gain briefly reaches zero at the trough; at depth>0.5 the gain goes negative (phase inversion). Default 0.7. Ramped via setTargetAtTime.
inputNode: AudioNode
The node where audio enters this effect. Throws if the audio context is not yet initialized.
outputNode: AudioNode
The node where audio exits this effect. Throws if the audio context is not yet initialized.
rateHz: number
LFO oscillation rate in Hz. Range 0..20, default 5. Ramped via setTargetAtTime when changed at runtime.
ready: Promise<void>
Resolves when the effect is fully initialized. Defaults to immediately-resolved for sync effects.
wet: number
Wet (tremolo) mix level, 0..1. The dry level is automatically 1 - wet. Default 1. Ramped via setTargetAtTime when changed at runtime.
Source