Skip to content

textmode.synth.js / SynthContext

Interface: SynthContext

Context passed to dynamic parameter functions during rendering.

Example

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

t.layers.base.synth(
  noise((ctx) => 6 + Math.sin(ctx.time) * 4)
    .kaleid(5)
);

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

Properties

PropertyTypeDescription
timenumberCurrent time in seconds
frameCountnumberCurrent frame count
widthnumberGrid width in pixels
heightnumberGrid height in pixels
colsnumberGrid columns
rowsnumberGrid rows
bpmnumberCurrent BPM (beats per minute) for array modulation timing
onError?(error, uniformName) => voidOptional callback for handling dynamic parameter evaluation errors