Sketches

A Sketch note runs a p5.js sketch. Drop a .js file on a pad. Padjam draws the sketch's canvas into the picture like a clip, so transparent black, priority, Feedback and recording all work with it.

Sketches run in a sandbox: they can't reach Padjam's page, your stored performances or your files.

What a sketch can read

padjam.note, padjam.velocity The note playing it, and its velocity (0-127)
padjam.held, padjam.time Whether it's held, and milliseconds since the note started
padjam.cc[n] Controller values (0-127), for the controller set in its options
padjam.audio level, bass, mid, treble (0-1) and beat, from audio input
padjam.buffer The picture so far, as a p5.Graphics, with Reads the frame buffer on

A sketch can also define noteOn(note, velocity), noteOff(note) and controlChange(controller, value).

The sketch's window is the output's size, so createCanvas(windowWidth, windowHeight) fills the screen.

Tips

Examples

Padjam comes with example sketches: particles, bars, a starfield, an oscilloscope, words, tunnels, flow fields, and effects that mirror, glitch, pixelate or zoom what's underneath. They're in the examples/sketches folder.