How I ported my music to the GameBoy

First off, a little backstory: 

In 2020 I helped bring a game called ‘Hamorigami’ to life, a cute little game in which you try to protect a bonsai and help it grow. You can check it out here.

Because it was 2020 and the chill-hop raccoon was walking across my screens most of my time being stuck at home, I wanted to write a chill-hop-y piece with a bit of Japanese flair to it.

Fast forward over a year, when Luca (@punch_cafe) messaged me out of the blue, because he was working on a port of ‘Hamorigami’ to Game Boy for another game jam. And he wanted my music for it! My problem: I had never composed for Game Boy before, but for another game jam I did with Miguel (@bitbrain_), we wanted the music to sound like it was running on a GB. So I at least knew very broadly, what the hardware was capable of. If you’d like to check the game out, you can find it here:

The main menu loop from ‘Fishmonger’. 
Composed with the GameBoy in mind, but not played on a GameBoy

What is the Game Boy capable of? The OG version has a sound chip, capable of playing sound on 4 mono channels at the same time. Two of those are synthesized square waves, one channel can play very crushed / compressed samples and the last channel generates noise (i.e. for drums).

So you can basically produce 3 notes and a noise at the same time. If you want a melody and a bass, you have one note for harmonies left. You’d like a chord with that? Sorry, that’d be 3 more notes – pick one.

How do we tell the GB to make those sounds? Today, games at the most basic have an audio file played back by the game engine as a background track. Every note, sound and effect is baked into the file. The hardware generally doesn’t ‘make’ those sounds, it plays them back.

The Game Boy works differently: It actually ‘makes’ those sounds you hear form it’s speaker. It doesn’t need an audio file, it just needs the notes of the music in a way it can read them. Today the most universal way for that would probably be MIDI. Not on the GB.

This is (more or less) the basic info the Game Boy needs to make its sounds. Here you can see the four channels from left to right in OpenMPT, a kinda outdated – but open source – tracker software, that I used in this case. Every note (F#3, C#5, etc.) is placed on this grid.

The piece is playing from top to bottom, imagine like the piano roll in a saloon in an old western. Not only does this tell the Game Boy what notes to play, but also what exact sound to produce, what tempo the piece is running at or how loud which track is supposed to be.

For some better illustration of this, I have to recommend this video by The 8bit guy:

So after all this, how do you bring a chill-hop track from a fully produced track with a variety of sounds and multiple drum tracks down to those four tracks? Well, here’s what I did:

The main melody had to stay for sure, so one track is in use. As the original was a chill-hop track, the bass had to make it over in some form, to keep it groovy! One track left for chords, so we would need to split their notes over time, i.e. arpeggiate them.

If you watched the video I linked, you’ll see that there are more and more creative ways to work around the limitations. But for my first try, my approach was more basic. I also dropped the drums, because I just couldn’t make them sound right.

So I took my original project that I did in Logic Pro X. arranged it down to only three notes playing at a time (remember, one channel only makes noise) and exported it as a MIDI file. This holds all the musical information about the composition – just as data.

For some reason, importing that MIDI file into OpenMPT would prove to be complicated. Seemingly there are some incompatibilities. So I imported the file into Guitar Pro 7 (I know, that’s what I have) for a little easier editing. Some clean up and tweaking later – it worked!

So here it is – keep in mind that it’s a loop in the game and that it’s my first attempt at chiptune for the GameBoy!

BIG shoutout to @punch_cafe, who gave me the opportunity to check all of this out and play around with chiptune! He also promised to actually put the game on a real Game Boy cartridge and send it over to me! Gotta find my bulky grey box!

And, in case you’d like to give it a try in an emulator (or also want to flash it onto an actual Game Boy cartridge) – here it is:






Leave a Reply