API reference

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

C

classGranularEffect

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

Granular synthesis filter - slices input into small Hann-windowed grains and replays them with randomized parameters. Use cases: - Ambient texture: long grain (200ms+), low density (10-30/s), high spread, pitch range 0.5-1.5x. Creates evolving pad-like sounds. - Glitch: short grain (10-20ms), high density (100+/s), very high spread, pitch range 0.7-1.3x. Stuttering, lo-fi effects. - Time-stretch (low pitch with overlap): grain ~50ms, density 50/s, spread 0, pitch 1.0. Pseudo-stretches the input by buffering. - Pitch cloud: medium grain, medium density, pitchMin 0.5, pitchMax 2.0 gives a "shimmer" effect of overlapping pitches.

9
props
3
methods
0
events
Import
import { GranularEffect } from '@codexo/exojs-audio-fx'

Granular synthesis filter - slices input into small Hann-windowed grains and replays them with randomized parameters. Use cases:

- Ambient texture: long grain (200ms+), low density (10-30/s), high spread, pitch range 0.5-1.5x. Creates evolving pad-like sounds. - Glitch: short grain (10-20ms), high density (100+/s), very high spread, pitch range 0.7-1.3x. Stuttering, lo-fi effects. - Time-stretch (low pitch with overlap): grain ~50ms, density 50/s, spread 0, pitch 1.0. Pseudo-stretches the input by buffering. - Pitch cloud: medium grain, medium density, pitchMin 0.5, pitchMax 2.0 gives a "shimmer" effect of overlapping pitches.

Constructors1
new(options: GranularEffectOptions): GranularEffect
Methods3
_onWorkletReady(): void
Subclass hook - called once the worklet is loaded and inserted into the wet path. Use for additional wiring (e.g. a sidechain input).
_setAudioParam(name: string, value: number): void
Ramps an AudioParam on the underlying AudioWorkletNode to value using a short exponential ramp. No-ops if the worklet is not yet loaded. Part of the effect SDK contract for extension audio effects.
destroy(): void
Disconnects all nodes, cancels any pending worklet load, and releases resources.
Properties9
density: number
Number of grains spawned per second. Range 1..500, default 50.
grainSize: number
Duration of each grain in seconds. Range 0.005..0.5, default 0.05.
inputNode: AudioNode
The node where audio enters this effect.
outputNode: AudioNode
The node where audio exits this effect.
pitchMax: number
Maximum per-grain pitch ratio. Range 0.25..4, default 1.0.
pitchMin: number
Minimum per-grain pitch ratio. Range 0.25..4, default 1.0.
ready: Promise<void>
Resolves once the worklet is loaded and inserted into the wet path. Also resolves when the load fails - the effect then stays the clean passthrough it is until the worklet arrives, and the failure is reported through the engine log rather than by rejecting.
spread: number
Random time-offset spread for grain start positions, 0..1. Higher values scatter grains further into the past. Default 0.5.
wet: number
Wet (processed) mix level, 0..1. The dry level is automatically 1 - wet. Ramped smoothly.
Source