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.

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.
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.
| Control | Range or options | Default |
|---|---|---|
| width | 16 to 4096 | 1024 |
| height | 16 to 4096 | 1024 |
| animate | on or off | on |
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