Rapping About What’s On Steam

“Computer, please write and perform a rap about Obra Dinn.”

Some of you may recall my MicroTrailers bot, which cuts a 6-second trailer for every Steam game (and later became part of Steam proper during my infiltration of Valve tenure doing Steam Labs). Since then, AI’s found its way into all sorts of places—we have AI-generated food, AI-generated daycare, and entire AI-generated naked mole rat families—but we don’t have a system we can tell to rap about an arbitrary game, and I think this is an oversight.

Take Game, Produce Rap

What you see above is the Totally Human Rapper. I wanted it to be entirely autonomous, so it has two requirements:

1. I tell it a game.

2. It creates a whole rap video about that game.

It will research the game, gather media for it, write lyrics, and produce a finished product cut to the beat.

Step 1: The Auto-Researcher

GPT-3’s pretty capable. It knows about a lot of games, and you can ask it about a popular one that launched a few years ago:

Tell me about Deep Rock Galactic.

Deep Rock Galactic is a sci-fi first-person shooter game developed by Ghost Ship Games. It is set in an alien-infested, procedurally generated underground environment. Players take on the role of a Dwarf space miner, exploring the various environments while fighting off alien creatures…

However, here’s what happens if you ask it about a lesser-known one:

Tell me about Luck be a Landlord.

Luck be a Landlord is a strategic property trading card game that puts players in the role of a real estate investor. Players compete to buy, sell, and manage properties to build the most valuable portfolio.

Is this true?

This is a complete fabrication. You know the drill: expect GPT-3 to lie to you. Since I actually want this rapper to entertain and inform, it all needs to be accurate. One way to handle this would be to collect the information and feed it into GPT-3, but I’m lazy.

“Computer, go research it, yourself!”

Steam Store pages have just about all the information we need for starters:

  • Short Description: The text blurb at the upper-right of the page; usually around 50 words long.

  • About This Game: The longer description which does a deeper-dive into the game.

  • Factual Info: System requirements, number of players, and so forth.

  • Professional Reviews: Typically pull quotes from websites and streamers.

  • Player Reviews: Text of the player reviews sorted by “most helpful.”

They have a nice Web API which yields nice, tidy JSON info about a game, which is great—except we need more info than is stuffed in there, so we use Python and BeautifulSoup to scrape the actual HTML page as well.

If you’ve ever used BS4, you know how great it is. Go pick up Leonard Richardson’s sci-fi novel that has nothing to do with BS4.

Step 3: Generate the Lyrics

We’ll be sending this to GPT-3 text-davinci-003 (as I write this, OpenAI just released GPT-3.5, so more on that later!) as a single prompt. So, we need to tell our script everything it needs to know about the game and then ask it a single question. The request looks something like this:

At the end of that block of text is the actual request to generate the lyrics:

Write me a rhyming rap about this game.
Exclude verse and chorus headers.
Keep each line to about 8-10 words.

The script calls out to GPT-3’s API, which generates this:

Destiny two, it's something new,

A world of adventure, me and you,

Gun and sword, battle hordes,

Guardians of the Last City, of course,

Titans, Warlocks, Hunters, too,

Fight off the darkness and save the crew,

Exotic weapons, armor galore,

No other game has ever done more,

Rain devastation, clear the sky,

Write your legend in the stars, you and I.

That’s not bad for a computer!

  • It understood info about the game, and was able to pull out the important bits.

  • Line length was good—it can get lengthy if you don’t rein it in a bit.

  • It got rhyming couplets pretty good. “Hordes” and “of course” is a stretch, but I’ll take it.

There’s sometimes a bunch of cruft in GPT-3’s response (extra spacing or non-lyrical words like “Here’s Verse 1”), but we can clean that up procedurally.

Step 4: Rap It!

I used Uberduck for TTS. I wasn’t able to get their API working, so I did it the ugly way, using Selenium to automate logging into a browser, hit buttons, and download the audio files as though a user were sitting there hitting keystrokes. Here’s what the first line sounds like:

Step 5: Add the Music

For this exercise, I just stacked a bunch of loops for the backing track, easy peasy. The Totally Human Rapper then does this:

  1. Chops that track into measures.

  2. Aligns each TTS rap line to the beginning of a measure.

  3. Composites it.

The backing tracks sounds like this:

Step 6: Slice and Dice Video

For visuals, it snags the first trailer on the game’s Steam Store page as source material. It lines the video cuts up to the beat; similar approach to what I did for MicroTrailers, like so:

  1. Clip off the beginning and end of the trailer video. Typically this contains ESRB notices or URL title cards which aren’t super exciting for a rap video.

  2. Get the length of a song’s measure—call it about 2.5s for a 90BPM track—and the number of lines we’re rapping (10, from above).

  3. Snag 2.5s snippets of clips from the source video.

  4. Shuffle those snippets and composite them into a single video.

Step 7: Put it All Together!

Backing track + TTS rap + composited video = finished AI-generated rap! That sounds like this:

Totally Human Rapper - Destiny 2

One More for Good Measure

Totally Human Rapper - Retired Men’s Nude Beach Volleyball

Retired Men's Nude Beach Volleyball League

A silly game, with a title so unique

Play as Len, an older gentleman

Navigate life, one serve at a time

A narrative based game, set in MA

Beautiful locations, you'll have to explore

Challenging and fun, you'll want more

It's a hidden gem, a passionate project

Narratives and themes, that you won't forget

Retired Men's Nude Beach Volleyball League

A game you'll love, a game you'll need

Listen to All the Raps So Far

That’s it! The goal’s to do one for every game on Steam, though that’ll take a while.

My next generative musical attempt will be to generate a melody and sing it. Have you heard Synthesizer V sing? It’s pretty good.

Anyway, I’d love to hear what other folks are doing in the area, so if you want to chat, I’ll be here all week.

Previous
Previous

50 AI Voices: Which Reigns Supreme?

Next
Next

AI Concepting: From 3 Hours to 30 Minutes, Thanks to Scenario.gg