ChorusA chorus audio effector that creates a thickened, widened sound by duplicating the signal, modulating delay times, and mixing the result back with the dry signal.
This effector is typically used for pads, leads, and guitars to add depth and movement.
Extends Effector.
import { Chorus } from "@fluex/fluexgl-dsp";
const chorus = new Chorus({
baseDelayMs: 15,
depthMs: 8,
rateHz: 1.5,
mix: 0.5,
feedback: 0.2
});
...
channel.addEffect(chorus);
new Chorus(options: Partial<ChorusEffectOptions>): Chorus;
options: Partial<ChorusEffectOptions>
Chorus configuration options. Every field is optional and falls back to the class defaults below; numeric fields are also clamped (baseDelayMs/depthMs/rateHz to >= 0, mix/feedback to [0, 1]).label: string | nullCustom label for this effector. Defaults to "Chorus".
name: stringInternal name for this effector. Defaults to "Chorus".
baseDelayMs: numberBase modulation delay, in milliseconds. Defaults to 15.
depthMs: numberModulation depth, in milliseconds. Defaults to 8.
rateHz: numberModulation rate, in Hertz. Defaults to 1.5.
mix: numberDry/wet mix, between 0 and 1. Defaults to 0.5.
feedback: numberFeedback amount, between 0 and 1. Defaults to 0.2.
strictMode: StrictModeValidation mode passed through to the processor. Defaults to StrictMode.Disabled.
initializeOnAttachment(context: AudioContext): Promise<void>Initializes the chorus effect by creating the AudioWorklet processor node (ChorusProcessor) with the current option values.
context: AudioContextPromise<void>returnOptionsAsObject(): ChorusEffectOptionsReturns a plain object snapshot of the current baseDelayMs, depthMs, rateHz, mix, feedback and strictMode values. Used internally to initialize the AudioWorklet node.
setBaseDelayMs(value: number): booleanUpdates baseDelayMs (clamped to >= 0) and forwards the change to the AudioWorklet processor.
value: numberboolean - true if the message was sent to the processor, false if the effect has not been initialized yet.setDepthMs(value: number): booleanUpdates depthMs (clamped to >= 0) and forwards the change to the AudioWorklet processor.
value: numberbooleansetRateHz(value: number): booleanUpdates rateHz (clamped to >= 0) and forwards the change to the AudioWorklet processor.
value: numberbooleansetMix(value: number): booleanUpdates mix (clamped to [0, 1]) and forwards the change to the AudioWorklet processor.
value: numberbooleansetFeedback(value: number): booleanUpdates feedback (clamped to [0, 1]) and forwards the change to the AudioWorklet processor.
value: numberbooleanInherited from Effector (incoming-processor-message, incoming-processor-warning, incoming-processor-error, processor-wasm-instantiated).
This class does not define public getters or setters.