Create a Poem with Max – 1

Today, I wrote a poem with Max for the first time. I set the theme of the poem as “a visitor in a futuristic aquarium”, and got a bunch of words relevant to this theme. Then, I started with a simple poem line structure: “article + adjective + noun + verb + adverb”. For each of the word categories, I used a message element to store the word list.

To get a random word from each category, I first got the list length using the “zl len” object, then used the “random” object to generate a random number between 1 and the list length number. Next, this random number is used as an index by the “zl lookup” object, which pulls out the word of this index from the word list.

Upon pressing the toggle at the top, the network will first output a line of the structure “The+ adjective + noun + verb”, followed by an adverb printed in the next line delayed by 2 seconds.

Problems & Solutions

Word List Initialization

Since the poem should be triggered by only one click, the initialization of the word lists should be done after the click and before the printing. Therefore, I used a “pack” object and put the word lists on the right of the “metro” object so that they get initialized before the metro starts.

However, this is not sufficient. After doing so, I still get the poem with the first few lines incomplete. This means that the “zl lookup” objects need more time to process before the “pack” object is triggered. Therefore, I added a “delay” object between the button and the “The” message. I tried several lengths of delay time, but still cannot make sure it is sufficient for initialization. I will look into it in the next stage of production.

Next Step

  • The adjacent poem lines often have some overlapping in word choices. This may be because my word lists are not long enough. I will add more words to each list.
  • I will look into the problem of initialization.
  • Currently, the poem is infinite and has only one structure. I will make it of finite length, and add some lines of other structures/contents in between or at the end to make the poem more interesting.

Leave a Reply

Your email address will not be published. Required fields are marked *