generative poetry 

I started writing another using cmudict (a dictionary with pronunciations).

Implemented in , output is , generates 729 in around 20 minutes (depending on the pseudo-random number generator seed).

A sample plucked from my terminal:

## 594 M ZH

mirage mirages schlumberger margette\
computervision measure camouflage\
minasian st_germaine regime majette\
revisionism jeanmichele massage\
malaysians measurable st_germaine\
submersion macrovision measurement\
minassian measurable st_germaine\
regime's decisionmaker measurement\
minassian measurable camouflaged\
computervision jeanmichele regimes\
montage computervision camouflaged\
limoges regime gilmour gilmour regimes\
revisionism jeanmichele margette\
revisionism jeanmichele majette


generative poetry 

Since posting, I changed the output to LaTeX to format an 8-page zine of 6 poems from 4 phones (podcast 5 per week) and a book of 66 poems fro 12 phones (podcast 1 per week):

Then I added a continuous plain text output and hooked it up to festival text to speech and darkice streamer (via snd-aloop alsa loopback device linux kernel module) to make a continuous radio stream.

Still testing so it may be unstable...

All of this runs on a 4 core Raspberry Pi 3B+ with 1GB RAM (of which 270MB and 100% of one core is used by the poem generator, and 330MB is used by the text to speech).

· · Web · 2 · 1 · 0

generative poetry 

I realized that the Haskell poem generator (plus Festival TTS) for the streaming radio takes so much memory that the machine will completely run out of memory when the second instance of the poem generator is launched by the zine generator cron job early on Monday morning. So I'll stop the radio tonight until I can figure out a better solution (which is probably rewriting the poem generator in C).

generative poetry 

reimplemented the poem generator in C instead of Haskell and it is much more efficient (10MB instead of 270MB memory) and faster too (though the algorithm is slightly different so true comparison is impossible).

my Haskell was rubbish because I used String for persistent data (it's only acceptable for streaming).

generative poetry 

I made the poem generator have a 1-shot mode (generate n poems and exit, instead of generate poems forever).

This means I could use flite instead of festival, which uses much less memory (20MB vs 360MB) and cpu power.

Doing 1 poem at a time means I can do other fun stuff, like changing the voice for each poem, and setting stream track titles using curl.

generative poetry 

I made the C algorithm more like the Haskell one (using syllable count rejection sampling on lines as a whole so as not to bias the ends to shorter words; and rejecting lines whose meter is too far from the desired).

This makes it much slower, so I added a pipeline to the streaming setup: generate the next poem while the previous poem is still playing.

Still getting silent pauses sometimes when poem generation takes too long (I have a timeout of 1 minute to avoid infinite pause, poems take about 50 seconds to read), so next I'll increase the pipeline length to more than 1 poem.

Sign in to participate in the conversation

A fediverse community for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.

<svg xmlns="" id="hometownlogo" x="0px" y="0px" viewBox="25 40 50 20" width="100%" height="100%"><g><path d="M55.9,53.9H35.3c-0.7,0-1.3,0.6-1.3,1.3s0.6,1.3,1.3,1.3h20.6c0.7,0,1.3-0.6,1.3-1.3S56.6,53.9,55.9,53.9z"/><path d="M55.9,58.2H35.3c-0.7,0-1.3,0.6-1.3,1.3s0.6,1.3,1.3,1.3h20.6c0.7,0,1.3-0.6,1.3-1.3S56.6,58.2,55.9,58.2z"/><path d="M55.9,62.6H35.3c-0.7,0-1.3,0.6-1.3,1.3s0.6,1.3,1.3,1.3h20.6c0.7,0,1.3-0.6,1.3-1.3S56.6,62.6,55.9,62.6z"/><path d="M64.8,53.9c-0.7,0-1.3,0.6-1.3,1.3v8.8c0,0.7,0.6,1.3,1.3,1.3s1.3-0.6,1.3-1.3v-8.8C66,54.4,65.4,53.9,64.8,53.9z"/><path d="M60.4,53.9c-0.7,0-1.3,0.6-1.3,1.3v8.8c0,0.7,0.6,1.3,1.3,1.3s1.3-0.6,1.3-1.3v-8.8C61.6,54.4,61.1,53.9,60.4,53.9z"/><path d="M63.7,48.3c1.3-0.7,2-2.5,2-5.6c0-3.6-0.9-7.8-3.3-7.8s-3.3,4.2-3.3,7.8c0,3.1,0.7,4.9,2,5.6v2.4c0,0.7,0.6,1.3,1.3,1.3 s1.3-0.6,1.3-1.3V48.3z M62.4,37.8c0.4,0.8,0.8,2.5,0.8,4.9c0,2.5-0.5,3.4-0.8,3.4s-0.8-0.9-0.8-3.4C61.7,40.3,62.1,38.6,62.4,37.8 z"/><path d="M57,42.7c0-0.1-0.1-0.1-0.1-0.2l-3.2-4.1c-0.2-0.3-0.6-0.5-1-0.5h-1.6v-1.9c0-0.7-0.6-1.3-1.3-1.3s-1.3,0.6-1.3,1.3V38 h-3.9h-1.1h-5.2c-0.4,0-0.7,0.2-1,0.5l-3.2,4.1c0,0.1-0.1,0.1-0.1,0.2c0,0-0.1,0.1-0.1,0.1C34,43,34,43.2,34,43.3v7.4 c0,0.7,0.6,1.3,1.3,1.3h5.2h7.4h8c0.7,0,1.3-0.6,1.3-1.3v-7.4c0-0.2,0-0.3-0.1-0.4C57,42.8,57,42.8,57,42.7z M41.7,49.5h-5.2v-4.9 h10.2v4.9H41.7z M48.5,42.1l-1.2-1.6h4.8l1.2,1.6H48.5z M44.1,40.5l1.2,1.6h-7.5l1.2-1.6H44.1z M49.2,44.6h5.5v4.9h-5.5V44.6z"/></g></svg>