Skip to content

textmode.synth.js / SynthSource

Class: SynthSource

A chainable synthesis source that accumulates transforms to be compiled into a shader.

This is the core class that enables hydra-like method chaining for generating procedural textmode visuals. Each method call adds a transform to the chain, which is later compiled into a GLSL shader.

Example

javascript
const t = textmode.create({
  width: window.innerWidth,
  height: window.innerHeight,
  plugins: [SynthPlugin]
});

const synth = noise(10)
  .rotate(0.2)
  .scroll(0.1, 0)
  .charColor(osc(5, 0.1, 1.2).kaleid(4))
  .cellColor(osc(5, 0.1, 1.2).kaleid(4).invert())
  .charMap('@#%*+=-:. ');

t.layers.base.synth(synth);

t.windowResized(() => {
  t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Methods

charMap()

ts
charMap(chars): this;

Map character indices to a specific character set. This is the primary textmode-native way to define which characters to use.

Parameters

ParameterTypeDescription
charsstringA string of characters to map indices to

Returns

this

The SynthSource for chaining

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(char(noise(8)).charMap('@#%*+=-:. ').charColor(osc(6, 0.1, 1.2)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

charColor()

Call Signature

ts
charColor(source): this;

Set the character foreground color using a color source chain.

Parameters
ParameterTypeDescription
sourceSynthSourceA SynthSource producing color values, or RGBA values
Returns

this

The SynthSource for chaining

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).charColor(osc(6, 0.1, 1.2).kaleid(4)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Call Signature

ts
charColor(
   r, 
   g?, 
   b?, 
   a?): this;

Set the character foreground color using RGBA values.

Parameters
ParameterTypeDescription
rSynthParameterValueRed channel (0-1) or value
g?SynthParameterValueGreen channel (0-1) or value
b?SynthParameterValueBlue channel (0-1) or value
a?SynthParameterValueAlpha channel (0-1) or value
Returns

this

The SynthSource for chaining

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).charColor(1, 0.2, 0.1, 1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Call Signature

ts
charColor(gray): this;

Set the character foreground color using a grayscale value.

Parameters
ParameterTypeDescription
graySynthParameterValueGrayscale value (0-1)
Returns

this

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).charColor(0.9));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

char()

ts
char(source): this;

Set the character indices using a character source chain. The number of characters is determined by charMap() if defined, otherwise falls back to the total characters in the layer's font.

Parameters

ParameterTypeDescription
sourceSynthSourceA synth source producing character indices

Returns

this

The SynthSource for chaining

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(
	char(osc(6, 0.1, 1.2)).charMap('@#%*+=-:. ').charColor(osc(12, 0.05, 0.2)),
);

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

cellColor()

Call Signature

ts
cellColor(source): this;

Set the cell background colors using a color source chain.

Parameters
ParameterTypeDescription
sourceSynthSourceA SynthSource producing color values, or RGBA values
Returns

this

The SynthSource for chaining

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).cellColor(osc(6, 0.1, 1.2).invert()));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Call Signature

ts
cellColor(
   r, 
   g?, 
   b?, 
   a?): this;

Set the cell background color using RGBA values.

Parameters
ParameterTypeDescription
rSynthParameterValueRed channel (0-1) or value
g?SynthParameterValueGreen channel (0-1) or value
b?SynthParameterValueBlue channel (0-1) or value
a?SynthParameterValueAlpha channel (0-1) or value
Returns

this

The SynthSource for chaining

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).cellColor(0.05, 0.08, 0.1, 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Call Signature

ts
cellColor(gray): this;

Set the cell background color using a grayscale value.

Parameters
ParameterTypeDescription
graySynthParameterValueGrayscale value (0-1)
Returns

this

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).cellColor(0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

paint()

Call Signature

ts
paint(source): this;

Set both character foreground and cell background color using the same source chain. This is a convenience method that combines .charColor() and .cellColor() in one call.

After calling paint(), you can still override the cell color separately using .cellColor().

Otherwise useful for pixel art styles where both colors are the same, making the characters redundant.

Parameters
ParameterTypeDescription
sourceSynthSourceA SynthSource producing color values
Returns

this

The SynthSource for chaining

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).paint(osc(6, 0.1, 1.2).kaleid(4)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Call Signature

ts
paint(
   r, 
   g?, 
   b?, 
   a?): this;

Set both character foreground and cell background color using RGBA values.

Parameters
ParameterTypeDescription
rSynthParameterValueRed channel (0-1) or value
g?SynthParameterValueGreen channel (0-1) or value
b?SynthParameterValueBlue channel (0-1) or value
a?SynthParameterValueAlpha channel (0-1) or value
Returns

this

The SynthSource for chaining

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).paint(0.9, 0.8, 0.7));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Call Signature

ts
paint(gray): this;

Set both character foreground and cell background color using a grayscale value.

Parameters
ParameterTypeDescription
graySynthParameterValueGrayscale value (0-1)
Returns

this

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8).paint(0.3));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

clone()

ts
clone(): SynthSource;

Create a deep clone of this SynthSource. Useful when you want to create a modified version of an existing chain without affecting the original.

Returns

SynthSource

A new SynthSource with the same transform chain

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

const base = osc(6, 0.1, 1.2).kaleid(4);

t.layers.base.synth(noise(8).charColor(base).cellColor(base.clone().invert()));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

brightness()

ts
brightness(amount?): this;

Adjust brightness.

Parameters

ParameterTypeDescription
amount?SynthParameterValueBrightness adjustment amount (default: 0.4)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).brightness(0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

contrast()

ts
contrast(amount?): this;

Adjust contrast.

Parameters

ParameterTypeDescription
amount?SynthParameterValueContrast amount (default: 1.6)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).contrast(1.6));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

invert()

ts
invert(amount?): this;

Invert colors.

Parameters

ParameterTypeDescription
amount?SynthParameterValueInversion amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.35).invert(1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

saturate()

ts
saturate(amount?): this;

Adjust color saturation.

Parameters

ParameterTypeDescription
amount?SynthParameterValueSaturation amount (default: 2.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).saturate(2.5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

hue()

ts
hue(hue?): this;

Shift hue.

Parameters

ParameterTypeDescription
hue?SynthParameterValueHue shift amount (default: 0.4)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).hue(0.3));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

colorama()

ts
colorama(amount?): this;

Apply colorama effect (hue rotation based on luminance).

Parameters

ParameterTypeDescription
amount?SynthParameterValueEffect amount (default: 0.005)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(4, 0.1).colorama(0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

posterize()

ts
posterize(bins?, gamma?): this;

Posterize colors to limited palette.

Parameters

ParameterTypeDescription
bins?SynthParameterValueNumber of color bins (default: 3.0)
gamma?SynthParameterValueGamma correction (default: 0.6)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(gradient(0.2).posterize(4, 0.7));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

luma()

ts
luma(threshold?, tolerance?): this;

Apply threshold based on luminance.

Parameters

ParameterTypeDescription
threshold?SynthParameterValueThreshold value (default: 0.5)
tolerance?SynthParameterValueTolerance range (default: 0.1)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(10, 0.1, 1.2).luma(0.5, 0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

thresh()

ts
thresh(threshold?, tolerance?): this;

Apply hard threshold.

Parameters

ParameterTypeDescription
threshold?SynthParameterValueThreshold value (default: 0.5)
tolerance?SynthParameterValueTolerance range (default: 0.04)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(6, 0.1).thresh(0.4, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

color()

Call Signature

ts
color(gray): this;

Multiply all channels by a scalar value (grayscale).

Parameters
ParameterTypeDescription
graySynthParameterValueScalar multiplier
Returns

this

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).color(0.6));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Call Signature

ts
color(
   r?, 
   g?, 
   b?, 
   a?): this;

Colorize a grayscale source or multiply an existing color source.

This is the recommended way to add color to grayscale sources like osc(), noise(), or voronoi().

Parameters
ParameterTypeDescription
r?SynthParameterValueRed channel multiplier (default: 1.0)
g?SynthParameterValueGreen channel multiplier (default: 1.0)
b?SynthParameterValueBlue channel multiplier (default: 1.0)
a?SynthParameterValueAlpha channel multiplier (default: 1.0)
Returns

this

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(10, 0.1, 1.2).color(0.2, 0.6, 1.0));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

r()

ts
r(scale?, offset?): this;

Extract the red channel as a grayscale value.

Parameters

ParameterTypeDescription
scale?SynthParameterValueScale multiplier (default: 1.0)
offset?SynthParameterValueOffset amount (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).hue(0.4).r(1.2, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

g()

ts
g(scale?, offset?): this;

Extract the green channel as a grayscale value.

Parameters

ParameterTypeDescription
scale?SynthParameterValueScale multiplier (default: 1.0)
offset?SynthParameterValueOffset amount (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(gradient(0.2).g(1.2, 0.1).kaleid(5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

b()

ts
b(scale?, offset?): this;

Extract the blue channel as a grayscale value.

Parameters

ParameterTypeDescription
scale?SynthParameterValueScale multiplier (default: 1.0)
offset?SynthParameterValueOffset amount (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(gradient(0.2).colorama(0.2).b(1.2, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

shift()

ts
shift(
   r?, 
   g?, 
   b?, 
   a?): this;

Shift color channels by adding offset values.

Parameters

ParameterTypeDescription
r?SynthParameterValueRed channel shift (default: 0.5)
g?SynthParameterValueGreen channel shift (default: 0.0)
b?SynthParameterValueBlue channel shift (default: 0.0)
a?SynthParameterValueAlpha channel shift (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).shift(0.2, -0.1, 0.1, 0));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

gamma()

ts
gamma(amount?): this;

Apply gamma correction for nonlinear brightness control.

Parameters

ParameterTypeDescription
amount?SynthParameterValueGamma value (default: 1.0, < 1.0 brightens, > 1.0 darkens)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).gamma(1.4));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

levels()

ts
levels(
   inMin?, 
   inMax?, 
   outMin?, 
   outMax?, 
   gamma?): this;

Adjust input/output levels and gamma for precise tonal control.

Parameters

ParameterTypeDescription
inMin?SynthParameterValueInput minimum (default: 0.0)
inMax?SynthParameterValueInput maximum (default: 1.0)
outMin?SynthParameterValueOutput minimum (default: 0.0)
outMax?SynthParameterValueOutput maximum (default: 1.0)
gamma?SynthParameterValueGamma correction (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8, 0.1).levels(0.1, 0.9, 0.0, 1.0, 1.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

clamp()

ts
clamp(min?, max?): this;

Clamp color values to a specified range for stability.

Parameters

ParameterTypeDescription
min?SynthParameterValueMinimum value (default: 0.0)
max?SynthParameterValueMaximum value (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).add(osc(12, 0.1, 0.5), 0.6).clamp(0.2, 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

seed()

ts
seed(value): this;

Set a seed for deterministic randomness in this source chain.

When set, noise-based functions (noise, voronoi) will produce reproducible patterns. Different seeds produce different patterns.

Parameters

ParameterTypeDescription
valueSynthParameterValueSeed value (any number)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(10, 0.1).seed(42).charMap('@#%*+=-:. '));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

add()

ts
add(source, amount?): this;

Add another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to add
amount?SynthParameterValueBlend amount (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(3, 0.3).add(shape(4, 0.25).rotate(0.3), 0.5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

sub()

ts
sub(source, amount?): this;

Subtract another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to subtract
amount?SynthParameterValueBlend amount (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(100, 0.5).sub(shape(100, 0.3), 1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

mult()

ts
mult(source, amount?): this;

Multiply with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to multiply
amount?SynthParameterValueBlend amount (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.4).mult(noise(10, 0.1), 0.8).color(1, 0.5, 0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

blend()

ts
blend(source, amount?): this;

Blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to blend
amount?SynthParameterValueBlend amount (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(3, 0.3).blend(shape(4, 0.4), 0.5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

diff()

ts
diff(source): this;

Difference with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to compare

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).diff(osc(12, 0.2, 0.4)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

layer()

ts
layer(source): this;

Layer another source on top.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to layer

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).layer(osc(12, 0.2, 0.4).rotate(0.5), 0.5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

mask()

ts
mask(source): this;

Mask using another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to use as mask

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(gradient(0.2).mask(voronoi(6, 0.4, 0.2)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

screen()

ts
screen(source, amount?): this;

Screen blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to screen
amount?SynthParameterValueBlend amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).screen(osc(12, 0.2, 0.4), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

overlay()

ts
overlay(source, amount?): this;

Overlay blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to overlay
amount?SynthParameterValueBlend amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).overlay(osc(12, 0.2, 0.4), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

softlight()

ts
softlight(source, amount?): this;

Soft light blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to softlight
amount?SynthParameterValueBlend amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).softlight(osc(12, 0.2, 0.4), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

hardlight()

ts
hardlight(source, amount?): this;

Hard light blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to hardlight
amount?SynthParameterValueBlend amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).hardlight(osc(12, 0.2, 0.4), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

dodge()

ts
dodge(source, amount?): this;

Color dodge blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to dodge
amount?SynthParameterValueBlend amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).dodge(osc(12, 0.2, 0.4), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

burn()

ts
burn(source, amount?): this;

Color burn blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to burn
amount?SynthParameterValueBlend amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).burn(osc(12, 0.2, 0.4), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

lighten()

ts
lighten(source, amount?): this;

Lighten blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to lighten
amount?SynthParameterValueBlend amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).lighten(osc(12, 0.2, 0.4), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

darken()

ts
darken(source, amount?): this;

Darken blend with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueSource to darken
amount?SynthParameterValueBlend amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).darken(osc(12, 0.2, 0.4), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulate()

ts
modulate(source, amount?): this;

Modulate coordinates using another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
amount?SynthParameterValueModulation amount (default: 0.1)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).modulate(noise(3, 0.1), 0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateScale()

ts
modulateScale(
   source, 
   multiple?, 
   offset?): this;

Modulate scale using another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
multiple?SynthParameterValueScale multiplier (default: 1.0)
offset?SynthParameterValueOffset amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.35).modulateScale(osc(6, 0.1, 1.2), 1.5, 0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateRotate()

ts
modulateRotate(
   source, 
   multiple?, 
   offset?): this;

Modulate rotation using another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
multiple?SynthParameterValueRotation multiplier (default: 1.0)
offset?SynthParameterValueOffset amount (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.35).modulateRotate(noise(2, 0.1), 0.5, 0));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulatePixelate()

ts
modulatePixelate(
   source, 
   multiple?, 
   offset?): this;

Modulate pixelation using another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
multiple?SynthParameterValuePixelation multiplier (default: 10.0)
offset?SynthParameterValueOffset amount (default: 3.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(4, 0.1).modulatePixelate(osc(8, 0.1, 1.2), 20, 5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateKaleid()

ts
modulateKaleid(source, nSides?): this;

Modulate kaleidoscope using another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
nSides?SynthParameterValueNumber of sides (default: 4.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).modulateKaleid(osc(12, 0.2, 0.4), 7));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateScrollX()

ts
modulateScrollX(
   source, 
   scrollX?, 
   speed?): this;

Modulate X scroll using another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
scrollX?SynthParameterValueX scroll amount (default: 0.5)
speed?SynthParameterValueScroll speed (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).modulateScrollX(noise(3, 0.1), 0.5, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateScrollY()

ts
modulateScrollY(
   source, 
   scrollY?, 
   speed?): this;

Modulate Y scroll using another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
scrollY?SynthParameterValueY scroll amount (default: 0.5)
speed?SynthParameterValueScroll speed (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).modulateScrollY(noise(3, 0.1), 0.5, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateRepeat()

ts
modulateRepeat(
   source, 
   repeatX?, 
   repeatY?, 
   offsetX?, 
   offsetY?): this;

Modulate repeat pattern with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
repeatX?SynthParameterValueX repetitions (default: 3.0)
repeatY?SynthParameterValueY repetitions (default: 3.0)
offsetX?SynthParameterValueX offset (default: 0.5)
offsetY?SynthParameterValueY offset (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.25).modulateRepeat(osc(6, 0.1, 1.2), 3, 3, 0.2, 0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateRepeatX()

ts
modulateRepeatX(
   source, 
   reps?, 
   offset?): this;

Modulate X repeat with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
reps?SynthParameterValueNumber of repetitions (default: 3.0)
offset?SynthParameterValueOffset amount (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.25).modulateRepeatX(noise(3, 0.1), 3, 0.5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateRepeatY()

ts
modulateRepeatY(
   source, 
   reps?, 
   offset?): this;

Modulate Y repeat with another source.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
reps?SynthParameterValueNumber of repetitions (default: 3.0)
offset?SynthParameterValueOffset amount (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.25).modulateRepeatY(noise(3, 0.1), 3, 0.5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

modulateHue()

ts
modulateHue(source, amount?): this;

Modulate coordinates based on hue differences.

Parameters

ParameterTypeDescription
sourceSynthParameterValueModulation source
amount?SynthParameterValueModulation amount (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(src().modulateHue(src().scale(1.01), 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

rotate()

ts
rotate(angle?, speed?): this;

Rotate coordinates.

Parameters

ParameterTypeDescription
angle?SynthParameterValueRotation angle in radians (default: 10.0)
speed?SynthParameterValueRotation speed multiplier (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).rotate(0.4, 0.1).kaleid(5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

scale()

ts
scale(
   amount?, 
   xMult?, 
   yMult?, 
   offsetX?, 
   offsetY?): this;

Scale coordinates.

Parameters

ParameterTypeDescription
amount?SynthParameterValueScale amount (default: 1.5)
xMult?SynthParameterValueX axis multiplier (default: 1.0)
yMult?SynthParameterValueY axis multiplier (default: 1.0)
offsetX?SynthParameterValueX offset (default: 0.5)
offsetY?SynthParameterValueY offset (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.35).scale(1.6, 1.2, 0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

scroll()

ts
scroll(
   scrollX?, 
   scrollY?, 
   speedX?, 
   speedY?): this;

Scroll coordinates in both X and Y directions.

Parameters

ParameterTypeDescription
scrollX?SynthParameterValueX scroll amount (default: 0.5)
scrollY?SynthParameterValueY scroll amount (default: 0.5)
speedX?SynthParameterValueX scroll speed (default: 0.0)
speedY?SynthParameterValueY scroll speed (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(6, 0.1).scroll(0.2, -0.1, 0.05, 0.02));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

scrollX()

ts
scrollX(scrollX?, speed?): this;

Scroll coordinates in X direction.

Parameters

ParameterTypeDescription
scrollX?SynthParameterValueX scroll amount (default: 0.5)
speed?SynthParameterValueScroll speed (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).scrollX(0.3, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

scrollY()

ts
scrollY(scrollY?, speed?): this;

Scroll coordinates in Y direction.

Parameters

ParameterTypeDescription
scrollY?SynthParameterValueY scroll amount (default: 0.5)
speed?SynthParameterValueScroll speed (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).rotate(0.5).scrollY(-0.3, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

pixelate()

ts
pixelate(pixelX?, pixelY?): this;

Pixelate the output.

Parameters

ParameterTypeDescription
pixelX?SynthParameterValuePixel size in X (default: 20.0)
pixelY?SynthParameterValuePixel size in Y (default: 20.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(8, 0.1).pixelate(12, 8).color(0.9, 0.6, 0.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

repeat()

ts
repeat(
   repeatX?, 
   repeatY?, 
   offsetX?, 
   offsetY?): this;

Repeat coordinates in both X and Y directions.

Parameters

ParameterTypeDescription
repeatX?SynthParameterValueNumber of X repetitions (default: 3.0)
repeatY?SynthParameterValueNumber of Y repetitions (default: 3.0)
offsetX?SynthParameterValueX offset between repetitions (default: 0.0)
offsetY?SynthParameterValueY offset between repetitions (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.25).repeat(4, 3, 0.1, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

repeatX()

ts
repeatX(reps?, offset?): this;

Repeat coordinates in X direction.

Parameters

ParameterTypeDescription
reps?SynthParameterValueNumber of repetitions (default: 3.0)
offset?SynthParameterValueOffset between repetitions (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.25).repeatX(6, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

repeatY()

ts
repeatY(reps?, offset?): this;

Repeat coordinates in Y direction.

Parameters

ParameterTypeDescription
reps?SynthParameterValueNumber of repetitions (default: 3.0)
offset?SynthParameterValueOffset between repetitions (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.25).repeatY(6, 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

kaleid()

ts
kaleid(nSides?): this;

Apply kaleidoscope effect.

Parameters

ParameterTypeDescription
nSides?SynthParameterValueNumber of kaleidoscope sides (default: 4.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(6, 0.1, 1.2).kaleid(7).color(0.9, 0.2, 1.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

polar()

ts
polar(angle?, radius?): this;

Convert coordinates to polar space.

Parameters

ParameterTypeDescription
angle?SynthParameterValueAngle offset in radians (default: 0.0)
radius?SynthParameterValueRadius multiplier (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(gradient(0.2).polar(0.2, 1.2).kaleid(5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

twirl()

ts
twirl(
   amount?, 
   radius?, 
   centerX?, 
   centerY?): this;

Twirl distortion with radial falloff.

Parameters

ParameterTypeDescription
amount?SynthParameterValueTwirl strength (default: 2.0)
radius?SynthParameterValueEffect radius (default: 0.5)
centerX?SynthParameterValueCenter X (default: 0.5)
centerY?SynthParameterValueCenter Y (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(5, 0.35).twirl(1.5, 0.4));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

swirl()

ts
swirl(
   amount?, 
   centerX?, 
   centerY?): this;

Swirl distortion around a center.

Parameters

ParameterTypeDescription
amount?SynthParameterValueSwirl strength (default: 4.0)
centerX?SynthParameterValueCenter X (default: 0.5)
centerY?SynthParameterValueCenter Y (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(4, 0.1).swirl(3, 0.5, 0.5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

mirror()

ts
mirror(mirrorX?, mirrorY?): this;

Mirror coordinates across X and/or Y axes.

Parameters

ParameterTypeDescription
mirrorX?SynthParameterValueMirror X (0-1, default: 1.0)
mirrorY?SynthParameterValueMirror Y (0-1, default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).mirror(1, 0));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

shear()

ts
shear(
   x?, 
   y?, 
   centerX?, 
   centerY?): this;

Shear coordinates along X and Y axes.

Parameters

ParameterTypeDescription
x?SynthParameterValueX shear amount (default: 0.0)
y?SynthParameterValueY shear amount (default: 0.0)
centerX?SynthParameterValueCenter X (default: 0.5)
centerY?SynthParameterValueCenter Y (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(4, 0.3).shear(0.2, -0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

barrel()

ts
barrel(
   amount?, 
   centerX?, 
   centerY?): this;

Barrel distortion (bulge outward).

Parameters

ParameterTypeDescription
amount?SynthParameterValueDistortion amount (default: 0.5)
centerX?SynthParameterValueCenter X (default: 0.5)
centerY?SynthParameterValueCenter Y (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(gradient(0.2).barrel(0.6));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

pinch()

ts
pinch(
   amount?, 
   centerX?, 
   centerY?): this;

Pinch distortion (pull inward).

Parameters

ParameterTypeDescription
amount?SynthParameterValueDistortion amount (default: 0.5)
centerX?SynthParameterValueCenter X (default: 0.5)
centerY?SynthParameterValueCenter Y (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(gradient(0.2).pinch(0.6));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

fisheye()

ts
fisheye(
   amount?, 
   centerX?, 
   centerY?): this;

Fisheye lens distortion.

Parameters

ParameterTypeDescription
amount?SynthParameterValueDistortion amount (default: 1.0)
centerX?SynthParameterValueCenter X (default: 0.5)
centerY?SynthParameterValueCenter Y (default: 0.5)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).fisheye(0.8));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

osc()

ts
osc(
   frequency?, 
   sync?, 
   offset?): this;

Generate oscillating patterns using sine waves.

Parameters

ParameterTypeDescription
frequency?SynthParameterValueFrequency of the oscillation (default: 60.0)
sync?SynthParameterValueSynchronization offset (default: 0.1)
offset?SynthParameterValuePhase offset (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(osc(8, 0.1, 1.2).kaleid(5).color(0.9, 0.2, 1.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

noise()

ts
noise(scale?, speed?): this;

Generate Perlin noise patterns.

Parameters

ParameterTypeDescription
scale?SynthParameterValueScale of the noise pattern (default: 10.0)
speed?SynthParameterValueAnimation speed (default: 0.1)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(noise(10, 0.1).color(0.2, 0.6, 1.0));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

plasma()

ts
plasma(
   scale?, 
   speed?, 
   phase?, 
   contrast?): this;

Generate plasma-like sine field patterns.

Parameters

ParameterTypeDescription
scale?SynthParameterValueSpatial scale of the plasma (default: 10.0)
speed?SynthParameterValueAnimation speed (default: 0.5)
phase?SynthParameterValuePhase offset (default: 0.0)
contrast?SynthParameterValueContrast adjustment (default: 1.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(plasma(8, 0.6, 0.2, 1.4).kaleid(4));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

moire()

ts
moire(
   freqA?, 
   freqB?, 
   angleA?, 
   angleB?, 
   speed?, 
   phase?): this;

Generate moire interference patterns.

Parameters

ParameterTypeDescription
freqA?SynthParameterValueFrequency of first grating (default: 20.0)
freqB?SynthParameterValueFrequency of second grating (default: 21.0)
angleA?SynthParameterValueAngle of first grating in radians (default: 0.0)
angleB?SynthParameterValueAngle of second grating in radians (default: 1.5708)
speed?SynthParameterValueAnimation speed (default: 0.1)
phase?SynthParameterValuePhase offset (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(moire(14, 15, 0.2, 1.2, 0.2, 0.1).color(0.7, 0.5, 1.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

voronoi()

ts
voronoi(
   scale?, 
   speed?, 
   blending?): this;

Generate voronoi patterns.

Parameters

ParameterTypeDescription
scale?SynthParameterValueScale of voronoi cells (default: 5.0)
speed?SynthParameterValueAnimation speed (default: 0.3)
blending?SynthParameterValueBlending between cell regions (default: 0.3)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(voronoi(6, 0.4, 0.2).color(0.8, 0.4, 1.2));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

gradient()

ts
gradient(speed?): this;

Generate a rotating radial gradient.

Parameters

ParameterTypeDescription
speed?SynthParameterValueRotation speed (default: 0.0)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(gradient(0.2).kaleid(5));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

shape()

ts
shape(
   sides?, 
   radius?, 
   smoothing?): this;

Generate geometric shapes (polygons).

Parameters

ParameterTypeDescription
sides?SynthParameterValueNumber of sides (default: 3)
radius?SynthParameterValueRadius of the shape (default: 0.3)
smoothing?SynthParameterValueEdge smoothing amount (default: 0.01)

Returns

this

Example

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(shape(6, 0.35, 0.02).rotate(() => t.secs));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

solid()

Call Signature

ts
solid(gray): this;

Generate a solid grayscale color.

Parameters
ParameterTypeDescription
graySynthParameterValueGrayscale value (0-1)
Returns

this

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(solid(0.4).char(osc(6, 0.1, 1.2)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

Call Signature

ts
solid(
   r?, 
   g?, 
   b?, 
   a?): this;

Generate a solid color.

Parameters
ParameterTypeDescription
r?SynthParameterValueRed channel (0-1, default: 0.0)
g?SynthParameterValueGreen channel (0-1, default: 0.0)
b?SynthParameterValueBlue channel (0-1, default: 0.0)
a?SynthParameterValueAlpha channel (0-1, default: 1.0)
Returns

this

Example
javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(solid(0.1, 0.2, 0.5, 1).char(noise(8)));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});

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

javascript
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	plugins: [SynthPlugin],
});

t.layers.base.synth(src().scale(1.01).blend(osc(6, 0.1, 1.2), 0.1));

t.windowResized(() => {
	t.resizeCanvas(window.innerWidth, window.innerHeight);
});