Procedural Music in 256 bytes.

If there is one type of music that I have an incredibly strong taste for, it’s chiptune music, ones played by electronic circuits and chips rather than actual instruments. Classic games are a great source of these tracks and some of my most memorable melodies come from them.

During the Oldskool 4K Intro competition at Revision 2017, the Swedish hacker Linus Åkesson, manages destroy the 4K intro limit, with a tiny program in 256 bytes for the Commodore 64, a 1/128 factor reduction of the maximum. It is not a surprise that it won first place in the competition.

My day job involves me working with bloated runtimes and gigantic libraries that some span in the order of several gigabytes. Powerful machines with several cores and gigabytes of RAM are required to run these applications.

I am humbled by classic video game designers who had to work with tiny amounts of RAM and pathetic processors found in calculators like the Motorola 68000 and still manage to have colourful experiences with wonderful sound running at 60 frames per second.

The goal of these developers wasn’t some philosophy like maintainability or a certain idioms or design patterns, but rather extracting the most out of the hardware and provide the most impressive gaming experience.

When the Revision 2017 demo competition was over, I start looking at the winners, and nothing touched me more than the “A Mind is Born” demo. His technical description barely fits in my head and makes me feel like a novice programmer in my first programming course.

The actual executable is 256 bytes, and there was room to spare with the first instruction being a no-op (NOP). Ironically, the SID tune is larger at 325 bytes and encoding to MP3 would make a file larger than 2 MB. Encoding this blog post in UTF-8 is more than 256 bytes!

The music is generated by the program itself rather than having a score embedded in the program. The conductor isn’t the programmer, but the program. This is the procedural aspect of it. It sounds like a chaotic psytrance piece building up to a strong climax at 1:42 morphing into a real pseudo-orchestra.

This chilling piece of music shows what the mind of true geniuses can produce. If you don’t get goosebumps listening to this, you have no appreciation of true technical art. I recommend a listen with a good set of headphones to enjoy the incredibly deep bassline.