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.
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.
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:
- Between 2 spine letters, neither letter may appear in lowercase;
- Limit of 45 characters left of the spine, same to the right;
- (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: