In 1981, the long-time pinball manufacturer Williams Electronics released their first video game to the arcades: Defender. Inspired by the space shooting games Space Invaders and Asteroids before it, Defender upped the ante with a horizontally scrolling playfield, a varied cast of alien aggressors with distinct, sophisticated behaviours, a search and rescue element to further tax the player's attentions, and an idiosyncratically detailed control scheme that evoked the complexity of actual spaceflight with no less than five action buttons and a 2-way joystick. The game's aggressive energy was lapped up by eager players, resulting in a mega hit that joins the icons of the early videogame era.

Not least amongst Defender's striking qualities was its sound. Its other-worldly crackles, zaps and screams stood out in the busy soundscape of an arcade. Around this time, audio in arcade games was largely transitioning from the use of electronic circuits built from individual analog components (resistors, capacitors) hardwired together in a dedicated arrangment for each game, to off-the-shelf microchips designed to generate simple digital waveforms by direction of programming in software.

In contrast, Defender's sound architecture seems almost impractically forward-looking for the time. It consisted of an 8-bit DAC and a seperate, general purpose CPU (similar to the one being used to run the actual game) to feed values to it. Such a setup is potentially ideal for playing samples, though it wasn't used in that way. Defender's head designer and lead programmer, Eugene Jarvis, explains:

"Randy Pfeiffer pioneered this design and showed its power in the Steve Ritchie 1978 pin “Flash”. You could in principle make any sound possible, you just had to program it and fit all the data into 2 Kbytes of ROM, and 128 bytes of RAM along with all the other sounds and program. The obvious solution is to just record the desired sound effect and play it back – like todays iPod. Unfortunately, at the standard sample rate of 44Khz, the 2 kbytes would last for about 50 milliseconds of sound. Good enough for one short bird chirp. So the trick was to create sounds that could be mathematically expressed into a very small amount of data, or a very compact algorithm. And this gets to the basis of what sound really is. It is just a string of numbers converted to audio energy. So the challenge to the sound programmer is to generate very interesting strings of numbers to the human ear."

Fortunately Jarvis and his colleagues were well up to the challenge. They wrote tiny, densely effective assembly language programs to compute the shape of their game's sound wave, its each and every numeric position, one point at a time. The key algorithm, christened "G-wave" by Jarvis, is a flexible wavetable synthesizer. Colleagues Larry DeMar and Sam Dicker wrote specialized code for other sound effects. Their programs utilise some of the now commonplace building blocks of sound synthesis: pulse width modulation, random noise, LFO, echo, the aforementioned wavetables - and add a little magic on top. Jarvis continues:

"I was stunned to find out that the most brilliant sounds were often created by typing in random numbers for the parameters. Often incredible sounds were generated by inputting mathematically undefined values, such as echoing a sound “0” times. The crudeness and lack of bounds checking of the program allowed for mathematical wraparound and error accumulation that sounded ethereal."

This website comes about from reading the 2 kilobyte Defender sound program, dumped from the game's ROM chips by others and decoded to Motorola 6802 assembly language, puzzling out its elegant workings and converting it to cosmically (comically) less efficient, but easier to digest JavaScript.

Choose one of the nine sound groups (which correspond to different code paths / sub-programs in the original ROM), choose one of the original parameter presets, and hit the play button (or press the P key) to hear the sound. Hover the mouse over various controls to read popup tips. Read the disassembled or converted code if you're so inclined. Or just enjoy making your own, semi-authentic Williams sound effects by tweaking the parameters controls at random.

Daniel Lopez, December 2020

Return to the studio.

Links

A wealth of Defender information - further history, media, playing tips, you name it - can be found at the Defender pages of the Robotron 2084 Guidebook:
http://www.robotron2084guidebook.com/defender/

An absorbing video of the game being played by a chatty expert:
https://www.youtube.com/watch?v=8PEpDMgR9D0

Other Defender reverse engineering and hacking efforts:

A partial sound disassembly and a much more detailed description of the hardware:
https://namelessalgorithm.com/defender/

Another partial sound disassembly:
http://zeninstruments.blogspot.com/2020/02/williams-defender-sound-disassembly.html

A hardware reimplementation of the Williams sound board:
https://akm.net.au/will-i-roms/

A disassembly of the gameplay ROM:
https://github.com/AaronBottegal/Defender-Source-Code

[January 2021] The original Defender source code (gameplay, not audio) has apparently surfaced:
https://github.com/historicalsource/defender

[April 2021] And now, so have the audio sources! I thought I'd never see the day...:
https://github.com/historicalsource/williams-soundroms

Defender sounds in popular music:
https://www.whosampled.com/Williams-Electronics/Defender/sampled/

Defender at Wikipedia:
https://en.wikipedia.org/wiki/Defender_(1981_video_game)

The relatively recent practice of generating "Experimental music from very short C programs", or 'bytebeat' as so called, resembles the art and technique of Defender's sound program in some ways:
http://canonical.org/~kragen/bytebeat/