• Rob George

Week 14: Generative Poetry

FINAL PROJECT


For this final assignment I created a Beatnik Free Verse Poetry Generator that generates a COVID themed poem every time you click. I used string arrays, functions, and minim (sound) to create this generator. The words I chose were words that relate to the COVID crisis the world is in right now. Mainly words that are meant to bring some humor but also touch some memories of this past year.


For those who don't know, Free Verse Poetry, according to poetryfoundation.org, is “Nonmetrical, non-rhyming lines that closely follow the natural rhythms of speech. A regular pattern of sound or rhythm may emerge in free-verse lines, but the poet does not adhere to a metrical plan in their composition.”


My Original Sketch


I originally wanted to have a light source like a spotlight shining onto the beatnik bongo player while the text was randomly placed next to him. I also wanted there to be snapping every time a poem was generated.


The word choices I picked were meant to give it a playful memory of this past year's struggles with COVID-19. I made sure to pick some words that also allowed for some serious poems to be generated from the string array lists.



Beatnik Bongo Player Vector Illustrations (Left = Draft & Right = Final)



I thought having the light source and randomly placed text was a little much for a beatnik personality so I took a simpler approach. I used a brick background, nice legible left aligned text that randomly change size, and the sounds of snapping and bongos playing at the beginning of each generated line of poetry. The only issue with this generator is it takes so long to render and generate a new line. I don't really know why yet.


First Version (Vertical)


Second and Preferred Version (Horizontal)


//generative poetry

//takes a while to load each click


import ddf.minim.*;


String[] line1={"My", "His", "Her", "The", "Their", "Our"};

String[] line2={"Room", "Zoom Meeting", "Internet", "Stress", "Toilet Paper", "Food", "Money", "Patience", "Tolerance", "Virus", "Mask", "Plastic Bag", "Paper Bag", "Anxiety"};

String[] line3={"Feels Awful", "Isn't Working", "Lacks Function", "Feels Great", "Looks Good"};

String[] line4={"Pantry", "Wallet", "Fridge", "Freezer", "The Store", "Curb-Side", "The Bank", "Home", "Stimulus Check"};

String[] line5={"Is", "Was", "Will Be", "Can't Be"};

String[] line6={"Out of Stock", "Empty", "Too Far", "Unavailable", "Safe", "Infected", "Available"};


//"Ran Out", "Isn't Working", "Fell Off", "Blew Up", "Feels Awful", "Lacks Function", "Increases"


float circleX=300;

float diam=50;

float xSpeed=5;

int y = 65;

PFont myFont;

PImage beatnik;

PImage bricks;

PImage bricks2;

PImage bricks3;

PImage bricks4;

PImage bricks5;


Minim minim;

AudioPlayer bongos;

AudioPlayer fingerSnaps;


void setup() {

size(600, 400);

background (0);

String[] fontList = PFont.list();

printArray(fontList);

myFont=loadFont("SitkaSubheading-Bold-48.vlw");

textFont(myFont, 20);

fill(255);

new_sentence();

}



void new_sentence() {

background (0); //reset the background

bricks=loadImage("pexels-frans-van-heerden-1022692.jpg");

bricks2=loadImage("pexels-henry-&-co-1901028.jpg");

bricks3=loadImage("pexels-madison-inouye-1101125.jpg");

bricks4=loadImage("pexels-pixabay-276514.jpg");

bricks5=loadImage("pexels-pixabay-276514 (1).jpg");


//BACKGROUND

//image(bricks, 0, 0, 1203, 803); //dimensions 6016x4016 divided by 5

//image(bricks2, 0, 0, 979, 652); //dimensions 4896x3264 divided by 5

//image(bricks3, 0, 0, 1365, 910); //dimensions 4096x2730 divided by 3

image(bricks4, 0, 0, 621, 466); //dimensions 3729x2797 divided by 4+5

//image(bricks5, 0, 0, 621, 466); //dimensions 3729x2797 divided by 6

fill(25,75);

rect(0,0,600,400);

//CHARACTER

//beatnik=loadImage("beatnik bongo player.png");

//image(beatnik, 160, 150, 324, 568); //dimensions 1619x2838 divided by 5

//beatnik=loadImage("beatnik_2.png");

//image(beatnik, 160, 150, 344, 586); //dimensions 1719x2930 divided by 5

beatnik=loadImage("beatnik_4.png");

image(beatnik, 330, 30, 286, 488); //dimensions 1719x2930 divided by 6


//COVID text on shirt

fill(random(255),random(255),random(255));

textMode(CENTER);

textSize(12);

text("COVID", 425, 241);


//Click Anywhere

fill(255);

textMode(CORNER);

textSize(20);

text("Click", 40, 350);

text("Anywhere", 40, 370);


//BONGOS AND SNAPPING SOUNDS

minim=new Minim(this);

bongos=minim.loadFile("265150_loopudu_cajoonbongotripple (online-audio-converter.com).mp3");

bongos.play();


minim=new Minim(this);

fingerSnaps=minim.loadFile("332603_vckhaze_finger-snaps (online-audio-converter.com).mp3");

fingerSnaps.play();


//POEM LINES

y=50; //reset the y so the poem will restart

write_word(line1);

write_word(line2);

write_word(line3);

write_word(line4);

write_word(line5);

write_word(line6);

}


void draw() {

}



void mousePressed() {

new_sentence();

}


void keyPressed() {

//SAVE KEY

if (key=='s') {

int random_number=int(random(1000));

save(random_number+"robert.george"+"_generative.poetry"+".png");

}

}


//RANDOMIZES WORDS

void write_word(String[]words) {

int n=(int)random(words.length);

textSize(random(20, 40));

text(words[n], 40, y);

y=y+40; //sets the leading of the words

}




< Return to Coding Page

3 views0 comments