The creative potential of random

Dr Ben Swift

COMP1720 guest lecture

randomness is everywhere in generative art

let’s learn to wield it

what we’ll cover

a little history

the types that matter

mapping — making it creative

if you’re reading these slides at home, watch the video

a little history

chance is older than the computer

older than computers

musikalisches würfelspiel — 18th-century dice music

aleatoric composition — 20th century

chance has always been an artistic tool

not all randomness is created equal

(but this isn’t a maths lecture)

uniform

every value in the range equally likely

random(min, max)

the workhorse

gaussian

clustered around a middle, rarer at the edges

randomGaussian()

the bell curve

discrete

a fixed set of outcomes, weighted how you like

random([a, b, c])

dice, coins, choices

weighting, the cheap way

const loaded = [1, 2, 2, 2, 2, 3, 4, 5, 6];
const roll = random(loaded);

repeat the values you want more often

weighting, the deliberate way

if (random(100) < 10) {
  // the 10% branch
} else {
  // the other 90%
}

mapping is where the art is

what do you do with the random number?

pitch, position, colour, size, timing…

choosing where not to be random matters just as much

the balance between predictability and surprise

that’s the craft

re-creating static

loadPixels();
for (let i = 0; i < pixels.length; i++) {
  pixels[i] = random() < 0.5 ? 0 : 255;
}
updatePixels();

re-creating Blue Poles?

🤔

thanks

[email protected] · benswift.me