Category Archives: Code as Poetry

Today’s Class… Too Intense! Must Dump Notes!


take a text — a speech, a long poem, part of a book
list the parts of speech

graham aldis: political speech generator based on bush’s speeches, emphasizing the generic re-combinatory nature of the source texts

play a madlib
print some out: go outside

Japanese Haiku:

Originally haiku was the hokku, or starting verse of a renga (a collaborative poem containing several stanzas, each stanza written by different or alternating poets). The hokku was about nature and gave a season word so that the collaborators knew what time of year the renga encompassed. Eventually the hokku became independent of the renga and became known as haiku.

The traditional form of Japanese haiku has seventeen onji. Onji, most of them considered as one syllable in English, led modern haiku to having three lines containing seventeen syllables (5-7-5). But onji has shorter sounds than our English language. Sometimes two or three onji characters can be translated to one syllable in English. Many haiku translators believe ten to twelve English syllables would best be used to mimic the original Japanese sound- length form.

Three translations of Basho:

Bio of Basho:

Haiku Gen

“The” adjective noun

verb adverb

“It is” adjective

n = unix line break


Mersenne Twister algorithm
Far longer period and far higher order of equidistribution than any other implemented generators. (It is proved that the period is 2^19937-1, and 623-dimensional equidistribution property is assured.)

* Want to use for cryptography.
Mersenne Twister is not cryptographically secure. (MT is based on a linear recursion. Any pseudorandom number sequence generated by a linear recursion is insecure, since from sufficiently long subsequence of the outputs, one can predict the rest of the outputs.)

Mersenne primes:

Many early writers felt that the numbers of the form 2n-1 were prime for all primes n, but in 1536 Hudalricus Regius showed that 211-1 = 2047 was not prime (it is 23.89). By 1603 Pietro Cataldi had correctly verified that 217-1 and 219-1 were both prime, but then incorrectly stated 2n-1 was also prime for 23, 29, 31 and 37. In 1640 Fermat showed Cataldi was wrong about 23 and 37; then Euler in 1738 showed Cataldi was also wrong about 29. Sometime later Euler showed Cataldi’s assertion about 31 was correct.

Enter French monk Marin Mersenne (1588-1648). Mersenne stated in the preface to his Cogitata Physica-Mathematica (1644) that the numbers 2n-1 were prime for

n = 2, 3, 5, 7, 13, 17, 19, 31, 67, 127 and 257

and were composite for all other positive integers n < 257. Mersenne's (incorrect) conjecture fared only slightly better than Regius', but still got his name attached to these numbers. Definition: When 2n-1 is prime it is said to be a Mersenne prime. What's Up with Primes? large random prime numbers are used in most cryptographic systems more:

Did somebody say Subjectivity and Pataphysics?

Exquite Corpse Roll Sheet
No names — just words.

How low can you go? That is, if you’re using a base 2 system to reference powers of 10?

And what is up with octal? You hear me octal? I’m callin’ you out! And your buddy hex!

And as for you, ASCII numerical conversion table….

Round 2 of the name generator workshop.
Two lists of words enter, one name leaves….

More Fun!!
The next program we’ll be modifying will be a Haiku generator. This is a little more complicated in that you’ll have to list words by part of speach and number of sylables. Formatting Counts! Your grade is on the line!!!! OMG ! ! OMG ! 1 ! 1 !

In light of the seriousness of this issue, a separate post will be dedicated entirely to Text Variable Formatting for the Haiku Generator. Will I finish these instructions for you later today? This, I do not know. You will be notified…

Is haiku kind of cheezy? I’ll let you be the judge. Just keep in mind that you’re working up to Chatterbot Modification. Victory will be sweet.

I’d like you to read pages 75 – 101 in Words Made Flesh.

If you’d like to “focus” your reading, please look especially hard at:
pp 75-77 : Tristan Tzara and the Dadist poem
pp 80-83 : Italio Calvino and Machine Generated Lit.
pp 88-92 : Oulipo and Pataphysics

Our own Mathew Timmons will be giving a presentation on the Oulipo next week. This comes just in time for the Noulipo events at REDCAT.

Oh. You will be ready.

Increasingly terse reminder!
It’s now week 6. If you aren’t posting in your blog on a weekly basis, you will get no credit for this class. If you don’t plan to write, please stay home.

Hey, here’s something you could write about!
Discordian Games. Mostly traditional game formats with open or constantly fluxuating rules. Think about what makes a game interesting or fun — is it the pure act of play? Or is it the particular set of restrictions? Games, poems, programs — all tightly restricted, rule-bound activities. Think about it.

I said think about it!!!

internet is shit

Get Your Motor Running

Today, we check out your first try at composing a generative text with nothing but vocabulary arrays and random seed texts.
Whossa whassa?
Don’t worry. We’ll go through it in class. Baby steps.

Thhose of you who posted your lists of words get to see the results of your labor effortlessly reprocessed by Machines. Oh yeah.
And if you didn’t do it… damn. You are so busted. You couldn’t post a minimum of 50 semi-random words to your blog? Daaaammmn.

Just to recap: we’re at week 5 here. We can call the first two weeks “prep time,” but prep is over! It is now time to Generate!

If you didn’t do the assignment this week, you must still do it for next week. However now you must come up with a minimum of 75 words in each of two lists. And if you did the assignment with the absolute bare minimum of 25 words, I’d like you to try it again after seeing the results up on the big screen. In front of everybody. Something to consider from an authorial perspective: what is the smallest vocabulary size that gives you an interesting result? How many times is it interseting? Weh or why not?

Cent Mille Milliards de Poèmes (100 million billion poems) by Raymond Queneau

Ten interchangable sonnets, each with fourteen lines:
10^14 = a very large number…

Here’s a nice graphical implimentation:

The next generator we’re going to work on is a haiku generator. To begin, start coming up with lists of nouns, verbs, adjectives and adverbs, listed with their number of syllables. Further specific instructions will be delivered on a need to know basis….

For those who like to read ahead, the next-after-next generator you’ll be modifying will be Eliza. If you want to see what that’s all about, look up some implimentations of Joseph Weizenbaum’s (in)famous chatterbot on the web.

Tom Hater
Once again, Dan has been commanding the machines to do his bidding. Have they obeyed him? You be the judge….

You should read the Florian Crammer sections on Oulipo. I’ll get you those page numbers in class.

If you didn’t do the name generator this week:
You must post two lists of words, with a minimum 75 words in each list (150 words total, minimum) for next week’s class.

If you haven’t done the I Ching:
You still have to do that, don’t you?

If you haven’t posted in your blog this month:
Please. Get some sleep, will ya?

Code Time

So, you’ve thrown the I Ching. Aleatory textual systems — you kinda get it. In fact, you’re feeling pretty good about your command of multiple stochastic variables as a generator of modular meaning structures. But are you ready for a little server side PHP script hacking?

Oh yeah. Oh hell yeah.

I wasn’t sure about this… but your fearless TA Dan Richert shown us the way with a thoughtful, detailed boo-yah directed at the subject of Random Seed Variables in the Wu Name Generator.

We’ll get there. First, we have some ground to cover….

online ASCII goodness:

Please Note: using an oracle is not consulting an external system – – it is placing yourself within a system as one aspect of it

about numerology:

a ridiculously elaborate interpreter:

a deliberately obfuscating interpreter:

Hebrew numerology

the gematria server

Name Generators
pseudo randomness and random seeds

Wu Name:
Code as Poetry = Foolish Knight

Cube Name – beta 1:
Code as Poetry = Youthful Virtuoso

Cube Name – beta 2:
Code as Poetry = Princess Gold Coin Professor


Create two vocabulary lists for the Name Generator script.

We will use this script to generate a text based on user input. It does not need to be a “name generator” — you could make it anything you want that can be created from two separate lists of words.

Your lists must each be a minimum of 25 words long, but the longer the list, the more interesting your results.

You must post your lists to your blog by Monday.

(If you don’t want the long string of words to mess up your blog format, use the “more” tag. )

The Abyss

Hexagram 29: K’an
Water above Water

=== ===
=== ===
=== ===
=== x ===


Water flowing on continuously forms the repeated K’an. The superior man, in accordance with this, maintains constantly the virtue of his heart and the integrety if his conduct, and practices the business of instruction.

Bottom six:

Showing its subject in the double defile, and yet entering a cavern within it. There will be evil.


29: Without Form

You may walk upon the water while the ice is on the river. But when the ice melts the pathway has no form. With awareness you can endure the absence of known pathways until the trackless becomes familiar.

Thus you create a path upon the featureless terrain of the new, the dangerous, the unexplored and ever shifting. Let the light from the flame of your mind, beyond thoughts, be the guide now, as it has in the past.

There are many dangers in a trackless ocean if you are without skill or a compass. But for those with both, adventure and fortune lies in facing and traversing the unfathomable seas of life.

Meeting the unknown then becomes a way of life. In the trackless, one needs to return to the simple and great truths of life left us by sages, or uncovered in our own search for the truth that has no form.

Water is a great teacher regarding this. It flows on despite the terrain, filling depressions, passing over rocks, falling great heights, all without changing its innate nature. So the changeless in us can meet all change.

Moving lines:

1. In a trackless way you are always lost unless you have supreme confidence and are centred upon what lies behind change. Now you have stumbled into a pit – a situation hard to get out of.

At Sacred Texts has more grim news on the change line:

Line 1 is weak, at the bottom of the figure, and has no correlate above, no helper, that is, beyond itself. All these things render the case of its subject hopeless. He will by his efforts only involve himself more deeply in danger.

29 with the first line changing becomes…

Hexagram 60: Disciplined Release

=== ===
=== ===
=== ===

There is much to receive, but there are difficulties in dealing with it.

Discipline is needed in balance with dropping restraints. To unbound restraint entirely leads to losing the resources now at hand. To be disciplined without yielding means constant and exhausting vigilance.

So let the water flow, but control as with a dam. There are enormous reserves, don’t waste them


Kieh intimates that (under its conditions) there will be progress and attainment. (But) if the regulations (which it prescribes) be severe and difficult, they cannot be permanent.

Readings for September

In Words Made Flesh by Florian Cramer, I’d like you to tackle as much of pages 14-55 (chapter 2) as you can handle. The gist of chapter 2 is looking at the various mythologies and religions that haunt our nice orderly code systems.

For those who are in a skimming mood, here’s the parts I’d like you to focus on:

• p. 14 – 20 on Magic and Religion

• p. 36 – 44 on Ramon Llull

• p. 53 – 55 is an outline of the “theological politics” that Cramer sees running through the poetic and cultural practices of code.

If you can only read a few pages, then read the outline and skim pp14-20.

Let me know how it goes in your blog (or email me if you have any particularly violent complaints….)

Day 1 – Forgetting

Although it’s our second class, it’s still Day 1. And not even for psychological reasons either — when programing, the first number in a series count is zero, because zero is itself a value. We’ll probably talk more about that at some point. I do like talking about number bases, but I’m not sure it translates very well. (Ha! Translates, get it? Ooh, zinger!)

Speaking of the value of nothingness, I just had several chuncks of today’s lecture unceremoniously vanish. For those of you who want to keep track of things like this, I believe it happened when I pressed the letter L on the keyboard. Let me know if that rings any bells.

Not that today’s lecture had been headed in a particularly linear direction (which, as I mentioned in class #0, will be an ongoing issue for us). But watching even that shifty tangle of threads poof away was a as visceral an exercise in the technologies of forgetting that I’ve had since the floppy disc misadventures of the late 80’s. That was back when floppy discs were still in fact “floppy” and the sturdiness of one’s Pee-Chee was all that stood between your ASCII art and the void…

But I digress.

For those of you who have successfully emailed me your blog address: your Handle shall be forthwith entered into the hallowed rolls of the Class Website. Kudos!

For those of you who are still stepping gingerly around the edges of the blog pool, be ye not afraid. Talk to me after class and we’ll get everything squared away.

If you’re reading this before class, wondering what to expect (my goodness, that would be ambitious of you) — it’s looking to be a jaunty romp down one particular 3000 year path of mnemotechnics, with pauses for reflection in ancient Greece, the Middle Ages, the Renaissance, and the Cold War. And for some reason, most of the little stories I want to tell involve murder, martyrdom, or suicide…

I guess that’s poetry for ya. What can you do.

Things will, of necessity, be more specific after class, so you should check back then for your value-added. See you then.

Welcome to Code as Poetry

Things to do…

  • • Apply comfortable lighting
  • • Say Hello.
  • • Name and email sheet pass around — begin!
  • • Brief overview of class topics.
  • • (Polite pause, waiting for misdirected/disappointed people to leave…)
  • • Introduce the slick class website, hosted at Machine Poetics. Ooh yeah.
  • • Go over the Inviolate Class Requirements (weekly writing, participation, attendance)
  • • Get ahold of the required text: Words Made Flesh by Florian Cramer
    It’s on the web as HTML, and it’s downloadable as a 3Mb PDF which looks very nice when printed. And, if you’re t0t4ly H4RdC0R3, it’s also available as the LaTeX source file [2 MB tar].
  • • Introduce Blogger. Blogger is friendly.
  • • Questions?
  • • Evaluate glaze in student eyeballs
  • • Depending on glaze, offer brief overview of Arbitrary Four Part Topic Structure
  • • Apologize for having done that
  • • More questions?
  • • Complete add/drop forms
  • • “have a nice day”