twenty-one chance operations. fortune telling and meditation examples: tarot, i ching, astrology...

26
twenty-one chance operations

Post on 21-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

twenty-one

chance operations

Page 2: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Fortune telling and meditation

Examples:Tarot, I Ching, Astrology

Introduce chance operations into a system of signs Results are “meaningless” But we give them meaning

after the fact

Garfinkel’s breaching experiments

Page 3: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

there is no noise

only signal

Page 4: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Chance operations

Fancy term for “randomness”

A way of taking your ego out of the loop Get past your preconceived notions Creating surprise Creating juxtapositions that can create new meaning for you Could you draw a random line?

A way of automating decisions you don’t want to make Generating a terrain for

A way of automating decisions you can’t make Interactive art – the artist isn’t there to make the decisions

Page 5: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

The Art of Noise

[show[p → [× 256

[turbulence [× 0.001 p.X p.Y]]]]]

turbulence with a numeric argument

[show[p → [× 256 [cos [× 10 [turbulence [ ⁄ p 50]]]]]]]

Page 6: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Exquisite corpse

The surrealists used a variety of unusual composition techniques

Automatic writing Dreams as source material Chance operations

Why? They were followers of Freud They saw the conscious mind as

representative of the ills of society (repression, war, exploitation)

Unlock the unconscious Escape the sources of repression Recover a more “natural” state of the

psyche Open oneself up to the possibility of

delightful coincidence

Source: http://anexquisitecorpse.net/explanation.shtml

Page 7: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

The electric corpse

You now know enough to write programs to make exquisite corpse sentences

We just need one more primitive procedure [random-integer low high]

Returns a random number Greater than or equal to

low And less than high

[define random-get [list → [get list [random-integer 0

[length list]]]]]]

[define exquisite-corpse [→ [list [random-get nouns] [random-get verbs] [random-get nouns]]]]

Page 8: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

A more elegant version

It would be more elegant to have the code read like the grammar for English

A sentence is a noun phrase and a verb phrase

A verb phrase is a verb and a noun phrase

A noun phrase is a determiner and a noun

How would we write the code to work this way?

Need to write single-word-phrase And phrase-type

What should a phrase type be represented as?

[define article [single-word-phrase '[a the some any]]][define adjective [single-word-phrase '[green heavy …]]][define noun [single-word-phrase '[plant table …]]][define verb [single-word-phrase '[eat drink …]]]

[define np [phrase-type article adjective noun]][define vp [phrase-type verb np]][define sentence [phrase-type np vp]]

Page 9: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Writing the driver code

[define single-word-phrase

[words →

[→

[list [random-get words]]]]]

[define phrase-type

[subphrases ... →

[→

[apply append

[map [call : proc → [proc]]

subphrases]]]]]

Page 10: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Wow, man, deep…

Meta development environment,version 1.0.1528.32705Copyright © 2003 Northwestern University.► «Load the code»► [sentence][a green rain kill some green dubya]

► [sentence][any carnivorous rain drink any carnivorous

plant]

► [sentence][a magnificent cup eat some green plant]

► [sentence][the magnificent rain bite some green coffee]

► [sentence][some heavy coffee drink some carnivorous cup]

► [sentence][a heavy coffee drink a magnificent table]

► [sentence][the heavy cup defenestrate some carnivorous

coffee]

Page 11: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

John Cage, 4’33”

(excerpt)

Page 12: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

what did you hear?

Page 13: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

What the heck was that about?

Cage wanted people to listen to silence around them with the attitude they bring to a concert Listening is an active process of making meaning We can find rhythms in the sound of someone

speaking Or hear harmony in a power drill

Cage believed these could be just as musical as a symphony

Page 14: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Okay, but what does this have to dowith chance operations?

Silence isn’t silent It’s filled with sound

People walking down the hall The vibration of the HVAC units People giggling People shifting uncomfortably in their chairs

All of these can be heard as music If you don’t believe me Try sampling it and giving it to a DJ

Page 15: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Random compositions

Page 16: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Coding random algorithms

How do we code something like this?

Each image is A set of boxes

Of random size In random position With random color

So we need to make a bunch of random boxes

Then group them

Let’s start with making a random color …

Page 17: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Random colors

[define random-color[→ [color [random-integer 0 255] [random-integer 0 255] [random-integer 0 255] [random-integer 0 255]]]]

If you specify a fourth color component, it’s used as the opacity level or “alpha” channel

Page 18: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

A cleaner version

[define random-color[with component = [→ [random-integer 0 255]] [→ [color [component] [component] [component] [component]]]]

Page 19: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Making a random box

[define random-box

[max-width max-height →

[with random-point = [→ [point [random-integer 0 max-width]

[random-integer 0 max-height]]]

[box [random-point]

[random-point]]]]]

Box can be called two corners (points) as arguments

Page 20: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Abstracting it to other shapes

[define random-shape

[shape max-width max-height →

[with random-point = [→ [point [random-integer 0 max-width]

[random-integer 0 max-height]]]

[shape [random-point]

[random-point]]]]]

While we’re at it, we might as well put in the ability to make other kinds of shapes (like ellipses) too

Page 21: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Making a random box

[define boxer “Return a randomly colored random box”

[→ [paint [random-color]

[random-shape box 200 200]]]]

Page 22: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

And now a bunch of boxes

[define boxes “A picture with box-count random boxen”

[box-count → [apply group

[iterate boxer box-count]]]]

And we need a helper procedure:[define iterate “Call φ count times and return a list of the results.”

[φ count → [up-to count

[call : ignore → [φ]]]]]

Page 23: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Running it

► [boxes 5]

► [boxes 10]

Page 24: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Stochastic grammars

The electric corpse code was random and recursive

But the randomness was just in word selection

Not in the grammar

To change the grammar, we need to randomly select procedures

[define random-call [proc-list args ... → [apply [random-get proc-list] args]]]

[define verb-phrase [→ [random-call [list verb [phrase-type verb noun-phrase] [phrase-type verb noun-phrase noun-phrase]]]]]

Page 25: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Random (and dull, and colorless)stained-glass windows

[define hsplit [width height → [check valid-box? [recenter [stack-left [random-box [ ⁄ width 2] height] [random-box [ ⁄ width 2] height]]]]]]

[define vsplit [width height → [check valid-box? [recenter [stack-top [random-box width [ ⁄ height 2]] [random-box width [ ⁄ height 2]]]]]]]

[define box-operators [list hsplit vsplit]] «Add more to taste»

[define random-box [width height → [if [or [< width 25] [< height 25]] [box width height] [random-call box-operators width height]]]]

Page 26: Twenty-one chance operations. Fortune telling and meditation Examples: Tarot, I Ching, Astrology Introduce chance operations into a system of signs Results

Trying it

► [random-box 128 128]

► [define box-operators [list box vsplit vsplit vsplit hsplit hsplit]]

► [random-box 256 256]