EZ Web Audio / LFOConnectOptions
Interface: LFOConnectOptions
Defined in: packages/core/src/lfo.ts:31
Options for connecting an LFO to a target parameter.
Properties
depth?
optionaldepth:number
Defined in: packages/core/src/lfo.ts:75
Per-connection depth override (overrides LFO-level depth).
Note: For 'ratio' and 'cents' depthUnit, this value is multiplied against the target parameter's value at connection time. The resulting absolute depth is fixed for the lifetime of the connection.
depthUnit?
optionaldepthUnit:"ratio"|"cents"|"absolute"
Defined in: packages/core/src/lfo.ts:67
Depth unit: 'ratio' (most params), 'cents' (frequency), or 'absolute'.
Note: When depthUnit is 'ratio' or 'cents', depth is calculated from the parameter's current value at connection time. If the parameter value changes later (e.g., gain is adjusted), the modulation depth will NOT automatically update. Use 'absolute' for fixed depth, or call disconnect()/connect() to recalculate.
Clamping: for 'ratio', depth is clamped to [0, 1] (documented range). For 'cents', negative depth is clamped to 0 (a negative value would only flip the LFO's phase). In both cases, if the target parameter's current value is at (or near) 0 — e.g. pan centered — depth is used directly as an absolute swing instead of a ratio of zero. 'absolute' is NOT clamped — it's the fixed-depth escape hatch and has no natural range to clamp against; a too-large absolute depth can still push a non-negative param (gain, frequency) below zero at the trough.
retrigger?
optionalretrigger:boolean
Defined in: packages/core/src/lfo.ts:48
Reset LFO phase on sound play event (default: false).
Same event-contract requirement as syncLifecycle — a target that never emits 'play' (PolySynth) logs a console.warn instead of silently doing nothing.
syncLifecycle?
optionalsyncLifecycle:boolean
Defined in: packages/core/src/lfo.ts:40
Sync LFO start/stop with sound play/stop events (default: false).
Requires the target to actually emit 'play'/'stop' (BaseSound subclasses, GrainPlayer). PolySynth does not — connecting with syncLifecycle: true against a PolySynth logs a console.warn and the option is a no-op; call lfo.start()/lfo.stop() manually instead.