A mesostic generator coded in Python & Django (original 2013, refactored 2014); to be used in future sessions of Modern & Contemporary American Poetry MOOC on Coursera.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


About P.S.: Meso

(author: Nicki Hoffman)


Al Filreis of the University of Pennsylvania leads a MOOC on Coursera, called Modern and Contemporary American Poetry (a.k.a "ModPo"). Poems studied include experimental and aleatory/chance-based works, among them the "mesostics" of John Cage. In the first run of the course, students used an online mesostic generator called the "Mesostomatic," written by Matthew McCabe, to make and analyze mesostics of their own. However, the program had its quirks and did not necessarily follow Cage's rules for mesostics, and moreover, McCabe took it down sometime after the MOOC ended in late 2012. A few months after I began learning Python, I decided to try writing my own and see if I could do better.

The program

Originally coded in Python 3.3 in April 2013, with minor adjustments to make it compatible with Python 2.7, as that is the version supported at the time by Django projects on my host (pythonanywhere.com). Web framework Django. I include in this repository the original program and framework, including the templates and css.

I was still new to Python, my first OO language, when I coded the original, and was as yet mostly unfamiliar with classes (and with other useful features, such as filter() and lambda functions). In December 2014, I refactored the code to clean it up, simplify it where possible and remove redundancy. I include in the repository the refactored model as ps_meso.py.

The program is to be ported to PHP by ModPo's tech team in early 2015, so that it can be mirrored on the university's servers for use in the next iteration of the MOOC.

Original in situ program can be found at: http://vyh.pythonanywhere.com/psmeso/
Refactored version here: http://vyh.pythonanywhere.com/psmeso2/

About Mesostics

A "mesostic" is a deterministally generated poem with some chance elements. It is generated by "reading through" a source text with a chosen word or phrase that will be the spine of the completed poem. Words included must follow a few rules, below. The spine text is often the name of the source text's author or of the mesostic's creator.

Criteria of a mesostic:

  1. Between 2 spine letters, neither letter may appear in lowercase;
  2. Limit of 45 characters left of the spine, same to the right;
  3. (Cage: "Then I take out the words I don't want."
    My interpretation: Don't add all possible words between spine letters.)

For some of his mesostics, at least, Cage used chance operations based on the I Ching to determine which words to include. More about mesostics in general and Cage's in particular here: