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