LowPassFilter

EntityAudioFilterceramic.LowPassFilter (Class)

A low-pass audio filter that attenuates frequencies above a cutoff point.

Low-pass filters allow low frequencies to pass through while reducing or eliminating high frequencies. Common uses include:

  • Removing high-frequency noise or hiss
  • Creating "muffled" or "underwater" effects
  • Simulating sounds heard through walls
  • Smoothing harsh digital audio
  • Bass isolation for subwoofer systems

The filter uses a biquad implementation for stable, efficient processing with adjustable resonance (Q factor) for frequency emphasis at the cutoff.

// Remove high frequencies above 2000Hz
var lowPass = new LowPassFilter();
lowPass.cutoffFrequency = 2000;
lowPass.gain = 1.0;

// Create a resonant low-pass sweep effect
var sweepFilter = new LowPassFilter();
sweepFilter.resonance = 8.0;  // High resonance for dramatic effect
app.onUpdate(this, delta -> {
    // Sweep cutoff from 200Hz to 5000Hz
    sweepFilter.cutoffFrequency = 200 + (Math.sin(Timer.now) + 1) * 2400;
});

// Apply to an audio mixer
audioMixer.addFilter(lowPass);

Instance Members

cutoffFrequency: Float

Cutoff frequency in Hz. Frequencies above this value will be attenuated. Range: 1 Hz to half the sample rate (Nyquist frequency). Default: 1000 Hz


gain: Float

Filter gain/amplitude multiplier. Adjusts the overall output level after filtering. Range: 0.0 to any positive value (1.0 = unity gain). Default: 1.0


resonance: Float

Filter resonance/Q factor. Controls the sharpness of the filter and frequency emphasis at the cutoff.

  • 0.707: No resonance (Butterworth response, flat passband)
  • < 0.707: Gentler rolloff
  • > 0.707: Sharper rolloff with peak at cutoff
  • High values (5-30): Creates strong resonant peak (self-oscillation) Range: 0.1 to 30.0 (higher values = more resonance) Default: 0.707

workletClass(): Class
Returns
Class<ceramic.LowPassFilterWorklet>

new(): Void

Metadata

Name Parameters
:build ceramic.macros.AudioFiltersMacro.buildFilter()
:autoBuild ceramic.macros.AudioFiltersMacro.buildFilter()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()