Skip to content

textmode.synth.js / SynthSource / src

Method: src()

ts
src(): this;

Sample the previous frame for feedback effects.

src() samples the current layer's previous frame. The sampled texture is context-aware based on where it's used in the synth chain:

  • Inside char(...) → samples previous frame's character data
  • Inside charColor(...) → samples previous frame's primary color (character foreground)
  • Inside cellColor(...) → samples previous frame's cell color (character background)
  • Outside all three → samples previous frame's primary color

This is the core of feedback loops - enabling effects like trails, motion blur, and recursive patterns. Equivalent to hydra's src(o0) (self-reference).

To sample from another layer, use the top-level src(layer) function instead.

Returns

this

Example