ocannoli-Book

John Mulaney's Comedy Hour                        By Dr. Suess

Link to Chapters

This is a generative Dr.Suess book but with a twist. It's a mashup of standup comedy John Mulaney in the stylings of Dr. Suess.

Most of my ideas involved mashing two genres of literature together and eventually I decided I really wanted to make a Dr. Suess book. However, just making a Dr. Suess book seemed boring, so my initial idea was to make a dirty version of Dr. Suess. After hearing the lectures by Parrish and Sloan, the concept of specificity stuck with me, so I decided to combine Dr.Suess with one of my favorite stand-up comedians John Mulaney. Initially, I spent a lot of time trying to use stresses, syllables, and creating rhyme schemes to replicate the style of Dr. Suess more accurately. However, the results seemed stale, too forced, and most importantly were not that interesting. So I decided to scratch that idea and start experimenting more with markov chains. Ultimately, I liked the results but did not delve into it as much as I wanted too. If I was to continue this project, I would want to manipulate the results from the markov chain more to fit a better rhyme scheme and have a standardized stress pattern that could be different for each book. Additionally, the images were not as in depth as I wanted for originally I wanted to generate unique Dr. Suess "shapes" or simple illustrations, but instead they are just images taken from online. Overall, I think this is a good starting point but needs work in the execution for a final product.

var rhyme,rhymeBunch,line1, markov, data1, data2, x = 160, y = 240;
var img; 
function preload() {
 
  data1 = loadStrings('john.txt');
  data2 = loadStrings('suess.txt');
  //data3 = loadStrings('Readme_en.txt');
  //data4 = loadStrings('ReadMe.txt');
}
 
function setup() {
 
  createCanvas(500, 500);
  textFont('times', 16);
  textAlign(LEFT);
 
 
  line1 = ["click to (re)generate!"];
 
  // create a markov model w' n=4
  markov = new RiMarkov(2);
 
  // load text into the model
  markov.loadText(data1.join(' '));
  markov.loadText(data2.join(' '));
  //markov.loadText(data3.join(' '));
  //markov.loadText(data4.join(' '));
 
  drawText();
}
 
function drawText() {
 
  background(250);
  text(line1, x, y, 400, 400);
}
 
function mouseClicked() {
 
  x = y = 50;
  var repeat=true;
  while (repeat==true){
  line1 = markov.generateSentence(1);
  line1= new RiString(line1);
  line1.toLowerCase();
  line1.replaceChar(0, line1.charAt(0).toUpperCase());
  line1=String(line1)
  line1=line1.replace(/[\[\]']+/g,''); 
  linesList=line1.split(" ");
 	rhyme=linesList[(linesList.length)-1];
  rhymeBunch=RiTa.rhymes(rhyme);
  if (rhymeBunch.length>2){
    repeat=false;
  }
  }
  for (i=0;i<1;i++){
     var nLine = markov.generateSentence(1);
    var nList=nLine.split(" ");
    var spot=int(random(rhymeBunch.length-1));
    var newRhyme=rhymeBunch[spot];
    var oldSpot=(nList.length);
    nLine=new RiString(nLine);
    nLine.replaceWord(oldSpot,newRhyme);
    nLine.toLowerCase();
    nLine=String(nLine);
    nLine=nLine.replace(/[\[\]']+/g,'');
    line1=line1+" "+nLine;
    var testLength=line1.split(" "); 
    if (testLength.length < 12){
      i-=1;
    }
 
  }
 
  drawText();
}