Tear Module — Modulation LFO (BIA-specific)

An internal modulation oscillator used by the BIA Clone engine. Creates a sine-wave LFO that modulates the terrain harmonics and decimation parameters.

Used only by the BIA Clone engine (engines/bia-clone.js).

Exports

Export Signature Purpose
paramDefs {} 3 parameter definitions (tearRate, tearToHarmonics, tearToDeci)
build (ctx) → {input, output, nodes} Creates an LFO oscillator + two gain nodes for Harmony and Deci modulation
update (nodes, params) → undefined Updates LFO rate and modulation depths on existing nodes
stop (nodes) → undefined Stops the LFO oscillator (previously it ran permanently)

Params

Param Range Default Label Description
tearRate 0.1–20 Hz 3 Rate LFO frequency
tearToHarmonics 0–1 0 → Harm Modulation depth to terrain harmonics
tearToDeci 0–1 0 → Deci Modulation depth to decimation amount

Signal Flow

lfo (sine oscillator) → harmG (gain) → terrain.harmonics input
                      → deciG (gain) → terrain.terrainDeci input

The LFO runs continuously while the live chain exists. In keyboard mode, stop() is called when the chain is replaced (via init-bia-clone.js), preventing orphaned LFO oscillators from accumulating.

Leak Fix

Previously the LFO was started with .start() and never stopped, causing a permanently running oscillator that accumulated on each buildLiveChain call. The stop() export was added to allow proper cleanup.