API reference

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

C

classRingModulatorEffect

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

Ring modulator effect using native Web Audio nodes (no worklet required). A carrier `OscillatorNode` is connected directly to the `gain` AudioParam of a `GainNode` whose base gain value is 0. The carrier's bipolar output (±1) modulates the gain, multiplying the input signal by the instantaneous carrier amplitude - the mathematical definition of ring modulation. The result contains the sum and difference frequencies of the input and carrier but suppresses the original carrier (unlike amplitude modulation, which retains the carrier). At sub-audio carrier frequencies (< 20 Hz) the effect becomes a tremolo. Node graph: ``` input(GainNode) ┬── dryGain ──────────────────────────┐ │ ├── output(GainNode) └── ringGain ── wetGain ────────────────┘ carrierOsc ── ringGain.gain (AudioParam, base = 0) ``` Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`; `ringGain.gain` base = 0 (carrier provides the ±1 modulation).

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

Ring modulator effect using native Web Audio nodes (no worklet required).

A carrier `OscillatorNode` is connected directly to the `gain` AudioParam of a `GainNode` whose base gain value is 0. The carrier's bipolar output (±1) modulates the gain, multiplying the input signal by the instantaneous carrier amplitude - the mathematical definition of ring modulation. The result contains the sum and difference frequencies of the input and carrier but suppresses the original carrier (unlike amplitude modulation, which retains the carrier). At sub-audio carrier frequencies (< 20 Hz) the effect becomes a tremolo.

Node graph: ``` input(GainNode) ┬── dryGain ──────────────────────────┐ │ ├── output(GainNode) └── ringGain ── wetGain ────────────────┘

carrierOsc ── ringGain.gain (AudioParam, base = 0) ``` Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`; `ringGain.gain` base = 0 (carrier provides the ±1 modulation).

Constructors1
Methods1
destroy(): void
Disconnects all audio nodes and releases resources. Must be called when the effect is no longer needed.
Properties6
frequency: number
Carrier oscillator frequency in Hz. Range 0..20000, default 440. Changes are ramped smoothly 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.
ready: Promise<void>
Resolves when the effect is fully initialized. Defaults to immediately-resolved for sync effects.
waveform: OscillatorType
Carrier oscillator waveform shape. Default 'sine'. Changes take effect immediately (no smoothing; waveform transitions are instantaneous in Web Audio).
wet: number
Wet (ring-modulated) mix level, 0..1. The dry level is automatically 1 - wet. Changes are ramped smoothly via setTargetAtTime. Default 1.0.
Source