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);
});

Extends

  • ISynthSource

Methods

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);
});

Inherited from

ts
ISynthSource.osc

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);
});

Inherited from

ts
ISynthSource.noise

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.3)
    .kaleid(4)
);

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

Inherited from

ts
ISynthSource.plasma

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);
});

Inherited from

ts
ISynthSource.moire

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);
});

Inherited from

ts
ISynthSource.voronoi

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);
});

Inherited from

ts
ISynthSource.gradient

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);
});

Inherited from

ts
ISynthSource.shape

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);
});
Inherited from
ts
ISynthSource.solid

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);
});
Inherited from
ts
ISynthSource.solid

src()

ts
src(layer?): this;

Sample the previous frame for feedback effects, or sample from another layer.

Self-feedback (no argument): 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

Cross-layer sampling (with layer argument): src(layer) samples from another layer's output, enabling hydra-style multi-output compositions. The sampled texture is still context-aware based on the current compilation target.

This is the core of feedback loops and multi-layer compositions - enabling effects like trails, motion blur, recursive patterns, and complex layered visuals. Equivalent to hydra's src(o0).

Parameters

ParameterTypeDescription
layer?TextmodeLayerOptional TextmodeLayer to sample from. If omitted, samples from self (feedback).

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);
});

Inherited from

ts
ISynthSource.src

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);
});

Inherited from

ts
ISynthSource.rotate

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);
});

Inherited from

ts
ISynthSource.scale

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);
});

Inherited from

ts
ISynthSource.scroll

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);
});

Inherited from

ts
ISynthSource.scrollX

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);
});

Inherited from

ts
ISynthSource.scrollY

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);
});

Inherited from

ts
ISynthSource.pixelate

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);
});

Inherited from

ts
ISynthSource.repeat

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);
});

Inherited from

ts
ISynthSource.repeatX

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);
});

Inherited from

ts
ISynthSource.repeatY

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);
});

Inherited from

ts
ISynthSource.kaleid

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);
});

Inherited from

ts
ISynthSource.polar

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);
});

Inherited from

ts
ISynthSource.twirl

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);
});

Inherited from

ts
ISynthSource.swirl

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);
});

Inherited from

ts
ISynthSource.mirror

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);
});

Inherited from

ts
ISynthSource.shear

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);
});

Inherited from

ts
ISynthSource.barrel

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);
});

Inherited from

ts
ISynthSource.pinch

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);
});

Inherited from

ts
ISynthSource.fisheye

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);
});

Inherited from

ts
ISynthSource.brightness

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);
});

Inherited from

ts
ISynthSource.contrast

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);
});

Inherited from

ts
ISynthSource.invert

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);
});

Inherited from

ts
ISynthSource.saturate

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);
});

Inherited from

ts
ISynthSource.hue

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);
});

Inherited from

ts
ISynthSource.colorama

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);
});

Inherited from

ts
ISynthSource.posterize

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);
});

Inherited from

ts
ISynthSource.luma

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);
});

Inherited from

ts
ISynthSource.thresh

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);
});
Inherited from
ts
ISynthSource.color

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);
});
Inherited from
ts
ISynthSource.color

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);
});

Inherited from

ts
ISynthSource.r

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);
});

Inherited from

ts
ISynthSource.g

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);
});

Inherited from

ts
ISynthSource.b

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);
});

Inherited from

ts
ISynthSource.shift

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);
});

Inherited from

ts
ISynthSource.gamma

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);
});

Inherited from

ts
ISynthSource.levels

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);
});

Inherited from

ts
ISynthSource.clamp

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);
});

Inherited from

ts
ISynthSource.seed

add()

ts
add(source, amount?): this;

Add another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.add

sub()

ts
sub(source, amount?): this;

Subtract another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.sub

mult()

ts
mult(source, amount?): this;

Multiply with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.mult

blend()

ts
blend(source, amount?): this;

Blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.blend

diff()

ts
diff(source): this;

Difference with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.diff

layer()

ts
layer(source): this;

Layer another source on top.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.layer

mask()

ts
mask(source): this;

Mask using another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.mask

screen()

ts
screen(source, amount?): this;

Screen blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.screen

overlay()

ts
overlay(source, amount?): this;

Overlay blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.overlay

softlight()

ts
softlight(source, amount?): this;

Soft light blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.softlight

hardlight()

ts
hardlight(source, amount?): this;

Hard light blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.hardlight

dodge()

ts
dodge(source, amount?): this;

Color dodge blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.dodge

burn()

ts
burn(source, amount?): this;

Color burn blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.burn

lighten()

ts
lighten(source, amount?): this;

Lighten blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.lighten

darken()

ts
darken(source, amount?): this;

Darken blend with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceSource 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);
});

Inherited from

ts
ISynthSource.darken

modulate()

ts
modulate(source, amount?): this;

Modulate coordinates using another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulate

modulateScale()

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

Modulate scale using another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateScale

modulateRotate()

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

Modulate rotation using another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateRotate

modulatePixelate()

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

Modulate pixelation using another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulatePixelate

modulateKaleid()

ts
modulateKaleid(source, nSides?): this;

Modulate kaleidoscope using another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateKaleid

modulateScrollX()

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

Modulate X scroll using another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateScrollX

modulateScrollY()

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

Modulate Y scroll using another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateScrollY

modulateRepeat()

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

Modulate repeat pattern with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateRepeat

modulateRepeatX()

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

Modulate X repeat with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateRepeatX

modulateRepeatY()

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

Modulate Y repeat with another source.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateRepeatY

modulateHue()

ts
modulateHue(source, amount?): this;

Modulate coordinates based on hue differences.

Parameters

ParameterTypeDescription
source| SynthParameterValue | ISynthSourceModulation 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);
});

Inherited from

ts
ISynthSource.modulateHue

charMap()

ts
charMap(chars): this;

Parameters

ParameterType
charsstring

Returns

this

Inherited from

ts
ISynthSource.charMap

charColor()

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

Parameters

ParameterType
rOrSource| SynthParameterValue | ISynthSource
g?SynthParameterValue
b?SynthParameterValue
a?SynthParameterValue

Returns

this

Inherited from

ts
ISynthSource.charColor

char()

ts
char(source): this;

Parameters

ParameterType
sourceSynthSource

Returns

this

Inherited from

ts
ISynthSource.char

cellColor()

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

Parameters

ParameterType
rOrSource| SynthParameterValue | ISynthSource
g?SynthParameterValue
b?SynthParameterValue
a?SynthParameterValue

Returns

this

Inherited from

ts
ISynthSource.cellColor

paint()

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

Parameters

ParameterType
rOrSource| SynthParameterValue | ISynthSource
g?SynthParameterValue
b?SynthParameterValue
a?SynthParameterValue

Returns

this

Inherited from

ts
ISynthSource.paint

clone()

ts
clone(): SynthSource;

Returns

SynthSource

Inherited from

ts
ISynthSource.clone