Kinetic Poetry

Kinetic poetry is an interactive form that I'm playing with. Words on the screen drift around and are drawn to each other, gradually sticking end to end, and accumulating into phrases. These phrases arrange themselves into successive lines of abstract poetry. You can grab any word and move it by dragging on it with your mouse; or you can get rid of a word by dragging it off the window. From time to time, new words pop into the fray, generally words that would go best with the ones already there.

You might want to read how it works..

- Ken Perlin

How it works

The program examines an existing poem and looks for the most frequent word-pairs. For each word, the most N frequent preceding and succeeding words are remembered. Each of these neighbor words is recorded, along with how many times it occurs near the word in question.

Words are chosen from the document to pop into the active window. The choice alternates between randomly selected words, and words that often appear near words that are already in the active window.

A kind of physics simulation is run in the active window. Each word is "magnetically" attracted to all the words within a specified distance from it. Its left edge is attracted by the right edge of other words, and its right edge is attracted by the left edge of other words. The strength of attraction increases between words that were often near each other in the original document. The strength of attraction drops off with increasing distance between the words.

The simulation is run by iterating through pairs of words in the active area. All candidate word pairs are considered in succession. In order to keep the animation running smoothly, display is updated at regular time intervals, independently of these continual readjustments in position.

In order to keep the words in a reasonable and pleasant arrangement, flocking behavior is employed. Words which are near each other generally have a slight repulsion for each other which is overcome only by the attraction of strongly attracting side edges of words. Also, all words are weakly attracted to the center of the active area. This attraction to the center tends to keep the entire flock on-screen and prevents any word from drifting away.

Source code: extends extends