Beat Saber & the Future of Custom Songs

David Idol
9 min readAug 24, 2020

Why is piracy a requirement to enjoy your own music library in a video game like Beat Saber?

Custom Songs and Unofficial Expansions

(If you are already familiar with Beat Saber and song mapping you can skip this section)

Beat Saber is a popular VR rhythm game where players use sabers to slice blocks in rhythm with music. It’s a simple formula that is incredibly fun and deceptively difficult to master.

Beat Saber comes with a relatively sparse selection of songs, and six DLC packs (with about one album’s worth of songs each) that players can purchase to add additional tracks to the game. This is a system similar to other rhythm games, like Rock Band or Guitar Hero, before it.

DLC for Beat Saber is great — but limited and slow to materialize

While new songs are indeed coming to Beat Saber via DLC packs: the pace at which new songs are released is slow, and the breadth of music available is generally minimal. This is primarily due to all the process and negotiation required for the game’s developers (Beat Games) to license the music for the game, as well as the amount of effort required to bring the tracks into the game.

In order to make a song playable in Beat Saber, a human has to manually time and place the blocks for the player to hit. Things like the number of blocks, the configuration, the timings, etc. are all important to get right (and typically each song has multiple difficulties as well — each with their own unique block-slicing pattern).

This process of placing and configuring the blocks that correspond to a specific song in Beat Saber is called “mapping,” and the data generated in the process is referred to as a song “map.”

And this brings us to the not officially recognized yet totally massive elephant in the room when it comes to Beat Saber: custom songs and modding.

Want to play a specific song in Beat Saber? Maybe one not included in the official releases? There are thousands of unofficial maps for songs that can be added to the game in a single click.

These versions are player-created rather than official DLC, but many of these maps are of equal (or in some cases better) quality than the official ones.

There is one major issue with these custom maps, however: they are all currently distributed alongside a full copy of the (oftentimes copyrighted) song.

And these mappers put a lot of hard work into their maps, spending hours and hours to perfect them. So it’s always a shame to see this potentially taken offline due to a copyright issue.

Even Beat Games’ CEO recognizes the craft and love that goes into these custom maps but is quick to point out the copyright ramifications.

An example of a custom map

The Timing Problem and Why It Affects Distribution

So is this just another example of online piracy and folks looking for ways to get something for free instead of paying for it? Not exactly — in fact there are many reasons why this is done this way that have nothing to do with piracy at all.

Sure it’s easier to click a link and instantly download a song for free than it is to go to an online store and pay for it (or rip a digital version of the music from a physical copy like a CD), but that’s only one of the smaller hurdles involved when it comes to custom Beat Saber map distribution.

My hypothesis is that Beat Saber players would happily pay for the legal rights to many of these custom songs (similar to how many currently pay to listen to songs on Spotify or download legal .mp3/.m4a copies on iTunes or Amazon Music)

Unfortunately, this is not currently an option.

Shane Monroe wrote a full article about why custom Beat Saber maps historically needed to distribute the entire song file (and thus are oftentimes at-odds with copyright law) here — it is worth a read.

To summarize one of the main issues highlighted in Shane’s post:

When it comes to buying a song online there are lots of inconsistencies between various renditions and purchase options.

There are radio edits, clean vs explicit versions, differences in audio encoding, etc.

Plus, mappers very often like to tweak things about the song, such as adding some silence to the beginning of the track so the notes don’t come flying at you the instant you start the song in the game.

If a mapper were to distribute just the map data without the song itself:

  • The players attempting to play the map in Beat Saber would need to provide their own audio file (e.g. purchase it from iTunes)
  • Even after providing the audio for the song: they would likely find out that their copy of the song is totally unplayable because it does not match the timings of the map, or the audio is not in the correct format for the game to recognize.
Image via bsaber.com

The result? Piracy — but for technical reasons: all the major custom Beat Saber song websites end up delivering the entire song along with the map. They pretend it’s not a problem and resort to (1) ineffective notices warning users to not distribute copyrighted music and (2) DMCA report links in order to reduce liability. Essentially: “ask for forgiveness instead of permission.”

More Software: the Solution to Everything

As a software engineer, I noticed that some of these issues can be automated.

Specifically, there are three main things I believe a computer program can do to assist in making legal custom map distribution (without the copyrighted music file) viable:

  1. Request a copy of the song from the user — it is up to them how they purchase or rip the song, but it will no longer be provided as part of the map download — and verify the original (“master”) audio file is the same as the one the mapper started with when they made the map (regardless of audio format or bit-rate). This ensures there are no unexpected differences in timing (e.g. radio edit vs explicit versions of the song).
  2. Alter the original “master” audio with any changes the mapper wants to make: such as adding silence, fades, trimming, or adjustments to the dynamic range. These changes would have to be represented as external “patches” instead of direct changes to the audio data, which is different from how existing audio edits are made in the current system.
  3. Convert the final audio file into a consistent format Beat Saber understands — regardless of what the source file format was.

If we can do these things effectively then we can ensure an easy and consistent experience for players, and without sacrificing very many “features” or capabilities for mappers.

This isn’t without prescient either: games like DMT, Beat Hazard, and Audiosurf all allow you to synchronize and play games from music on your hard drive.

Saber Song Patcher

Here is my attempt to solve the above issues:

Saber Song Patcher
Saber Song Patcher (github.com)

https://github.com/idolize/saber-song-patcher

And here’s how it works:

1. Verification

The song verification process is done via a multi-step set of checks.

The first check it does is against a set of known-good SHA-256 file hashes. This lets us know right off the bat if the user is starting with an exact file we have already verified manually — and if so we can 100% guarantee compatibility with the map.

If the check fails though: fear not. Our next check is more sophisticated, and it uses a technology known as “audio fingerprinting.” This technology doesn’t just recognize a specific file, but rather the characteristics of the sound waves. It generates a spectrogram of the song that it can compare sounds to (even if they vary in noise, loudness, format, compression, etc.) — you may be familiar with similar technology used in applications like Shazam or even YouTube’s Content ID system.

Using this audio fingerprint (as well as some basic sanity checks around audio length), the tool can detect that the song is the same even if it doesn’t match the file hashes! So, users can download their copy from any number of legal sources (Google, Apple, Amazon, etc.) or even rip their own copy in whatever format they want and it should work all the same.

Also, the Saber Song Patcher config format has a place for mappers to direct users to specific URLs where they can buy the song.

2. Patching

Audio, like any other data, can be modified. How and what modifications to make can be represented as a “patch” that is applied to an original file.

While Shane Monroe says he doesn’t believe mappers are willing to go through the effort of breaking down their changes to the master audio into specific patches, I personally think we can represent the majority of audio changes as simple patches without too much additional work.

It’s not without some challenges, however.

Challenge #1: Any changes to the master audio track must be stored in a manner that is reproducible from only the original audio track, because the end user will need to perform the same exact set of changes in order to be sure the map stays synchronized.

Challenge #2: Any changes must also be stored in a patch format that does not itself contain copyrighted data. For example, if a mapper starts with song A and remixes it to include the entirety of another song B, then the “patch” would necessarily need to include all the audio data for song B as well, which is a no-go.

So our patches need to only allow (and store data representing) simple changes to the original song (e.g. tweaks in timing), as these changes themselves are not copyrighted.

Here’s the compromise I made in the current version of Saber Song Patcher: the mapper provides a single configuration file along with the song. That configuration file that can contain any optional combination of fades, trims, and silence padding as patches, and are written in a simple JSON format:

"patches": {
"delayStartMs": 5000,
"padEndMs": 5000,
"trim": {
"startMs": 0,
"endMs": 30000
},
"fadeIn": { "startMs": 0, "durationMs": 10000 },
"fadeOut": { "startMs": 20000, "durationMs": 10000 }
}

I’ve been chatting with some folks on the Beat Saber Modding Group Discord channel about additional types of patches, as well as better and easier ways to generate and test these patches (e.g. an Audacity plugin or GUI tool instead of editing a JSON file by hand).

3. Conversion

Finally, (thanks to the wonderful ffmpeg project) Saber Song Patcher can take the patched audio and convert it to the proper format — ready for use in Beat Saber just like any other custom map you download today!

Where to go next?

Now that Saber Song Patcher exists, is the problem “solved”?

I think in order for there to be any meaningful impact we (the Beat Saber community) need to adopt the tooling into existing software like ModAssistant and BeatSaver.

For example, perhaps in addition to the existing “1 click install” option in ModAssistant, we could also have a “2 click install” option where you have to first select the master audio file for the song on disk (at which point it is verified, patched, and converted) and then the map is automatically installed like today. Hardly any more work for the user, and no copyrighted song is distributed illegally.

Stay tuned — I believe with better tooling integration, continued improvements to the verification and patching process, and the idea of a robust system that isn’t subject to takedown — we can make it a reality.

Other Questions

What about streaming services like Spotify or Apple Music?

While that would be really nice to have, it is even harder to synchronize streaming music than downloaded songs (e.g. what if it needs to buffer?). Plus, Beat Saber itself is not set up to work with external audio sources so there would be additional work required to mod the core game engine itself. Very tricky.

--

--

David Idol

Software Engineer. Currently @ Snap. Previously @ Xbox, Google, IBM.