Jul 182009
 

For the past year or so I’ve been working on a new media poem called Black River Ghosts.  While the work is nowhere near ready to be presented to the public, I’ve been using some of its functionality on the social networks, and in a few spots these test cases/previews have been actually garnering praise.

Anyone familiar with my work in networked literature knows I have an ongoing fascination with poetry generators–applications that write poems based on datasets and randomizing algorithms. The motivations behind this obsession are very simple, if problematic on the theory tip: a good poetry generator allows the “author” to relinquish control; other than providing a dataset and some compositional templates, the generative poet does not compose the generative poem. The poem is instead composed by a combination of the underlying code and the reader’s initializing of the application.

I have more than a thimbleful of thoughts as to why this is a worthwhile paradigm for new media poetry, and why I often feel new media poets who don’t at least dabble in the margins of this paradigm might be missing some of the point of a networked literature, but those will be saved for a future post. Instead, I’d like to introduce you to a PHP framework that I’ve been using to create the piece, and offer some thoughts on how working in this way requires a different conception of poem composition.

CakePHP is rapid application development framework for creating web apps with PHP, and, though I’m very much a n00b as far as its use goes, so far it seems the best choice for building complex applications quickly and with as little code as possible. CakePHP leverages the Model-View-Controller design pattern to modularize the various components of a software project. This means that the application is coceptualized as having 3 layers: a model, which represents a data source; a controller, which encompasses the logic involved in working with the data from the data source; and a view, which is comprised of all the presentational or visual display functionality. MVC applications separate these layers into seperate files, thus promoting reusability and easy refactoring.

The benefits of using MVC are obvious; you can very quickly set up the bones of your app, and very easily extend and revise it. CakePHP provides a framework for doing this by favoring “convention over configuration”; by applying conventions to file names, database table names, and other assets, CakePHP provides a structure that makes simply creating and writng methods for certain classes build a rich structure for your web application.

I started writing Black River Ghosts with CakePHP initially just to get my head around how to use the framework. I already had the beginnings of a dataset; a file of distinct lines of text i’d started for the project. It became obvious very quickly that I could better make use of CakePHP and the poetry if I broke the lines down into records keyed by grammar. I tagged the poetry with parts of speech: nouns, verbs, prepositions. And then I started adding to the dataset, building a table of lines of poetry that represented (very subjectively) parts of speech to me.

As I worked, I became aware of how composing poetry like this, directly into a database, with the thought that each line, each unit, would go toward composing a sentence, is a fundamentally different way of composing poems linearly, as the popular conception of poetry has taught us. The form imposes some limitations; if you’re relying on “states of consciousness,” you must rely on them in targeted bursts, and you must keep in mind that what you’re writing will be combined and recombined with all of the other elements in the set.

The resultant text, though, definitely has a rush to it. Because I’m working with phrases instead of bare words, the sentences flood with a certain lyricism I’m enjoying. As algorithmically-generated text, these early tests of my code are yielding results I like.

Be Sociable, Share!
Google+
 Posted by at 2:11 pm

  One Response to “Getting Baked with CakePHP: Notes on Black River Ghosts”

  1. Lewis,

    Let me see if I understand this: You initialize the poetry generation via the input of a data template based on your own compositions, and the “poetry generator” in turn, produces a “random composition”.

    Is that pretty close?

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>