LowPassFilterA low-pass filter audio effector that attenuates frequencies above a configurable cutoff frequency. It is commonly used to remove high-frequency content, smooth signals, or create filter sweeps.
Internally this effector runs its filtering inside the LowPassFilterProcessor AudioWorklet processor.
Extends Effector.
import { LowPassFilter } from "@fluex/fluexgl-dsp";
const lowPass = new LowPassFilter({
cutoff: 1200,
q: 0.7
});
...
channel.addEffect(lowPass);
new LowPassFilter(options: Partial<LowPassFilterOptions>): LowPassFilter;
options: Partial<LowPassFilterOptions>
Low-pass filter configuration options (cutoff, minFrequency, q, strictMode). Falls back to the class defaults below for any field that is missing or not a finite number.label: string | nullCustom label for this effector. Defaults to "LowPassFilter".
name: stringInternal name for this effector. Defaults to "LowPassFilter".
cutoff: numberCutoff frequency in Hz. Defaults to 1000.
q: numberResonance/Q factor, clamped between 0.0001 and 4 by setQ(). Defaults to 0.7.
minFrequency: numberLower bound applied to cutoff by setCutoff(). Defaults to 10.
strictMode: StrictModeValidation mode passed through to the processor. Defaults to StrictMode.Disabled.
initializeOnAttachment(context: AudioContext): Promise<void>Initializes the filter by creating the AudioWorklet processor node (LowPassFilterProcessor) with the current option values.
context: AudioContextPromise<void>returnOptionsAsObject(): LowPassFilterOptionsReturns a plain object snapshot of the current cutoff, minFrequency, q and strictMode values.
setCutoff(cutoff?: number): booleanUpdates cutoff, clamped to at least minFrequency and to the current context's sample rate, and forwards the change to the AudioWorklet processor.
cutoff?: number - Defaults to 1000 when omitted.boolean - false if this effect has no context yet, otherwise the result of sending the message to the processor.setMinFrequency(minFrequency?: number): booleanUpdates minFrequency (floored at 10) and forwards the change to the AudioWorklet processor.
minFrequency?: number - Defaults to 10 when omitted.booleansetQ(q?: number): booleanUpdates q, clamped between 0.0001 and 4, and forwards the change to the AudioWorklet processor.
q?: number - Defaults to 0.7 when omitted.booleanInherited from Effector (incoming-processor-message, incoming-processor-warning, incoming-processor-error, processor-wasm-instantiated).
This class does not define public getters or setters.