Source node

Sketch

Draws an image from a JavaScript sketch you write in the node, with loops, arrays and recursion and a p5.js-style API (rect, circle, line, beginShape, push/pop, translate, rotate, text). A mistake shows its line number and the last working picture stays up. Drop an .svg on the canvas to animate it by id.

Download the patchRead it in the Field Guide

The Sketch node in Infinite, showing its controls and output.

What it does

Sketch is a source node: it makes a picture from nothing, so it sits at the start of a visual chain. It has no input and gives picture out, so it starts a chain.

Try it

Write one param("size", 50, 5, 200) call and wire an LFO into the knob it creates.

LFOSketch (size)Output

Inputs and outputs

Inputs

  • None. It starts a chain.

Outputs

  • picture out

Controls

Every control with a range can be driven by a modulator, a note, an audio level or a sketch.

ControlRange or optionsDefault
width16 to 40961024
height16 to 40961024
animateon or offon

Example patch

This patch wires Sketch to what it needs and shows the result. Download it, then use File, Open in Infinite, or read it here: it is plain text.

infinite-patch 1
rev 2
# Sketch: a starting patch for the Sketch node
node 1 Source Sketch
  id node
  pos 520 300
end
node 2 Utility Output
  id out
  pos 1080 300
end
cable out 0 node

More source nodes